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 2.71 unofficial build & bugfixes

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

  1. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Downloads
    Code repository

    Installation Instructions
    You need to have MNAI 2.7.1 installed.
    Download mnai-2.7.2u.zip from the link above and extract it into your Mods/Fall from Heaven 2/Assets folder.

    What is this about?

    I recently got back into civ4 and wanted to start modding a bit again. While I'm not short on ideas, my time is limited, so I decided it would be best to try and polish existing FfH mods instead of adding features. Furthermore, Tholal left here rather abruptly and didn't even release of the last changes (save for the source code on bitbucket). So I decided to go ahead and release the latest development version along with any bugfixes I manage to do.

    Goals

    Plainly: Fix any remaining bugs in MNAI. This includes bugs that exist in MNAI only surface in MNAI modmods such as MagisterModmod. If there are other serious flaws (for example related to performance) that are easy to fix, I will consider them too. I will not accept feature requests for the time being, and will not touch balance.

    If you find any bug, just report it here! :)
    If you want to help me (and increase the chances that I actually fix your bug), include a detailed description of the bug, how to reproduce it and ideally a savegame from directly before the bug happens.

    Terkhen wrote an excellent Testing Guide for Extramodmod. To produce assertions, you'll have to replace your CvGameCoreDLL.dll with CvGameCoreDLL_assert.dll, which is also included in the download (backup the former and rename the latter file). Moreover, please consider setting
    Code:
    AutoSaveInterval = 1
    in your CivilizationIV.ini file (see Terkhen's Guide on how to find it). This makes an autosave every turn. The impact on turn times should be negligible, and you will be able to provide saves directly before bugs happen, making it much easier for me to fix them.

    Acknowledgements

     
    Last edited: Jun 16, 2019 at 4:04 PM
  2. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    CHANGELOG

    Spoiler mnai-2.7.2u :

    Should be savegame compatible with 2.7 saves.

    Bugfixes
    • Griffon Illusions are no longer displayed as red blobs (reported by Spaceman98)
    • Dragon slaying no longer shows up in sevopedia promotion tree (reported by Antuano le Reddit on bitbucket)
    • Sailor's Dirge cannot spawn on ice anymore (reported by omegaflames, spaceman98)
    • Player score now counts land correctly, there were minor problems when specific plots had their PlotType changed.

    Code
    • Erebus Mapscript no longer causes assertion errors
    • Exposed CvGame::castVote(), CvGame::addVoteTriggered(). For details see CyGame.h and CyGameInterface.cpp in the code repository.
    • Fixed a few XML/Schema problems

    Other changes
    • The fact that the organized trait allows building command posts without great generals is now shown (thanks Bickendan, Devils_Advocate)
    Spoiler mnai-2.71-ubf-1.1 :

    Should be savegame compatible with 2.7 saves.

    Non-AI Bugfixes:
    • Removed some duplicate Art and Audio entries. Fixes Great Lighthouse video, and makes Balseraph catapults moo again.
    • Empty boolean, int or float elements now revert to default value and show a moderately useful assertion error.
    • Prevent some invalid assertion erros
    • Other minor code fixes and cleanup with no direct gemeplay impact

    AI:
    • AI somehow thought Adepts in cities with a river could cast spring. This also lead to AI loops, possibly slowing down turns.
    • Terraformers don't try (and fail) to move to unreachable city. Again lead to AI loops.
    • Presumed embassy value no longer includes presumed open borders value - AI doesn't basically consider embassies and open borders the same anymore.
    • AI is now less paranoid about players winning religious victories, and will trade open borders more willingly.
    • The two above changes should fix at least one instance of the deal-autocancelling behavior.
    Spoiler mnai-2.71-ubf1 :

    Should be savegame compatible with 2.7 saves. Contains unpublished changes from the repository and 2 additional fixes.

    Bugfixes:
    • Unhealthiness in city and global unhealthiness was swapped in Event description (lfgr)
    • Religious Influence overlay no longer shows Council of Esus cities to civilizations that don't follow the religion. (Terkhen)
    • When Hyborem or Basium are resurrected, the civilization will get its leader traits back. (Terkhen)
    • Mimics can no longer gain promotions from naval or mech units (Tholal)
    • fix for potential crash if you select a worker when you have no cities (fallout from change to prevent chopping production from being sent to settlements)
    • Other minor fixes (Tholal, Terkhen)
    • Snowgenesis no longer removes hell terrain twice (lfgr, found by omegaflames)
    • Negative Spell iResistModify no longer causes division by zero CTD (lfgr, reported by FireBlaze, applies to MagisterModMod)

    AI:
    • Minor adjustment to how the AI values techs for their favorite UnitCombats (Tholal)

    Other Changes:
    • Scorpion Clan goblins are now upgraded to Scorpion Clan wolf riders. (Terkhen)
     
    Last edited: Jun 13, 2019 at 5:42 PM
  3. Slarki

    Slarki Chieftain

    Joined:
    Aug 5, 2011
    Messages:
    230
    it's nice to see it resurrected. Still playing in a multiplayer session. There are recent posts by others and me that report some bugs. Additionally for some reason the tower of mastery provides 3 health instead of 2 for some reason. Experienced this with a teammate in a permanent alliance. Also barracks don't show their additional bonus when building units.
     
  4. jackal1234

    jackal1234 Chieftain

    Joined:
    Jul 11, 2010
    Messages:
    93
    Location:
    127.0.0.0
    thanks man! might start a new multiplayer tonight
     
  5. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Can you be a bit more specific? What happens vs. what did you expect to happen, why do you expect it that way?
     
  6. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    Diplomacy: Treaties autocancel after 10(?) turns. (May only be in the Advanced Diplomacy option)
     
  7. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Cannot reproduce, right of passage didn't autocancel. Do you have a savegame from one turn before the deal is canceled?
     
  8. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    Right of Passage seems to be the only one that doesn't autocancel. Embassies, open borders, non-aggression pacts, defensive pacts, vassalage, and resource/money trades all autocancel.
    Let me know if you still want a save, as I'll have to set it up in one of my current games.
     
  9. omegaflames

    omegaflames Chieftain

    Joined:
    Sep 21, 2012
    Messages:
    121
    Having played a bit on the latest official release I'd say I'm seeing things get cancelled a lot more than they did on the build I was on previously (not sure which as I haven't updated in several months until recently) I've gotten to the point where I just leave it at right of passage and don't ever do an open borders unless I really need to so that I don't lose that sweet sweet foreign trade route money. I've been suspicious that it's something in the dll so I haven't done much digging into it since I've been avoiding learning how to do dll stuff but if you still can't reproduce with open borders specifically then let me know and I'll provide some save games as well and do more hunting on my own with it as well. I'm not sure it's an exact number of turns thing as I've not counted and I always play on marathon game speed and I've just never kept track of it.

    I'd also like to say if you are looking for bugs then any thread created after Aug 6 2017 is fair game in these forums because there have been a handle full of threads created since 2.71 release with a few bug reports in them.
     
    Last edited: May 21, 2019
  10. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Okay, I'll check this when I have a bit more time.
    It is most probably a DLL issue, but I never looked into that code so it might take some time to fix.
     
    Last edited: May 22, 2019
  11. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    New release: mnai-2.71-ubf-1.1. Should be compatible with 2.7 savegames.

    The most important fixes of this release are:
    • Bugs in the terraformer AI code made terraformer units do nothing. This led to an AI loop. As the game breaks the loop after 100 iterations, this didn't lead to a freeze, but might have slowed down the game.
    • Fixed at least one instance of AI deal "auto"-cancelling. The problem was that the AI was very wary of trading (or maintaining) open borders if their trade partner was even slightly on their way to a religious victory. Now they have this behavior only if the other player is actually close to a religious victory. Furthermore, the AI valued embassies basically the same as open borders, which led to them cancelling embassies, too.

    For a full changelog, see the second post of this thread.

    To help track down possible other causes for AI deal cancelling, please enable autosaves every turn, as explained in the first post of this thread.
     
    Last edited: May 25, 2019
  12. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,932
    Location:
    Kael's head
    I merged mnai-2.71-ubf-1.1 with MagisterModmod this afternoon. I copied both of the DLLs included into my modmod folder, without renaming either trying to get assertions, and have been getting these assertions anyway:
    Spoiler :

    Code:
    Assert Failed
    
    File:  CvXMLLoadUtilityGet.cpp
    Line:  761
    Expression:  false
    Message:  Error in GetChildXmlVal function, unable to find a child node
    
    ----------------------------------------------------------
    
    Assert Failed
    
    File:  CvInfos.cpp
    Line:  6277
    Expression:  i < GC.getNumTerrainInfos()
    Message:  Index out of bounds
    
    
    ----------------------------------------------------------
    Assert Failed
    
    File:  CvArtFileMgr.cpp
    Line:  182
    Expression:  false
    Message:  get##name##ArtInfo:  was not found
    
    ----------------------------------------------------------
    Assert Failed
    
    File:  CvSelectionGroupAI.cpp
    Line:  228
    Expression:  false
    Message:
    
    ----------------------------------------------------------
    Assert Failed
    
    File:  CvGameCoreUtils.cpp
    Line:  2760
    Expression:  iLevel > 0
    Message:  iLevel must be greater than zero
    
    ----------------------------------------------------------
    Assert Failed
    
    File:  CvCity.cpp
    Line:  7751
    Expression:  getBonusGoodHealth() >= 0
    Message:
    
    ----------------------------------------------------------
    
    Assert Failed
    
    File:  CvCity.cpp
    Line:  7753
    Expression:  getBonusGoodHealth() >= 0
    Message:  getBonusGoodHealth is expected to be >= 0
    
    ----------------------------------------------------------
    
    
    Assert Failed
    
    File:  d:\dev\civ\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
    Line:  25
    Expression:  ePlayer != NO_PLAYER
    Message:  Player is not assigned a valid value
    
    ----------------------------------------------------------
    
    
    Assert Failed
    
    File:  CvCity.cpp
    Line:  8326
    Expression:  getBonusGoodHappiness() >= 0
    Message:
    
    ----------------------------------------------------------
    
    
    
    Assert Failed
    
    File:  CvInfos.cpp
    Line:  2669
    Expression:  i > -1
    Message:  Index out of bounds
    
    ----------------------------------------------------------
    
    
    
    Assert Failed
    
    File:  CvPlot.cpp
    Line:  8626
    Expression:  getStolenVisibilityCount(eTeam) >= 0
    Message:
    
    ----------------------------------------------------------
    
    
    Assert Failed
    
    File:  CvCity.cpp
    Line:  8338
    Expression:  getBonusBadHappiness() <= 0
    Message:
    
    ----------------------------------------------------------
    Assert Failed
    
    File:  CvTeamAI.cpp
    Line:  3726
    Expression:  !isAtWar(eWarTeam)
    Message:  should be at peace with eWarTeam
    
    ----------------------------------------------------------
    
    
    


    In your previous release CvGameCoreDLL_assert.dll was larger than CvGameCoreDLL.dll, but now CvGameCoreDLL.dll is the larger of the two. Did you maybe get the names mixed up between them?
    Edit:I seem to be getting the same asserts regardless of which of those DLLs I use.
     
    Last edited: May 25, 2019
  13. Jojo_Fr

    Jojo_Fr Chieftain

    Joined:
    Mar 17, 2013
    Messages:
    284
    Location:
    France
    Very good news.

    FFH2, MNAI and Extra Mod Mod are the best and smartess Civ IV mod ever done !


    You only focus on bugfixes, or you can work on balancing the mod too ?
     
  14. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Sorry, I packaged the debug DLL in place of the release DLL. Please redownload. You should only get asserts with CvGameCoreDLL_assert.dll.

    I will not work on balance.
     
  15. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    Units appear to be able to release themselves from prisons (I freed a Beast of Agares and a Lizardman Beastman this way).

    Tooltip for Command Post (Great Commanders) lists Organized as a requisite. I built it anyway as Hannah the Irin.
     
  16. Devils_Advocate

    Devils_Advocate Chieftain

    Joined:
    Nov 8, 2015
    Messages:
    32
    It lists that because you need the Organized trait to build a Command Post using 180 :hammers: instead of sacrificing a Great Commander to create one.

    The description of the Organized trait should probably include "Can build Command Post without using Great Commander". Not having to spend a Great Person on a building is a bit more notable than double production speed, I think.
     
  17. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    Thanks for the report and suggestion, I'm going with "Allows building Command Posts without using a Great Commander".
     
  18. Bickendan

    Bickendan Chieftain

    Joined:
    Mar 6, 2011
    Messages:
    71
    Had a Flurry get himself trapped and free himself from said cage.

    Does Bloom work on floodplain tiles? I play on a mapscript that generates them on any tile (so, floodplain grasslands away from rivers), but Bloom doesn't seem to be allowed on those tiles. If working as intended, great. If not, well, the Elves aren't thrilled...
     
  19. omegaflames

    omegaflames Chieftain

    Joined:
    Sep 21, 2012
    Messages:
    121
    Both forests and floodplains are features and you can usually only have 1 feature at a time on a plot. Improvements work the same way in that there can usually only be 1 at a time on a plot. If you want to get rid of the floodplain and replace it with a forest then you could try some of the terraforming spells to try and get rid of it but not sure that would actually work since the python code for scorch does not specifically remove floodplains (you would have to hope the game recognizes that plains does not normally have floodplains) and the python requirements for spring won't let it be cast on a floodplains unless there are flames or smoke nearby.
     
    Last edited: Jun 7, 2019
  20. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    582
    In addition to what omegaflames said, I believe it used to be possible to e.g. use spring to convert desert+floodlplains to plains. Tholal removed this because +1:hammers: and -4:food: just isn't worth it in almost all situations, and the possibility of misclicking outweights it.
     

Share This Page