MNAI-U: unofficial build & bugfixes

hmm does not enabling tech trading affect the AI performance with technology. We usually turn it off.

It's not so much that they all get multiple religions, it that every AI beelines a religion tech, when in my opinion at least they should focus a bit more on units tech. Also what about cities specializations, is it possible to tech the AI how to do that a bit better? Cause when I saw the dwarf AI have so many cottage cities and no libraries it was a lot of missing potential.

Also in terms of sample size I can do more test when I get home later. Though is there a turn limit you want me to reach, how many times with each civ, etc
 
I haven't checked the code specifically used for defining areas (what we'd usually think of as continents), but does it reach across mountains (I assume it might use A* and thus this is considered based on pathing connectivity)? The AI might think it needs to execute a land war if it shares an area but the pathing is blocked by mountains so there's a disconnect there if that isn't being taken into account. But again, maybe this is already considered, I might take a look later.
 
It's not so much that they all get multiple religions, it that every AI beelines a religion tech, when in my opinion at least they should focus a bit more on units tech.
I see. I'll run some tests.

Also what about cities specializations, is it possible to tech the AI how to do that a bit better? Cause when I saw the dwarf AI have so many cottage cities and no libraries it was a lot of missing potential.
I need a savegame to see what the AI was building instead. Also, with buildings it's a bit more complicated to get the AI to do what I want. The problem is that the AI doesn't really compare buildings to units, it's more like it first decides whether to build a unit or building, and then chooses one. Maybe you're AI was building units. I'm pretty sure there is code that values libraries higher in high-commerce cities.
I don't think the AI really has a concept of city specialization.

Also in terms of sample size I can do more test when I get home later. Though is there a turn limit you want me to reach, how many times with each civ, etc
I don't have hard requirements, but I want to be sure the problem occurs with some regularity. The more specific your suspected problem is, the better it can be tested/proven.
What you said about religious techs is a pretty concrete statement, I'll make some kind of statistic of how fast techs are picked based on average. Then we can see if something looks wrong.

I haven't checked the code specifically used for defining areas (what we'd usually think of as continents), but does it reach across mountains (I assume it might use A* and thus this is considered based on pathing connectivity)? The AI might think it needs to execute a land war if it shares an area but the pathing is blocked by mountains so there's a disconnect there if that isn't being taken into account. But again, maybe this is already considered, I might take a look later.
I definitely think the area handling is at fault here. But the question is how hard it is to replace it in the right places.
 
Another thing to note and this time I have a save to back it up. So me and my friend where doing a multiplayer game, I was playing as the Sheaim but all three of my neighbors declared war on me so I was like nope, and I left it and my friend continued playing. I decided to join back in cause I wanted to see how the Calabim was performing. Ok they had well over 1k gold and I was when I joined that they had a few training yards and a load of blood pets. So I left and told my friend to declare war on them, which he did cause we wanted to see if he would upgrade his troops. I let 10 turns pass and the AI still has not upgrade it's troops. You can see it for yourself here. It's just strange to me they have the money and they are at war, but they don't simply upgrade all their warriors.

This was with the extramodmod.
 

Attachments

  • AI does not upgrade units when it has the money to do so during a war.CivBeyondSwordSave
    1 MB · Views: 29
Last edited:
In another game starting in classical era the AI for some reason beelined Drama and spend many turn researching it, only to stop when it had 6 turns left and switch it's research to something else

Drama grants a Great Bard to the first player to complete. It seems likely that the AI prioritised it for this reason, and switched when another player gained the Bard.
 
Is it hard to add permanent unique features so they don't disappear when explored, I tried moving that specific feature from the mod from https://forums.civfanatics.com/threads/modular-unique-features-plus.368642/ the best I can, but I ended up breaking the game whenever I try to load it since I have little to no experience adapting things cross modmods.
The modmod you're trying to merge is for Wildmana, that's probably hard to merge.
Extramodmod includes this feature, if you're willing to switch. Porting from EMM to MNAI is also not easy since it's DLL code and part of a larger lair rework in EMM.
 
The modmod you're trying to merge is for Wildmana, that's probably hard to merge.
Extramodmod includes this feature, if you're willing to switch. Porting from EMM to MNAI is also not easy since it's DLL code and part of a larger lair rework in EMM.
I'll give it a try thanks.
 
It would be really nice to have in MNAI, too :D I generally prefer the close-to-vanilla nature of MNAI, but having the unique features remain in place would be very nice.
 
Neither the Always Peace and the Permanent War or Peace game options stop the dogpiling declarations of war that I think are caused by that horrible always active Ruthless AI features.
 
Neither the Always Peace and the Permanent War or Peace game options stop the dogpiling declarations of war that I think are caused by that horrible always active Ruthless AI features.
They declare war even when these game options are active? That's a major bug. Do you have a save?
 
They declare war even when these game options are active? That's a major bug. Do you have a save?
I have saves, but only using an unreleased version of my modmod which would not be compatible with any released version.

I just tried to confirm that they would still all declare war on me despite the Always Peace setting, and found that when I loaded the save from the turn before the dogpile that they don't immediately declare war the next turn like I expected. Everyone still declared war on me, but they waited 2 or 3 turns in different playtests.


In my currently game I noticed the message that the Khazad bribed other nations into declaring war on us.


I don't know it is relevant, but the war declarations and dogpiles seem way more common when I control a city that is a holy city for more religions than exist in base FfH2.
 
Hello. I tried to do as DarkLunaPhantom suggested, changed "ModPath=Mods\Fall from Heaven 2" to "ModPath=Mods\More Naval AI" in ...\PrivateMaps\Fall From Heaven II Scenarios.CivBeyondSwordWBSave But after that I ran into another problem. On the scenarios screen, I clicked on the flag button, which should start scenario, but nothing happened. How to make the buttons work?

Of course, it is possible to load scenario from WorldBuilder, but this is a bit less convenient.
 
@MagisterCultuum: Thanks. I checked and indeed, the war bribing accidentally bypasses all checks. I actually inserted a check in 2019 that prevents selling a war declaration to somebody with whom you're already at war :). I probably thought the actual declareWar() function checks relevant gameoptions, but it doesn't. Good catch! I'll fix this for the next version.

I don't know it is relevant, but the war declarations and dogpiles seem way more common when I control a city that is a holy city for more religions than exist in base FfH2.
This is further evidence that your XML changes have to do with this – what I wrote above is also an issue in MNAI and previous MagisterModMod versions, where the dogpiling apparently isn't as much of a problem. This is still something I want to fix in MNAI, of course, I want to support adding additional religions or whatever else you changed that might cause issues.

I'll fix the bug above for the next version, hopefully due in 2-3 weeks. Together with the Ruthless AI gameoption outsourcing, I hope this fixes the most egregious problems. When the new MagisterModMod version is out, I could then debug savegames and fix whatever the AI is miscalculating about religions etc.

Hello. I tried to do as DarkLunaPhantom suggested, changed "ModPath=Mods\Fall from Heaven 2" to "ModPath=Mods\More Naval AI" in ...\PrivateMaps\Fall From Heaven II Scenarios.CivBeyondSwordWBSave But after that I ran into another problem. On the scenarios screen, I clicked on the flag button, which should start scenario, but nothing happened. How to make the buttons work?

Of course, it is possible to load scenario from WorldBuilder, but this is a bit less convenient.
I don't think the scenarios screen can be made to work reliably. IMO the best way to start scenarios is to double-click them in Assets/XML/Scenarios.
 
Hello. I tried to do as DarkLunaPhantom suggested, changed "ModPath=Mods\Fall from Heaven 2" to "ModPath=Mods\More Naval AI" in ...\PrivateMaps\Fall From Heaven II Scenarios.CivBeyondSwordWBSave But after that I ran into another problem. On the scenarios screen, I clicked on the flag button, which should start scenario, but nothing happened. How to make the buttons work?

Of course, it is possible to load scenario from WorldBuilder, but this is a bit less convenient.
If you wan to use Kael's scenario screen then I think you also need to edit line 502 of Assets\python\Screens\CvEspionageAdvisor.py
Code:
        fileName = os.path.join(os.getcwd(), "Mods", "Fall from Heaven 2", "Assets", "XML", "Scenarios", szScenarioName)
to change Fall from Heaven 2 to whatever name you have given the mod.
 
If you wan to use Kael's scenario screen then I think you also need to edit line 502 of Assets\python\Screens\CvEspionageAdvisor.py
Code:
        fileName = os.path.join(os.getcwd(), "Mods", "Fall from Heaven 2", "Assets", "XML", "Scenarios", szScenarioName)
to change Fall from Heaven 2 to whatever name you have given the mod.
Thanks. It works now. After change, when I clicked on the flag button, the game crashed. But other attempts were successful.
 
New release: mnai-2.9.1u.
Should be compatible with the 2.9u savegames.

Download setup
Download archive

This release features the usual batch of fixes and UI improvements, as well as some AI changes. Highlights:
  • Fixed two OOS errors related to new BUG options
  • Ruthless AI is now a gameoption, so the AI should behave a little saner by default
  • AI should a little more likely to build advanced units (instead of warriors)
  • There is a new "coalitions" option in the foreign advisor that arranges leaders according to current wars
  • When a duplicate leader is created (via Revolutions, Puppet states or the like), they're now differentiated by adding roman numerals (e.g., "Alexis II")

I want to perhaps extend the last point to civ-specific lists of replacement leader names. There should be plenty of people in the lore to support this.

For a full changelog, see the file mnai_changelog.md included in the download or here.

As always, thanks everybody for bug reports, discussion and contributions.

EDIT: Fixed changelog link
 
Last edited:
Thanks so much for this huge list of fixes. I'll test it out and work on merging it with my modmod this weekend.
 
Top Bottom