MNAI-U: unofficial build & bugfixes

In my modmod I added an Undercouncil resolution to block its members from using Sun mana, much like the Overcouncil can block its members from using Shadow, Death, Entropy, etc.

I of course gave it <DiploVoteType>DIPLOVOTE_UNDERCOUNCIL</DiploVoteType>, and the resolution is showing up for Undercouncil members to vote on and is listed with other Undercouncil resolutions in the Resolution screen.

However, its effect seems to be binding not on Undercouncil members as expected, but on Overcouncil members like the Overcoucnil resolutions are.

I'm thinking the NoBonus resolutions blocking Overcouncil members instead of those with the resolution's DiploVoteType must be hardcoded somewhere in the DLL, but I not yet been able to find it in the DLL source code.

p.s. If you ever decided to expand the scope of this modmod from bug fixes to adding new features, I'd love it if you would add an xml ability to block spells based on votes, so I would not have to use python to make banning a mana type also ban the use of that magic by those units which already have the proper spell sphere promotions.
While on the subject of adding more SpellInfos tags, I'd really really like to allow certain spells to be blocked in xml by certain promotions.
 
Lfgr have you checked the other threads for bugs yet? The sailors dirge bug that I reported in the MNAI 2.71 release thread is again being reported in the ExtraModMod thread.
 
However, its effect seems to be binding not on Undercouncil members as expected, but on Overcouncil members like the Overcoucnil resolutions are.

I'm thinking the NoBonus resolutions blocking Overcouncil members instead of those with the resolution's DiploVoteType must be hardcoded somewhere in the DLL, but I not yet been able to find it in the DLL source code.

I will look into this. It is possibly related to this bug. Are you sure it just affects Overcouncil members, and not all players?

If you ever decided to expand the scope of this modmod from bug fixes to adding new features, I'd love it if you would add an xml ability to block spells based on votes, so I would not have to use python to make banning a mana type also ban the use of that magic by those units which already have the proper spell sphere promotions.
While on the subject of adding more SpellInfos tags, I'd really really like to allow certain spells to be blocked in xml by certain promotions.

Both suggestions seem reasonable and simple, especially the second one; I will consider them.
I'm not generally opposed to adding new simple tags if it helps modders. What I don't want to do is add complex features that are not used in MNAI, such that not only the overall code complexity increases, but I don't even notice when these features break.

Lfgr have you checked the other threads for bugs yet? The sailors dirge bug that I reported in the MNAI 2.71 release thread is again being reported in the ExtraModMod thread.

Yes, I'm aware of it now (see my EMM posting). It seems I overlooked or forgot your bug report in the 2.71 release thread. Thanks for the effort you put into your bug reports btw, I appreciate it.
 
Well you are about to not like my next 2 reports :) I've not yet updated my personal modmod to your fixes yet (I'm currently branched off of Tholal's 2.71) so I can't confirm if these are going to still be in the code and I've done no investigation yet because last night when I was playing and I found these I just didn't feel like bug hunting.

1.I had a notification that civ a has convinced civ b to declare war on me. I had not yet met civ a and the war that civ b was supposed to have declared never actually got declared.
2. I had a random event about a volcano appearing but the tile never actually changed from a peak to a volcano. I'm not really certain if any fires were spawned either as I don't think there was any forests nearby.
 
I had a notification that civ a has convinced civ b to declare war on me. I had not yet met civ a and the war that civ b was supposed to have declared never actually got declared.
Noted. Ugh, AdvancedDiplomacy really is a messy modcomp.

I had a random event about a volcano appearing but the tile never actually changed from a peak to a volcano. I'm not really certain if any fires were spawned either as I don't think there was any forests nearby.
Could not reproduce this, I'd need a savegame of the turn before.
 
I will look into this. It is possibly related to this bug. Are you sure it just affects Overcouncil members, and not all players?
I am sure that after the vote passed the mana bar at the side of the screen continued to show that I had Sun mana both while I was still a member of the Uncercouncil and when I reverted to No Memebership, but the bar changed to say that I has 0 Sun mana when I adopted the Overcouncil.

I did not actually tested trying to purchase any Sun sphere promotions or construct any buildings that require Sun Mana after the vote passes under the various membership options.

I would test that now, but I don't remember the name of any saves from games in which that vote had already passed.


(I believe the last saved games with that vote passed were before a change that breaks saved games away. To load them I'd have to temporarily get rid of the Sidar's new racial promotion, which I added mostly to reduce the need for python to block the Sidar from using Undeath magic as I could make their default race grant immunity to the Undeath promotions instead of using python to change Undeath to the Arawn version of Death.)


Also, I'd have to undo a recent change (giving the Sidar a new racial promotion which b) that breaks saved games if I am to try to load a save from the day I think I last noticed the No Sun Mana of behavior.
Both suggestions seem reasonable and simple, especially the second one; I will consider them.
I'm not generally opposed to adding new simple tags if it helps modders. What I don't want to do is add complex features that are not used in MNAI, such that not only the overall code complexity increases, but I don't even notice when these features break.
That is good to hear.

On the subject of letting to allow certain spells to be blocked in xml by certain promotions, I realized that could be interpreted in two different ways. It could mean that a caster with a certain promotion is blocked from using certain spells, or it could mean that a unit with a certain promotion is immune to certain spells cast by other units. I was thinking mostly of the first interpretation at the time, but would love it if it was implemented both ways.


Speaking of votes, I really want to let Worldbuilder change the status of whether a Vote has passed or not, but I don't think the required code is exposed to python. I believe I requested this feature of Tholal a long time ago but don't think he ever got around to doing so.
 
New release: mnai-2.7.2u. Should be compatible with 2.7 savegames.

This release fixes some minor bugs, among them the Sailor's dirge spawning bug. For a full list, see the second post of this thread.

I decided to continue Tholal's versioning scheme, but append an "u" to differentiate between his and my versions. The second number indicates savegame compatibility. This is probably my last release for the 2.7 series, the next release (2.8.0u) will break savegames.

@MagisterCultuum: CvGame::addVoteTriggered() is now exposed. It simply triggers a vote; the current (human) player can vote immediately (via popup). The passed/not passed state of votes should be already readable by python, see Screens/CvVictoryScreen.py. The NoBonus vote bug will be fixed in the next version (the fix will break savegames).
 
Possible that this isn't a bug, but Hotseat games with Revolutions on don't trigger revolution events outside of city shutdown unrest for human players (ie, no warnings that a city or region is about to rebel, or wish to split off, or to become a vassal state, nor do they ever occur). I've not tested it in LAN games, however.
 
CIV4GameText_FFH2.xml Line 6519 there is an extra empty line below the Spanish tag. Line 31262 (or near it) there is a missing icon bullet for the french language of TXT_KEY_SPELL_SACRIFICE_HELP and again at line 31494 (or near it) for TXT_KEY_SPELL_SPRING_HELP
 
New release: mnai-2.7.2u. Should be compatible with 2.7 savegames.

This release fixes some minor bugs, among them the Sailor's dirge spawning bug. For a full list, see the second post of this thread.

I decided to continue Tholal's versioning scheme, but append an "u" to differentiate between his and my versions. The second number indicates savegame compatibility. This is probably my last release for the 2.7 series, the next release (2.8.0u) will break savegames.

@MagisterCultuum: CvGame::addVoteTriggered() is now exposed. It simply triggers a vote; the current (human) player can vote immediately (via popup). The passed/not passed state of votes should be already readable by python, see Screens/CvVictoryScreen.py. The NoBonus vote bug will be fixed in the next version (the fix will break savegames).
What parameters does CvGame::addVoteTriggered() take?

I tried adding the ability to trigger votes within the Event screen of worldbuilder, using the Diplovote type and vote info index as the parameters, but when it triggers I get this error:

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 741, in handleInput

  File "WBEventScreen", line 461, in handleInput

ArgumentError: Python argument types in
    CyGame.addVoteTriggered(CyGame, int, int)
did not match C++ signature:
    addVoteTriggered(class CyGame {lvalue}, int, int, int, int, int, class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >)
ERR: Python function handleInput failed, module CvScreensInterface

edit: I am getting an unexplained crash to desktop after merging the last release with MagisterModmod. In my first playtest I just gave up on a game, but when it happened again I decided to try to asserts dll and got these messages:
Code:
Assert Failed

File:  CvXMLLoadUtilityGet.cpp
Line:  761
Expression:  false
Message:  Error in GetChildXmlVal function, unable to find a child node

----------------------------------------------------------

Assert Failed

File:  CvTeamAI.cpp
Line:  3726
Expression:  !isAtWar(eWarTeam)
Message:  should be at peace with eWarTeam

----------------------------------------------------------
Assert Failed

File:  CvGame.cpp
Line:  5798
Expression:  getBuildingClassCreatedCount(eIndex) <= GC.getBuildingClassInfo(eIndex).getMaxGlobalInstances()
Message:  Index is expected to be within maximum bounds (invalid Index)

----------------------------------------------------------

Assert Failed

File:  CvArtFileMgr.cpp
Line:  182
Expression:  false
Message:  get##name##ArtInfo:  was not found

----------------------------------------------------------
Assert Failed

File:  CvTeam.cpp
Line:  7510
Expression:  eTeam < MAX_CIV_TEAMS
Message:  eTeam is expected to be within maximum bounds (invalid Index)

----------------------------------------------------------
Assert Failed

File:  CvCity.cpp
Line:  8326
Expression:  getBonusGoodHappiness() >= 0
Message:  

----------------------------------------------------------
Assert Failed

File:  CvCity.cpp
Line:  8338
Expression:  getBonusBadHappiness() <= 0
Message:  

----------------------------------------------------------
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:  CvGameCoreUtils.cpp
Line:  2760
Expression:  iLevel > 0
Message:  iLevel must be greater than zero

----------------------------------------------------------

Assert Failed

File:  CvGlobals.cpp
Line:  1964
Expression:  e > -1
Message:  

----------------------------------------------------------
The crash seemed to happen just after that CvGlobals.cpp Line 1964 assert. It was after ending the first turn after Judecca was summoned by an enemy and took one of my cities. Nothing appeared in PythonErr.log. PythonDebug.log ended in documenting tech diffusion to the Infernals. BBAILog shows it was the Barbarian's turn and they just spawned a Sluagh, a Skeleton, and a Trireme.
 
Last edited:
Edit: Seems it's not happening on your mod just mine so I'm going to have to figure out what changed to cause this.

When starting a new game it no longer plays the old FFH2 end of the Age of Ice video but rather the Warlords (which I don't even have installed...), then Firaxis Games logo, then BTS video instead.
 
Last edited:
CIV4GameText_FFH2.xml Line 6519 there is an extra empty line below the Spanish tag. Line 31262 (or near it) there is a missing icon bullet for the french language of TXT_KEY_SPELL_SACRIFICE_HELP and again at line 31494 (or near it) for TXT_KEY_SPELL_SPRING_HELP

Thanks, will be fixed in the next release.

What parameters does CvGame::addVoteTriggered() take?

See CyGameInterface.cpp, lines 277-279:
Code:
 .def("addVoteTriggered", &CyGame::addVoteTriggered,
       "int(int /*VoteSourceTypes*/ eVoteSource, int /*VoteTypes*/ eVote, int/*PlayerTypes*/ ePlayer, "
       "int iCityId, int /*PlayerTypes*/ eOtherPlayer, std::wstring szText)")

The 3rd to 5th arguments can be set to -1 if not needed (as for the majority of possible votes). The last argument is the text displayed in the popup.

For the other problem: The last assert indicates you are attempting getVoteInfo(eVote) for eVote == -1. You likely have a typo in the argument of gc.getInfoTypeForString(...) somewhere. This is probably the source of the crash, as it tries to access invalid memory after the assert.

The other asserts are unrelated. The first is some XML bug (unfortunately, I can't tell you any specifics without debugging).
The second assert means there are more buildings of some type than MaxGlobalInstances specifies, f.e. there are two instances of the same world wonder. I will remove this assert in the next release, as this situation is easily created with python and might well be intentional.
The third assert says the movie "" (yes, empty string) wasn't found. I'm not sure if the empty string here is a error reporting bug or you have some empty movie tag somewhere that causes this.
The fourth assert says that the C++ function getVoteSourceCondemnedWarCount() is called with an invalid eTeam. The only way I see this happing is that there is some makePeace() call with an invalid team. As I never came across this assert in MNAI, maybe you call this by python somewhere?
The "getBonusGood..." asserts may or may not be false positives, I'd need to have the savegame and debug that.
The iLevel assert means you have some level 0 (or lower) unit somewhere.
 
Last edited:
The second time that edible mushrooms are reported discovered (near a particular city?), they don't appear on the indicated tile.

The camera frequently doesn't move to show Barbarian moves.

Automating tiles worked sometimes results in the governor choosing a set of tiles with strictly lower yields; turning on citizen automation changes a city's output from 0 :food: 12:hammers: 11:commerce: to 0 :food: 12:hammers: 9:commerce:, for instance. (I suspect that reported tiles are not really being worked and the governor is embezzling the difference. Please arrange for his execution and replacement.)
 

Attachments

  • embezzling governor.CivBeyondSwordSave
    269.9 KB · Views: 172
The second time that edible mushrooms are reported discovered (near a particular city?), they don't appear on the indicated tile.
I experienced a similar bug with the volcano event recently and have a savegame waiting for debugging. Maybe that is related to this bug.

EDIT: Both bugs will be fixed in the next release.

Automating tiles worked sometimes results in the governor choosing a set of tiles with strictly lower yields; turning on citizen automation changes a city's output from 0 :food: 12:hammers: 11:commerce: to 0 :food: 12:hammers: 9:commerce:, for instance. (I suspect that reported tiles are not really being worked and the governor is embezzling the difference. Please arrange for his execution and replacement.)
That sounds like a quite obscure bug, thanks for providing the savegame. I'll debug that shady governor.

or it could mean that a unit with a certain promotion is immune to certain spells cast by other units.
So you mean, for example, the Mutation spell would add the Mutated promotion only to units without, f.e., PROMOTION_CANNOT_MUTATE?
 
Last edited:
The camera frequently doesn't move to show Barbarian moves.
Is this something other than the usual? I mean, as far as I can tell, most or all of the barbarian moves/attacks happen simultaneously, and the camera only zooms in on one of them. You just get the status message for the rest, or you can manual move the camera to the other location(s) during the Barbarian moves/attacks. That's the way I think it's always been. Or is this something else?
 
I just realized that Undercouncil resolutions to force global civics are applying to the Overcouncil instead.

I assume this is the same basic bug as was causing NoBonus resolutions to all apply to the Overcouncil and may already be fixed for the next release.

Do you have any ETA on the next release? My next release will break saved games anyway so I figured I might as well include your latest fixes so I don;t release two game breaking updates back to back.
 
I just realized that Undercouncil resolutions to force global civics are applying to the Overcouncil instead.
Yes, I noticed that, too. A fix will be included in the next release.

Do you have any ETA on the next release? My next release will break saved games anyway so I figured I might as well include your latest fixes so I don;t release two game breaking updates back to back.
My original plan was to include a few more fixes related to votes before releasing the savegame-breaking 2.8u, but those turned out to be more difficult that I thought. As the NoBonus and ForceCivics fixes are done, I plan to release a 2.8u-beta version this weekend; the release after that might then break savegames again.
 
Is this something other than the usual?
No.

I mean, as far as I can tell, most or all of the barbarian moves/attacks happen simultaneously
I'm pretty sure that actually simultaneously resolving them would require parallel processing capabilities that most personal computers lack. I don't recall ever seeing them depicted as occurring at the same time. It would be very odd for the game do that for only the Barbarians. Why would that be the case?

and the camera only zooms in on one of them.
Or none of them, showing a screen with no moving units on it. While a battle with one of my units, which I obviously (should) have vision on, happens elsewhere.

You just get the status message for the rest, or you can manual move the camera to the other location(s) during the Barbarian moves/attacks. That's the way I think it's always been.
I don't remember ever seeing this issue in unmodded Beyond the Sword. Maybe the bug's there, too, and perhaps it's beyond the capacity of modders to fix. Either way, no good reason for the Show Enemy Moves option not to cover Barbarians (including Hidden Nationality units; I'm pretty sure that this isn't specific to them, though). Heck, if that information is meant to be hidden from the player, then we shouldn't be able to see the moves by moving the camera! So even in the unlikely case that that was the intent, the implementation seems like a pretty clear glitch either way.
 
Last edited:
I'm pretty sure that actually simultaneously resolving them would require parallel processing capabilities that most personal computers lack. I don't recall ever seeing them depicted as occurring at the same time. It would be very odd for the game do that for only the Barbarians. Why would that be the case?


Or none of them, showing a screen with no moving units on it. While a battle with one of my units, which I obviously (should) have vision on, happens elsewhere.


I don't remember ever seeing this issue in unmodded Beyond the Sword. Maybe the bug's there, too, and perhaps it's beyond the capacity of modders to fix. Either way, no good reason for the Show Enemy Moves option not to cover Barbarians (including Hidden Nationality units; I'm pretty sure that this isn't specific to them, though). Heck, if that information is meant to be hidden from the player, then we shouldn't be able to see the moves by moving the camera! So even in the unlikely case that that was the intent, the implementation seems like a pretty clear glitch either way.
Try this. Load the attached save and end the turn. Before the Barbarians' turn, an Elohim unit attacks one of my cities, which the camera focuses on. Then in the Barbarians' turn, a skeleton attacks the same city, BUT (at least on my PC) the camera doesn't automatically go there because, at the same time, two Barbarian archer units (stationed in a city) are attacking a scout of mine south of there. I can manually move the camera away from the archers' attack to witness the skeleton's attack, but they are happening at the same time, so I can't watch both of them. However, I do get the status message (while still watching the archers' attack) that my warrior defeated the skeleton. Again, that's on my PC, so I can't guarantee you'll have the same experience.

Try it and let me know. As far as I know, I correctly installed the latest mnai-2.7.2u patch before starting this game. I am absolutely sure this behavior hasn't been any different in the last two years at least. It's still possible we're somehow talking about different things, though. I'm curious!
 

Attachments

  • Jayce TURN-0122a.CivBeyondSwordSave
    392.1 KB · Views: 146
Top Bottom