1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Bug Reports and Discussion

Discussion in 'More Naval AI Modmod' started by Tholal, Jan 3, 2013.

  1. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,057
    Location:
    Kael's head
    Wouldn't that allow you to create Flood Planes on desert tiles that are next to rivers though? Those are not all flood planes originally.
     
  2. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    386
    Location:
    USA
    First it would change the plot into a plains and then it would no longer be eligible for a floodplains because it is not a desert so none is placed. Even if the order were reversed it would remove the floodplains when the plot is changed from desert to plains.
     
  3. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    673
    That sounds a bit hacky to me. Why not <FeatureBlock(s)> (cannot cast on plots with that feature) and <AlwaysKeepFeature(s)> (or better names)? I think that would cover most cases stated here.

    I strongly disagree with workarounds like CreateFeatureType=FloodPlains for spring. First, nobody will get what is meant without further explanation. Second, if anybody changes the code (f.e. removes the change in post #260), he will certainly be not aware that it will break spring.
    Tags should do what they appear to do, and only used in that way (well, preferably). Otherwise the code is difficult to unterstand.

    And I don't think two new tags really hurt so much.
     
  4. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    That sounds reasonable to me. And these tags could also be used by mod-modders to do some interesting things (not even necessarily tied to terraforming spells).
     
  5. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    386
    Location:
    USA
    Ok I will add some tags. I will also add <PyAlternateReq> for spells. This will allow modders to define a python function to be checked before everything else in canCast(). I call it an alternate requirement because if it returns true then you can cast a spell even if it would normally fail its other requirements. If PyAlternateReq returns false then it will do nothing and the code will check all the other usual requirements.

    I was also doing something a bit hacky with <PyRequirement> because Sanctify and Spring still need some python, but <PyAlternateReq> will make things more clear.
     
  6. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    These are minor bugs, but they annoy me. A few entries in the Units and the Buildings xml files have the wrong entries for the civilopedia (as linked to the in the FFH Game text file). The swordsman links to the axeman pedia, the giant tortise to the elephant, etc. These all seem to come from FFH2 itself, not this mod. Still, if I sent a list of these, would you fix them in your mod? No change happens to the game stats, just the pedia is fixed.

    Also, when FFH votes you leader of the Council, it still refers to the Secretary General of the UN. (At least it did the last time I played a couple of years ago). I can't remember the exact entry for that, but if you haven't already fixed it I could dig it up.
     
  7. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    Sure. Or if you want to send a corrected XML file that would be great!

    There are a number of Council related texts that are from base Civ. They're on my to-do list, and I'd be glad to accept any help you could provide.
     
  8. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    386
    Location:
    USA
    There is a bug with how I implemented the <PyAlternateReq> tag. It should be a quick fix. I was surprised to see a warrior cast spring :eek:. I just need to cut & paste the code to a different location.
     
  9. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    I'll be glad to take a look at them and send you a file with recommended changes.
     
  10. Fafnir13

    Fafnir13 Chieftain

    Joined:
    May 15, 2008
    Messages:
    919
    Location:
    Shoreline, WA
    Apologies if this one has already beend mentioned (long thread is long), but I'm playing a multiplayer game as the Infernals and getting OOS every time I conquer a city. I'm burning most of them (bwahaha), so it's not that a big of an issue for this particular game.
    Attached the save file, in case that helps :)
     

    Attached Files:

  11. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    As per your request, here are the xml files with the fixed pedia entries, and the fixed Council vote entries.

    There are only 5 Council vote entries that still use the default UN text, and thus needed changing by me. They are: Force_Peace, No_Trade, Assign_City, and two Force_War (one each for Over and Under). I modified CIV4VoteInfo.xml for those 5 entries - just changing the description TXT_KEY_VOTE Tag, nothing else. Then I created those five new TXT_KEY_VOTE tags in the attached file CIV4GameText_FFH2_VOTE.xml. Since the CIV4GameText_FFH2.xml file they should go in is around 8 MB in size, I thought it was better to have those entries separate so you can insert them yourself. Each entry follows the basic form of the UN entry, with the name Over or Undercouncil replacing U.N. This also means the entries are correct for non-English, since I used the translations already done in CIV4GameText_FFH2.xml for Over/UnderCouncil.

    There were a total of 7 pedia entries to be fixed in CIV4BuildingInfos.xml and CIV4UnitInfos.xml. I used your xml files and made the changes. No new text needs to be added in CIV4GameText_FFH2.xml, because no new pedia entries are made. I basically just corrected wrong links for the units/buildings by pointing them to their already existing pedia entry that for some reason was not done originally in FFH2. A couple pointed to non-existent links, so in that case I just changed the link to the Placeholder one.

    Now, there are a number of new Pedia entries that could be made using the existing FFH Lore - like from the Age of Ice BTS scenario. I'll address those in a later post.

     

    Attached Files:

  12. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    Another file fix for the Pedia. The CIV4FeatureInfos.xml on almost every entry has the correct info in the Pedia, but then has a non-existent link below it, so something like "TXT_KEY_FEATURE_FOREST_PEDIA" shows up on screen. So I removed those lines from the CIV4FeatureInfos.xml and now its clean. A screenshot of the problem is attached.
     

    Attached Files:

    • ff2.jpg
      ff2.jpg
      File size:
      18.1 KB
      Views:
      34
  13. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    The fixed file mentioned above is attached.
     

    Attached Files:

  14. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    Awesome! Thanks! These fixes will be included with the next release.
     
  15. Korac

    Korac Chieftain

    Joined:
    Dec 3, 2010
    Messages:
    21
    Location:
    On the keyboard
    I'm not sure this is a bug or not: almost every time I play the Balseraphs, Loki is killed by the AI. Sometime between turn 220 and 260, when Loki is in another player's territory, they will declare war and attack him with horse archers. He is killed by the third or forth turn. There is no pop-up informing of his demise... he just vanishes. I'm not sure if he is killed in a city, or gets cornered and can't retreat. The screen is always shifted to another part of the map, so I can't see what is happening. The one time Loki lasted the entire game was when I kept him on a continent, with no access to other player's units.
     
  16. ostar

    ostar Chieftain

    Joined:
    Nov 13, 2005
    Messages:
    160
    I'm not sure if this is intended behavior, but it's new to my experience. (I'm also using the newest version of Some Modcomps by lfgr.) On Monarch, the AI's are "Declare War" happy. Twice I was declared on (by Balseraphs and Clan) just because I did not give them my World Map. Both were far away from me, and the Clan was already at war.

    On another game, I was neighbored by Logos of the Elohim. Totally peaceful relations - they started out Pleased with me (Kuriotates), we had passage Rights, traded Maps, and no demands had been made of each other. Then out of the blue they Declare War -while still Pleased. They had more units, yes, but I had 4-5 units per city including Archers, so I wasn't defenseless. We had cities next to each other (their fault), but the Elohim had a huge area to expand in still.

    I don't recall this type of behavior before in FFH2. On the last one, sure, I could see if the Civ was an Evil Warmonger type. But the most pacifistic leader of the most Pacifistic civ when our relations were Pleased declaring War with no provocation on a fellow Good? That doesn't seem right.
     
  17. Korac

    Korac Chieftain

    Joined:
    Dec 3, 2010
    Messages:
    21
    Location:
    On the keyboard
    I've had the same experience with this mod. I think the AI puts a lot of emphasis on power ratios. If you are near the bottom of the heap, military-wise, other players are much more likely to attack, even if they are friendly with you. The odds of them bringing friends along to chop you up is also higher. I've learned to build a lot of units, and build them early, and the AI players will usually leave me alone.
     
  18. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    Known issue (also see this thread)


    Can you provide a savegame from right before he vanishes?


    Known issue. There should be a couple of improvements in this area with 2.5 and I'm hoping to work some more on this soon.

    Also, just to note it, if you are playing with the Aggressive AI setting, the AI will be very aggressive
     
  19. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    673
    In CvCityAI.AI_bestUnitAI(), there is a bit of code that is probably unnecessary:
    Code:
    eLoopUnit = ((UnitTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(iI)));
    
    [B]if (kOwner.isAssimilation() && getPreviousOwner() != BARBARIAN_PLAYER)
    {
    	if (getPreviousOwner() != NO_PLAYER)
    	{
    		eAltLoopUnit = ((UnitTypes)(GC.getCivilizationInfo(GET_PLAYER(getPreviousOwner()).getCivilizationType()).getCivilizationUnits(iI)));
    		if (eAltLoopUnit != NO_UNIT)
    		{
    			eLoopUnit = eAltLoopUnit;
    		}
    	}
    }[/B]
    
    Since the getCivilizationType() is the CvCity rather than the CvPlayer function, the assimilation effect should already applied in the first line of code. Actually the loop directly above uses just the first line without the if-statement; also eAltLoopUnit is not used anywhere else, so I don't think there is another reason for that.
     
  20. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,676
    I believe I added the code you quote a while back to fix some problems with Tolerant civs.

    In theory you are right, but when I dig into the code a bit, it seems that the m_iCiv value for cities is not being set correctly for assimilated cities. Under CvCity:init (which is used for both conquering and founding cities), setCivilizationType is being called with the owner's civilization. So I think the proper solution would be to make the fix under CvCity:init(). I'll look into it more when I get a chance. Thanks for bringing this to my attention.
     

Share This Page