MNAI-U: unofficial build & bugfixes

If you are going to be looking into the pathfinding mechanism, would it be possible to add a new "Go To" option that tells every selected unit to go to the destination on its own without bothering to try to keep the group together? Sometimes it is important to keep groups of units together to defend weaker members of the group, but usually I just want a lot of units to get somewhere quickly and don't want to have to select each unit separately to micromanage giving them each separate orders.
 
I rendered that particular situation moot by only sending in one High Priest of Winter and the 1 movement Phalanx into the city, and turning everyone else around to murder Guybrush and sack the city to the southeast.
 
So the fear effects have been broken for years now. Units will say they are scared but will attack anyways and are forced into using quick combat. I wrote a fix and compiled the DLL for myself also years ago, but have since merged lfgr's latest changes with the new CvGameCoreDLL.dll and its broken again. I've also not had any access to a compiler as its setup in a VM on a machine that's been in storage for years whose motherboard is borked.

Anywho I reimplemented my fix and tried to push a new branch to your public repo, but it wouldn't let me. So I've forked the repo and pushed my branch, but can't for the life of me figure out how to create a Pull Request or an Issue on notabug. You can view the branch here: https://notabug.org/Azhral/more-naval-ai-az/src/Azhrals-Fear-Fix

Here's the fix anyways - just add these lines to CvUnit.cpp:
Code:
2196:                        joinGroup(NULL);
2197:                        withdrawlToNearestValidPlot(false);
 
So the fear effects have been broken for years now. Units will say they are scared but will attack anyways and are forced into using quick combat.
I will most likely wish you hadn't fixed that. :lol:
 
I have noticed the fear effect thing in my personal modmod as well but since I've not yet gotten off my rear end and merged it with Lfgr's fixes I haven't said anything about it yet as I wasn't sure if it was still a thing. The first time I ever saw the pathfinding thing was before I even played mods which is how I know it's a BTS thing and since I've never really played vanilla or warlords I can't tell you how long that bug has existed just that it does. There is another pathfinding bug as well were the path it tells you it will take won't always be the one it ends up doing so any unit movements (especially mixed unit movements) that take multiple turns and could go near hostile troops you should be careful with as I've lost workers like that thinking they would stop on a safe tile only for them to take a different path ultimately.
 
@lfgr "More Naval AI v2.7"
@omegaflames I've noticed that as well back in an old multiplayer session that we abandoned from an OOS - I had a multimovement unit attack an adjacent city, only to move diagonally to another tile, then to the city by crossing a river! They promptly died. Haven't ever seen that one since.


Is it intended for Illians not to break diplomacy with vassals and declare war on them when completing The Draw? You can refer to my movement pathing screencap a few posts back - diplomacy with the Clan is still possible because they were vassals at time of The Draw but then broke away because of distance to my empire, allowing trade etc. I can imagine that teammates (whether other humans if set or the Mecurians if summoned) won't break, either. (Related: Should the Illians be permitted to even summon the Mecurians? Grigori likewise; both can. Lorewise, it's dubious).
Precedence for a forced vassal break and declaration of war: A player that has the Infernal as vassal who completes the Gate. The Mecurians force break the vassalage and the declaration of war.
 
Last edited:
"More Naval AI v2.7"
Well, that's not even MNAI unofficial, that's Tholal's last release. :)
The bug was still present, though, and is fixed now. If anybody's interested, the problem was not so much that the units are on the same tile, but that the game tried to kill the ghost, since it couldn't successfully eject it (like Magister guessed). But the removal of the promotion, and thus killing of the unit happens while the game is still working with it, so after the unit is killed the game still tries to access some now-freed memory, resulting in the crash.
I solved it by just not killing the unit.

I agree that The Draw should make your vassals break free and declare war. It's on the TODO list now.
 
New release: mnai-2.9-beta3u.

Not compatible with 2.9-beta2u savegames.

Download setup
Download archive

The GFC error is now hopefully fixed once and for all. I also made the attempt of making the installer work on Steam, but I couldn't test that. I'd appreciate if somebody with a Steam installation could confirm whether it works.

Besides the usual batch of bugfixes, this release contains several minor gameplay changes.
  • Embassies no longer allow players to see into other capitals, since that feature was broken.
  • Units with a religion can now no longer upgrade to a unit type with a different religion. This is most likely what was intended originally and is preferred for MagisterModMod. I believe the only effect in MNAI is that you can only upgrade e.g. an Assassin to a Shadow if the Assassin has no religion or CoE. If you have many non-CoE religions in your cities, there is a small chance for every unit that it will get a non-state religion.
  • Men o' War can now carry one bird, like Frigates
  • Lumbermills can now be constructed on ancient forests
One notable AI change is that I removed a nonsensical base value that basically every resource got, resulting e.g. in Hyborem giving you stuff for useless health resources. I believe this was caused by an oversight in the (quite complicated) trade code, and my change will not lead to any problems. Still, please let me know if you notice any unusual AI behavior related to resource evaluation.

Among other small UI improvements, there is now a BUG option that controls whether new cities start with "avoid unhappy population", useful for Calabim or Slavery.
Further, there are now two ways the problem that too many units on a tile make the tooltip unreadable: First, there is a BUG option to control the number of units that are shown with some more details (all other units are collapsed at the bottom of the tooltip). Second, when hovering over a (non-selected) stack of units, it is now possible to make the "top" unit cycle through the stack. The top unit is the one that is shown on the map and that is first and in full detail in the tooltip. Cycle forwards with either "-" or "Ctrl+Space", and cycle backwards with "Ctrl+Shift+Space". These settings should make it possible to see the details of arbitrary units.

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

Thanks everybody for bug reports, discussion and contributions.
 
Thanks for the upload, but are are you sure that you included the proper DLLs?

I just merged this with my modmod, in the process changing a bunch of the new dummy game options to disable my newer canonical religions. When I started my first playtest though I did not see those game options appear in the custom game screen, and I was not able to activate them in worldbuilder like the old game options. I then used worldbuilder to give myself the prereqs for training Shadows plus several assassins whom I gave different religions. I found that they all could upgrade to shadows, regardless of religion.

I then loaded a game with unmodified mnai-2.9-beta3u and found that assassins of any religion could still become Shadows there too, and that I could not toggle the dummy game options there either.

Edit: I also got this error
Code:
Traceback (most recent call last):
  File "BugEventManager", line 366, in _handleDefaultEvent
  File "CvEventManager", line 4005, in onUnitCreated
AttributeError: type object 'CvPythonExtensions.GameOptionTypes' has no attribute 'GAMEOPTION_NO_RELIGION_8'
When I tried adding a Matronae unit after adding the bit of code to remove said religion from units of that faith when that faith is blocked.
 
Last edited:
Edit: I also got this error
Code:
Traceback (most recent call last):
File "BugEventManager", line 366, in _handleDefaultEvent
File "CvEventManager", line 4005, in onUnitCreated
AttributeError: type object 'CvPythonExtensions.GameOptionTypes' has no attribute 'GAMEOPTION_NO_RELIGION_8'
When I tried adding a Matronae unit after adding the bit of code to remove said religion from units of that faith when that faith is blocked.
This is expected. I did not export the new gameoptions to python in this way, and if I did, they'd be called GAMEOPTION_DUMMY_...
You'll have to use gc.getInfoTypeForString( "GAMEOPTION_NO_RELIGION_8" ).
The rest is not expected, obviously, I'll test it again soon.
 
You were right, the release DLL is old. I think I forgot to re-run my packaging script after compiling. I attached it and will update the downloads soon. The assert dll should be fine. Thanks for the quick report!

EDIT: In case there is any doubt, everybody please update to the hotfix version. Otherwise, you won't have most of the new fixes/features.
 

Attachments

  • mnai-2.9-beta3u-hotfix-CvGameCoreDLL.zip
    1.9 MB · Views: 96
Last edited:
there are now two ways the problem that too many units on a tile make the tooltip unreadable: First, there is a BUG option to control the number of units that are shown with some more details (all other units are collapsed at the bottom of the tooltip). Second, when hovering over a (non-selected) stack of units, it is now possible to make the "top" unit cycle through the stack. The top unit is the one that is shown on the map and that is first and in full detail in the tooltip.
Very nice! I appreciate this very very much!
 
Steam internet games: Any possible theories as to why my games can't be seen nor can I see my friends' games? They can see each other, they're all using MNAI 2.9uB3 (as I installed it on their systems), and we can see each other if we use Ashes of Erebus instead.
Related: Any way to get past the four player cap for internet games?
 
Steam internet games: Any possible theories as to why my games can't be seen nor can I see my friends' games? They can see each other, they're all using MNAI 2.9uB3 (as I installed it on their systems), and we can see each other if we use Ashes of Erebus instead.
Related: Any way to get past the four player cap for internet games?

The current Steam version of the game is not compatible with all mods.

The difference between the current Steam and the old original version of the game is how multiplayer works.
In the current Steam version the multiplayer works through Steam and there is no Direct IP option. 4 player cap probably cannot be avoided and multiplayer will not work with all mods (and for some mods not even singleplayer will work properly).

You can get the original version by following these instructions: https://support.2k.com/hc/en-us/art...eamworks-Civilization-IV-Unsupported-on-Steam . By doing what's described there you can easily switch between versions.

The advantage of the original version is that it should be compatible with all mods including multiplayer and there is no player cap. But you cannot use Steam multiplayer in the original version and you have to do one of the following:
1) use the Direct IP option (which can include a pitboss host, but doesn't need one) or
2) you can use LAN games if you are on the same local network or
3) you can use Internet Games if you can access the alternative lobby, but I never tried that.
And to be able to connect with other playes in the original version multiplayer you need to be able to access the alternative NatNeg server. (This whole problem with multiplayer started when GameSpy's NatNeg and lobby servers were shut down in 2014.)
To access the alternative NatNeg server you need to follow these instructions: http://www.realmsbeyond.net/forums/showthread.php?tid=7544

(You can find more information here https://forums.civfanatics.com/threads/gamespy-substitute-server-project.534629/ and here https://civ.zulan.net/ . There are more multiplayer tools available there mostly focused on pitboss games, but none of that is necessary except setting up NatNeg access as described in the realmsbeyond thread.)

The purpose of NatNeg server is to help players with connecting to each other, but it is not perfect so all players should also implement port forwarding rules in their routers for ports civ4 uses (the default civ4 port is 2056).
 
Not sure if this is a bug, oversight, or working as intended: City Elohim captured goes into Rebellion and spawns units. Sanctuary is up. Should those rebel units be auto-ejected from Elohim territory or they spawning by the city in question and staying put considered consistent with how Sanctuary works?
 
Top Bottom