Announcement

Collapse
No announcement yet.

GENERAL: E-Cafe III

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fixed EitherPrerequisites (optional prerequisites) in advance.txt. A maximum of 4 (prerequisites + eitherprerequisites) can be used per advance. e.g. Writing can lead to 4 other advances, as a prerequisite or eitherprerequisite. And e.g. Trade can only have 4 required advances (prerequities + eitherprerequisites). As far as I know this is just a limitation of the great library tech tree tab height, so could possibly be increased.
    modified trunk/ctp2_code/gs/gameobj/Advances.cpp
    nice. i recall the advances.cpp being so confusing. it just wasnt structured like the more straight forward like units or buildings. i have code on resource prerequisite advances too that only 'half" worked.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • Originally posted by Ekmek View Post
      nice. i recall the advances.cpp being so confusing. it just wasnt structured like the more straight forward like units or buildings. i have code on resource prerequisite advances too that only 'half" worked.
      It is quite confusing. I only fixed it in Advances::ResetCanResearch, I'm wondering if anywhere else needs to be fixed or added too? It's working on every test I've thrown at it though.

      The GL tech tree is annoying but I'm about to post another fix for that now, hopefully the last.
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • Added roll over AI. Now the AI will now pick a path that goes over enemy units if there is a war and the roll over army is strong enough. This removes the problem the AI has with ZOCs and clears the room around an enemy city that is to be conquered.
        That is awesome.
        "

        Comment


        • Changed occurances of UnitRecord::GetMaxHP to UnitData::CalculateTotalHP, some to fix the unit healthbar overflowing when you get a hp bonus, and some for consistency in calculations:
          for code consistency you might want to check what I did when the hp went below 0 after a bomvard. I recall that if I bombarded a unit I'd get a huge red bar to the left. I eventually got it to kill, but in the case of non lethal bombardment I had to make it stop at 1 hp instead of keeping a unit alive with negative hp.
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • Originally posted by Ekmek View Post
            for code consistency you might want to check what I did when the hp went below 0 after a bomvard. I recall that if I bombarded a unit I'd get a huge red bar to the left. I eventually got it to kill, but in the case of non lethal bombardment I had to make it stop at 1 hp instead of keeping a unit alive with negative hp.
            I tested NonLethalBombard and it works fine, perhaps it can be expanded to allow different levels of maximum bombard damage.

            And actually while I was checking the bombard method I noticed that not all the bonuses were being added to ranged attack rating when bombarding, so it was good I did check it.
            Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
            CtP2 AE Wiki & Modding Reference
            One way to compile the CtP2 Source Code.

            Comment


            • I'd like to see all the bombard stuff put together in a bombard ability for better organization, but it would ruin compatibility with mods.
              "

              Comment


              • nm
                Last edited by EPW; August 7, 2009, 04:21.
                "

                Comment


                • Originally posted by Ekmek View Post
                  nice. i recall the advances.cpp being so confusing. it just wasnt structured like the more straight forward like units or buildings. i have code on resource prerequisite advances too that only 'half" worked.
                  I'm having a real nightmare with the goody hut advance selection regarding eitherprerequisites. It looks like you gave up and just left the comment:

                  //remove this and use advances->m_researching ??? EMOD

                  I don't blame you. In my opinion it's far too complicated a process for choosing an advance (or unit type) from a ruin to search all the advances and their prerequisites. A simple flag with the unit and advance would be enough, but I'm afraid that Martin might revert my changes straight back if I did it.
                  Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                  CtP2 AE Wiki & Modding Reference
                  One way to compile the CtP2 Source Code.

                  Comment


                  • Originally posted by EPW View Post
                    Added roll over AI. Now the AI will now pick a path that goes over enemy units if there is a war and the roll over army is strong enough. This removes the problem the AI has with ZOCs and clears the room around an enemy city that is to be conquered.

                    That is awesome.

                    I ran a couple of test games on regular maps and both ended before turn 200 because of one rampaging AI. It seems to be doing something.
                    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                    CtP2 AE Wiki & Modding Reference
                    One way to compile the CtP2 Source Code.

                    Comment


                    • the AI does not build ships in cities that are just at a puddle than at an ocean
                      This was on my TODO list before my PC died. It should help the AI a lot in the early stages.

                      I can't view the code at the moment (need to reinstall everything still), but does it check that the water that is next to the city is not only one water tile, or does it check if that water is connected to a water "continent", or something else?
                      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                      CtP2 AE Wiki & Modding Reference
                      One way to compile the CtP2 Source Code.

                      Comment


                      • This was on my TODO list
                        I did it ... via SLIC:
                        Code:
                        int_f mod_CanCityBuildUnit(city_t theCity, int_t theUnitType) {
                        	city_t tmpCity;
                        	int_t tmpUnitType;
                        	location_t tmpCityLoc;
                        	location_t tmpWaterLoc;
                        	int_t tmpPlayer;
                        	int_t i;
                        	int_t tmpIsOcean;
                        
                        	tmpCity = theCity;
                        	tmpUnitType = theUnitType;
                        	tmpCityLoc = tmpCity.location;
                        	tmpPlayer = tmpCity.owner;
                        	tmpIsOcean = 0;
                        
                        	if(CityIsValid(tmpCity)) {
                        		// make sure the AI doesn't build a navy at the lake
                        		if(!IsHumanPlayer(tmpPlayer)) {
                        			if(UnitDB(tmpUnitType).WoodenShip
                        			|| UnitDB(tmpUnitType).IsSubmarine
                        			|| UnitDB(tmpUnitType).ActiveDefenseOnlyWhenCarryingEnablers
                        			||(!UnitDB(tmpUnitType).CanEntrench
                        			&& !UnitDB(tmpUnitType).NoFuelThenCrash
                        			&& !UnitDB(tmpUnitType).CanBeExpelled
                        			&& !UnitDB(tmpUnitType).CanBeSued)
                        			&& !UnitDB(tmpUnitType).IsSubmarine) {
                        				for(i = 0; i <= 7 ; i = i + 1) {
                        					if(GetNeighbor(tmpCityLoc, i, tmpWaterLoc)) {
                        						if(IsWater(tmpWaterLoc)) {
                        							if(GetContinentSize(tmpWaterLoc) >= (GetMapWidth() / 2)) {
                        								tmpIsOcean = 1;
                        							}
                        						}
                        					}
                        				}
                        				if(tmpIsOcean == 0) {
                        					return 0;
                        				}
                        			}
                        		}
                        	}
                        	return 1;
                        }
                        Another obsolete workaround ...
                        The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

                        Comment


                        • Originally posted by Maquiladora View Post
                          This was on my TODO list before my PC died. It should help the AI a lot in the early stages.

                          I can't view the code at the moment (need to reinstall everything still), but does it check that the water that is next to the city is not only one water tile, or does it check if that water is connected to a water "continent", or something else?
                          It checks the tiles around the city. If a tile is a water tile then it checks its continent size and if the continent has more then 25 tiles the city is at an ocean.

                          In fact, that is a function from the original code, and was partially used in the build list selection, therefore it just appeared occasionally on my map with one city at a puddle.

                          -Martin
                          Civ2 military advisor: "No complaints, Sir!"

                          Comment


                          • why is it 25? could instead take the movement of the unit and double it?. just thinking in terms of mod possibilities.
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • Originally posted by Ekmek View Post
                              why is it 25? could instead take the movement of the unit and double it?. just thinking in terms of mod possibilities.
                              I don't know why 25, for that you have to ask Activision. In fact, this is just an estimation, what would give the real answer or a better approximation is the number of adjacent land continents that water area has. If that number is bigger than one you would have some reason to go over that ocean, but also if it is big enough, so that it is a shortcut.

                              If you make that number dependent on the unit movement then for faster units the length saving you get by the shortcut in percent is the same, so it doesn't make sense to make it dependent on unit movement. To make it dependent on the world size isn't a good solution either, since you could have two continents on the world separated by an ocean on the equator that is smaller then half the world size.

                              Probably, the map generator is supposed to generate either big oceans or small puddles. Big oceans have land continents inside them and always bigger then 25 tiles and puddles are always surrounded by land and smaller then 25 tiles.

                              -Martin
                              Civ2 military advisor: "No complaints, Sir!"

                              Comment


                              • I updated my post a bit on how to get the source to compile. I managed to do it all in under 2hrs this time (although I had already downloaded everything).
                                Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                                CtP2 AE Wiki & Modding Reference
                                One way to compile the CtP2 Source Code.

                                Comment

                                Working...
                                X