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

MNAI-U: unofficial build & bugfixes

Discussion in 'More Naval AI Modmod' started by lfgr, May 15, 2019.

  1. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    New release: mnai-2.9-beta2u.

    Should be compatible with 2.9-beta1u savegames.

    Thanks a lot for all the bug reports and discussion.

    Download setup
    Download archive

    This is the first time I made AI changes, mainly based on reports in this thread:
    • AIs now build way less forts in unowned territory and should be a bit better at guarding them.
    • There is some emergency code that makes the AI guard it's only city better, if it only has one. This should reduce the number of early player kills due to barbarians. The AI seem still a bit too reckless when exploring lairs.

    Let me know if there are any problems.

    Otherwise, there are some fixes and tweaks as always. Also, there is now a BUG option to remove player death popups; this is especially useful in Revolutions, were players die all the time.

    For a full changelog, see the file mnai_changelog.md included in the download or here (unfortunately, notabug.org doesn't render some of it correctly).

    I thought I'd also sketch my plans for the next version(s). These things will also affect ExtraModMod and (probably) MagisterModMod.

    Of course, I still have a long (and evergrowing) list of small bugs, possible interface improvements and MagisterModMod requests that I'm slowly, but steadily working through. Nothing particular exciting here.

    On thing that requires a bit more work (and, crucially, larger contiguous chunks of free time) is the problem of the overflowing SoD help text discussed above. I plan to tackle this for the next version, but no promises.

    Finally, I want to slowly go through the revolutions mod to make it more transparent and fitting for FfH. The first step is making a new advisor that is at least more clear than the previous one.
    My original plan was to first make the current calculations (for local instability) transparent with tooltips in the new advisor, and then iteratively tweak them. However, the calculations are way too complicated to be displayed like this. As such, I will only make a rudimentary advisor (that shows e.g. that you get +2 instability from unhappiness, but not how it is calculated), and then revamp the whole system. I will make a post with my plans at that stage, so that interested people can discuss.
    After local and global stability is revamped, I want to continue to tweak other stuff. For example, in my last game there was a revolution that seemed to receive exclusively scouts, while way better units where already available. Again after that, it would be nice to adapt the whole process better to FfH lore (custom messages, leaders, ...). But all that is for the distant future.

    One more thing: From time to time I have to add new texts to the game, obviously in English, and sometimes I also add a Spanish translation. I'm not a native speaker of either language, though; so if you are and you see any weirdly worded phrase, feel free to post here. :)
     
    Last edited: Jun 13, 2020
    Felis catus and Tielby like this.
  2. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    Agreed, this is also a problem in MNAI with revolutions enabled.

    There actually is a check that considers ReligionType in CvUnit::canUpgrade:
    Code:
    // no cross-religion upgrades for religious units
    if (m_pUnitInfo->getReligionType() != NO_RELIGION)
    {
       if (kUnitInfo.getReligionType() != NO_RELIGION)
       {
           if (m_pUnitInfo->getReligionType() != kUnitInfo.getReligionType())
           {
               return false;
           }
       }
    }
    
    If that doesn't help, the python callback seems the best solution to me. But be aware that it might affect performance; the AI probably calls it very often. I'd have it disabled by default in MNAI.

    My guess is that this is an XML mistake again. I can look at it if you have a save or a crash dump.
     
  3. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,307
    Location:
    Kael's head
    That would stop a Wanderer from upgrading directly to a Shadow, but not stop it from upgrading to a Hunter, an Assassin, and then a Shadow.

    Would it be too big a change to check the religion of the unit to be upgraded rather than the religion type of that unit's current unit type?
    (That change would mean, for example, that a Warrior randomly assigned the Runes of Kilmorph religion would not be able to upgrade to a Radiant Guard a Confessor could not become a Prior if its religion had been changed by a python spell.)
     
  4. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    Sounds good. I guess that's what was originally intended anyway. If there are other unintended side effects, we can see how to solve those intependently.
     
  5. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,307
    Location:
    Kael's head
    Could you make it so that Regenerating a map it clears any holy cities and de-increments any wonders that might have been added in advanced start, so that it is possible to build the wonders or get the holy cities again on the regenerated map?
     
    lfgr likes this.
  6. niuniuch

    niuniuch Chieftain

    Joined:
    Jun 16, 2020
    Messages:
    5
    Hi people, I wanted to check out this modmod, but can't get it to work.
    My FfH2 0.41o works fine.

    I can't use the installer, because it seems to find remnants of an old Steam installation and tries to copy files from there (I have civ4 from GOG now), and when I extract the archive to the FfH2 folder I'm getting an endless feed of XML load errors.
    Let me check if I can upload a screenshot....
     
  7. niuniuch

    niuniuch Chieftain

    Joined:
    Jun 16, 2020
    Messages:
    5
  8. niuniuch

    niuniuch Chieftain

    Joined:
    Jun 16, 2020
    Messages:
    5
    Never mind, I got it working but had to install MNAI 2.7 first and then MNAI-U over it
     
  9. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    It shouldn't be necessary to install MNAI 2.7 (and you might be just playing MNAI 2.7; you can check that in the flag tooltip in-game).
    I noticed that there was a mistake in the installation instructions on the download page (corrected now). Maybe that was the problem.
    Welcome to the forums, by the way. :)
     
    Tielby likes this.
  10. niuniuch

    niuniuch Chieftain

    Joined:
    Jun 16, 2020
    Messages:
    5
    I figured out the tolltip and it shows MNAI-U now, so I guess it worked
     
    Tielby likes this.
  11. Felis catus

    Felis catus Chieftain

    Joined:
    Sep 10, 2018
    Messages:
    11
    Please check this thread...
    https://forums.civfanatics.com/threads/good-lvl-15-but-cant-get-brigit-any-thoughts.313276/

    In my opinion, Charadon and Clan leaders do not need to be at war with barbarians necessarily to get Brigit unit. (It is not described anywhere...) It may be not a bug but it seems that Kael also admitted it was not correctly implemented according to that thread. What do you say to letting the Barbarian trait leaders acquire Brigit without declaring war on barbarians?
     
    Tielby likes this.
  12. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    Seems reasonable, I'll add it to my list.
     
    Tielby likes this.
  13. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,307
    Location:
    Kael's head
    Now that I have so many religions in my modmod, I would really like to have more extra game options so I could use one option for disabling each religion and still have a couple left over for other mechanics. Ideally I'd want to be able to add an arbitrary number of game options in xml rather than needing them hardcoded in the DLL.

    It would also be nice if CIV4GameOptionInfos.xml had a tag for disabling a religion, or if CIV4ReligionInfo.xml had a tag for the game options that disables said religion, instead of relying on the hardcoded
    Code:
    bool CvGame::isReligionDisabled(int iReligion) const
    {
        if (iReligion == 0)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_0))
           {
               return true;
           }
       }
        if (iReligion == 1)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_1))
           {
               return true;
           }
       }
        if (iReligion == 2)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_2))
           {
               return true;
           }
       }
        if (iReligion == 3)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_3))
           {
               return true;
           }
       }
        if (iReligion == 4)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_4))
           {
               return true;
           }
       }
        if (iReligion == 5)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_5))
           {
               return true;
           }
       }
        if (iReligion == 6)
       {
            if (isOption(GAMEOPTION_NO_RELIGION_6))
           {
               return true;
           }
       }
       return false;
    
    which only works for the first 7 religions listed in CIV4ReligionInfo.xml and only in that order.

    I personally never understood the need to have a tile with a minimum level prereq holding a Barbarian UNIT_BRIGIT_HELD just so that that can be captured as another Brigit by a high enough level unit. It is much simpler to do what I do in my modmod and have Rescue Brigit be a spell that requires the Ring of Carcer improvement and a unit with a high enough minimum level.

    If you feel the need to see Brigit within the Ring of Carcer while she is still a prisoner, then you could probably change the improvement's art to include her art too.
     
  14. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    I already thought of this.
    I'll have to look a bit more into the code before deciding whether adding unlimited gameoptions is possible.

    Rise/Ashes from Erebus does that, IIRC.
     
  15. niuniuch

    niuniuch Chieftain

    Joined:
    Jun 16, 2020
    Messages:
    5
    Is there something that can be done to make AI respect lairs a bit more? It seems like currently they treat it like goody huts, go in with a level 1 scout and then get their capital smashed by skeletons or something...
    Last game I had 3/7 AI civs destroyed within the first 30 turns of the game.
     
  16. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    I plan to make the AI less likely to explore lairs when they have not much defense yet. I haven't looked into it yet.
    In the newest version they should already be better at defending their starting city, though.
     
    Tielby likes this.
  17. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,307
    Location:
    Kael's head
    I recently discovered some bugs in the code used to save and load worldbuiler saves/scenarios. The code we have been using does not properly write or read the real terrain types associated with temporary terrain such as from the End of Winter Game option. I believe the file I'm attaching to this should fix the issue.
     

    Attached Files:

    Tielby and lfgr like this.
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,307
    Location:
    Kael's head
    I think there is a problem with the pedia mouseovers and the FeatureAttacks and FeatureDefenses tags in CIV4UnitInfos.xml

    I tried adding a new unit with double attack and defence strength on Hallowed Ground, and found that I could not select such units and that mousing over them could cause the game to crash.

    When looking for other units with those tags, I found that my Yvain is supposed to have
    Code:
    
               <FeatureAttacks>
                   <FeatureAttack>
                       <FeatureType>FEATURE_FOREST</FeatureType>
                       <iFeatureAttack>50</iFeatureAttack>
                   </FeatureAttack>
                   <FeatureAttack>
                       <FeatureType>FEATURE_FOREST_ANCIENT</FeatureType>
                       <iFeatureAttack>100</iFeatureAttack>
                   </FeatureAttack>
               </FeatureAttacks>
               <FeatureDefenses>
                   <FeatureDefense>
                       <FeatureType>FEATURE_FOREST</FeatureType>
                       <iFeatureDefense>50</iFeatureDefense>
                   </FeatureDefense>
                   <FeatureDefense>
                       <FeatureType>FEATURE_FOREST_ANCIENT</FeatureType>
                       <iFeatureDefense>100</iFeatureDefense>
                   </FeatureDefense>
               </FeatureDefenses>
    But it shows up in the pedia as +50% Tundra Strength and +100% Burning Sands strength.
     
  19. omegaflames

    omegaflames Warlord

    Joined:
    Sep 21, 2012
    Messages:
    159
    I can confirm the above bug is also present in my installation of 2.71. There is one difference though and that's that instead of Burning Sands mine says Fields of Perdition.
     
  20. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    849
    Thanks, this is another case where the game incorrectly interprets the feature ID as a terrain ID in the help text. Will be fixed in the next version.
     

Share This Page