MNAI-U: unofficial build & bugfixes

In the next version could you fix the TXT_KEYs to that they have have a straight apostrophe instead of a space in all of the possessives? I have it that way in my modmod and find it a bit annoying when I use Winmerge to compare your mod and mine and have to go through all those minor differences before finding real text changes.

Also, could you make xml spells that grant promotions take into account the fact that units might be immune to those promotions, rather than having the spell be able to be casted even when it has no possible effect?

I went ahead and uploaded a zip of the one Platybuilder python file that I changed in order to allow Events to be triggered in Worldbuilder. I thought you might want to include this in the next update or use it to test to make sure your changes to the Vote code is working as expected. I may rewrite it once I have a DLL with more of the event code exposed to python, but this is better than the status quo.
 

Attachments

  • WBEventScreen.zip
    4 KB · Views: 143
In the next version could you fix the TXT_KEYs to that they have have a straight apostrophe instead of a space in all of the possessives?
I don't understand. Can you give an example of an affected TXT_KEY? I searched for " s ", but found only a bunch french tags that may or may not be incorrect, I don't speak french.

I have it that way in my modmod and find it a bit annoying when I use Winmerge to compare your mod and mine and have to go through all those minor differences before finding real text changes.
As a side note, you normally don't have to worry about things like these if you use mercurial. (On the other hand, I appreciate it when you report bugs here that are fixed in your Modmod but not in MNAI, of course.)

I went ahead and uploaded a zip of the one Platybuilder python file that I changed in order to allow Events to be triggered in Worldbuilder. I thought you might want to include this in the next update or use it to test to make sure your changes to the Vote code is working as expected. I may rewrite it once I have a DLL with more of the event code exposed to python, but this is better than the status quo.
Thanks, I will merge this for the next release.
If there are specific functions you want exposed, feel free to ask. I know the event code is a bit messy, unfortunately.
 
Regarding the barbarians attacking simultaneously that is something I've honestly never seen/noticed before but it's definitely happening now. I can confirm it's not what happens in base BTS and it's not something that's immediately obvious when or where this new behavior comes from as even with all the options turned off on a custom game it still happens. I can confirm there are attacks by the barbarians that are not centered on at all by my camera even when it's just 1 stack doing the attacking even with show enemy moves on and quick defense combat off. I'm not sure how long that's been happening either unfortunately.

Edit: I think I can confirm this was happening in MNAI 2.71 but I'm only 99% sure as I did the test on a backup that I believe is 2.71
 
Last edited:
I don't understand. Can you give an example of an affected TXT_KEY? I searched for " s ", but found only a bunch french tags that may or may not be incorrect, I don't speak french.


As a side note, you normally don't have to worry about things like these if you use mercurial. (On the other hand, I appreciate it when you report bugs here that are fixed in your Modmod but not in MNAI, of course.)


Thanks, I will merge this for the next release.
If there are specific functions you want exposed, feel free to ask. I know the event code is a bit messy, unfortunately.

When I look it up in Notepad++ it does not show a space but a 'PU2'. They are on a background like the 'CR' for carriage return or 'LF' for line feed that is not displayed in most text editors, but online those the PU2 does not disappear when I toggle "Show All Characters." It displayed as a space not only in Winmerge though, but in the game.

I just ran a comparison with Kael's original version of CIV4GameText_FFH2.xml and found the problem was his, not yours. (I probably would not have noticed if you had not changed the main text file to add the explainer for the Organized trait allowing the construction of Command Posts without sacrificing a great commander.) I believe he wrote the txt keys in a program that uses slanted apostrophes which the game does not understand. I think it is just something I fixed on my end a long time ago.


The issue shows up in TXT_KEY_BONUS_RAZORWEED_PEDIA, TXT_KEY_BUILDING_GAMBLING_HOUSE_PEDIA, TXT_KEY_BUILDING_MAGE_GUILD_PEDIA, TXT_KEY_BUILDING_MAGE_GUILD_PEDIA, TXT_KEY_UNIT_ARTHENDAIN_PEDIA, TXT_KEY_UNIT_BOAR_RIDER_STRATEGY, TXT_KEY_UNIT_MONK_PEDIA, TXT_KEY_UNIT_VALIN_PEDIA, TXT_KEY_WB_AGAINST_THE_GREY_VICTORY_CALABIM, TXT_KEY_WB_AGAINST_THE_GREY_VICTORY_MALAKIM, TXT_KEY_WB_BLOOD_OF_ANGELS_TORROLERIAL,TXT_KEY_WB_FALL_OF_CUANTINE_INTRO, TXT_KEY_WB_GIFT_OF_KYLORIN_INTRO, TXT_KEY_WB_LORD_OF_THE_BALORS_ALTAR_TO_DIS, TXT_KEY_WB_LORD_OF_THE_BALORS_CONCLUSION_BASIUM, TXT_KEY_WB_LORD_OF_THE_BALORS_FORGOTTEN_PASS_KEELYN, TXT_KEY_WB_RETURN_OF_WINTER_VICTORY, TXT_KEY_WB_THE_BLACK_TOWER_INTRO, TXT_KEY_WB_THE_MOMUS_DEFEATED_BEERI,TXT_KEY_WB_THE_MOMUS_DOGPILE_FALAMAR,TXT_KEY_WB_THE_MOMUS_DOGPILE_SALLOS,TXT_KEY_WB_THE_MOMUS_INTRO,TXT_KEY_WB_WAGES_OF_SIN_CONCLUSION_MALAKIM, TXT_KEY_WB_WAGES_OF_SIN_INTRO_MALAKIM, TXT_KEY_WB_WAGES_OF_SIN_TALIA_1_SHEAIM, and a bunch more if you include the alternate language (mostly French, but some German and Spanish) TXT_KEYs.


While running the comparison again I realized that the version of WBEventScreen.py I just shared referenced one new TXT_KEY I added to WorldBuilder_CIV4GameText.xml, and that I corrected minor issues in 2 other text files that are not MagisterModmod specific. I figured I might as well just upload the corrections for you.
 

Attachments

  • Text.zip
    1.4 MB · Views: 159
Last edited:
I will look into the barbarians issue at some point, thanks for the reports. I haven't played with enabled animations in a long time, so I also don't know when this started.

@MagisterCultuum: Thanks, that helps a lot. I merged all your corrections, except the one where you changed the german "Flauros' Rache" to "Flauros Rache", the former is correct.
 
New release: mnai-2.8-beta1u. This release is not be compatible with 2.7 savegames.
Thanks to all bug reporters and to omegaflames and MagisterCultuum for code contributions.

Download
Please extract into "Mods/Fall from Heaven 2" (not into the Assets folder!)

This release fixes some minor bugs (as always) and makes the BUG options "Hidden Attitudes" and "Pre-Chop" work. Additionally, the game and AI now have a better understanding in which era they are, which might fix some issues, f.e. with revolutions. Players of MagisterModMod might soon enjoy banning bonuses and forcing civics in the undercouncil.
For a full list of changes, see the second post of this thread.

The main reason that this release is called "beta" is that the next release (2.8-beta2u or 2.8.0u) will probably again break savegames.

EDIT: I just noticed that I forgot to change the in-game version number. Oh well, I will do that for the next release.
 
Last edited:
Thanks for the update.

I just uploaded my new version of MagisterModmod too.

I noticed that the Undercouncil Resolution to ban Sun Mana works to prevent Sun mana from appearing in the mana bar, but unlike the Overcouncil resolutions to ban mana (at least how they worked in old versions; I neglected to test this with this release) it does not prevent units from purchasing promotions with that mana prereq and does not prevent constructing buildings with that bonus prereq either.

I am occasionally getting this python bug. I am nto sure why. It does not seem to be causing problems, so I ignored it and uploaded anyway.
Spoiler :
Code:
Traceback (most recent call last):

  File "CvGameInterface", line 285, in getWidgetHelp

  File "CvGameUtils", line 1668, in getWidgetHelp

RuntimeError: unidentifiable C++ exception
ERR: Python function getWidgetHelp failed, module CvGameInterface
With the assert dll I am still getting these Asserts:
Spoiler :
Code:
Assert Failed

File:  CvXMLLoadUtilityGet.cpp
Line:  85
Expression:  false
Message:  Error getting int, empty element

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

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

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

File:  CvPlayer.cpp
Line:  13172
Expression:  getPower() >= 0
Message:  

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

File:  CvArea.cpp
Line:  635
Expression:  getPower(eIndex) >= 0
Message:  

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

File:  CvGameCoreUtils.cpp
Line:  2760
Expression:  iLevel > 0
Message:  iLevel must be greater than zero

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

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

----------------------------------------------------------
(when using Supplies to build  Granery)

Assert Failed

File:  CvInfos.cpp
Line:  6281
Expression:  i < GC.getNumTerrainInfos()
Message:  Index out of bounds

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

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

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


Assert Failed

File:  CvUnit.cpp
Line:  11925
Expression:  !at(iX, iY)
Message:  

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

Assert Failed

File:  CvUnit.cpp
Line:  12519
Expression:  pOldPlot != pNewPlot
Message:  

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

File:  CvGlobals.cpp
Line:  2206
Expression:  eTechNum < GC.getNumTechInfos()
Message:  

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

File:  z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line:  25
Expression:  ePlayer != NO_PLAYER
Message:  Player is not assigned a valid value

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


Assert Failed

File:  z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line:  25
Expression:  ePlayer != NO_PLAYER
Message:  Player is not assigned a valid value

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

File:  CvInitCore.cpp
Line:  1621
Expression:  eID < ((50) + 1)
Message:  Index in CvInitCore::getCiv expected to be < 51

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


Assert Failed

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

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

Assert Failed

File:  CvGameCoreUtils.cpp
Line:  2760
Expression:  iLevel > 0
Message:  iLevel must be greater than zero

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

File:  CvInfos.cpp
Line:  6281
Expression:  i < GC.getNumTerrainInfos()
Message:  Index out of bounds

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


Assert Failed

File:  CvUnit.cpp
Line:  12722
Expression:  getMoves() >= 0
Message:  

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

Assert Failed

File:  CvPlot.cpp
Line:  8634
Expression:  getStolenVisibilityCount(eTeam) >= 0
Message:  

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

Assert Failed

File:  CvUnitAI.cpp
Line:  26232
Expression:  false
Message:  

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

Assert Failed

File:  CvPlot.cpp
Line:  9322
Expression:  getBuildProgress(eBuild) >= 0
Message:  

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

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

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

(when sumoning Hyborem)



Assert Failed

File:  CvPlot.cpp
Line:  9322
Expression:  getBuildProgress(eBuild) >= 0
Message:  

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


Assert Failed

File:  CvPlot.cpp
Line:  8634
Expression:  getStolenVisibilityCount(eTeam) >= 0
Message:  

----------------------------------------------------------
 
I noticed that the Undercouncil Resolution to ban Sun Mana works to prevent Sun mana from appearing in the mana bar, but unlike the Overcouncil resolutions to ban mana (at least how they worked in old versions; I neglected to test this with this release) it does not prevent units from purchasing promotions with that mana prereq and does not prevent constructing buildings with that bonus prereq either.
Very strange, it should work as you describe. I'll check that.

I am occasionally getting this python bug. I am nto sure why. It does not seem to be causing problems, so I ignored it and uploaded anyway.
This looks like it should only when hovering over certain widgets in worldbuilder. Is that true?

The first two asserts are XML errors. I'll see if I can make them a bit more informative for the next version.
I explained some of the other asserts already. I'll try to reproduce the once where you provided a description. Unfortunately, I can't tell what went wrong just from the asserts, and also can't debug without a savegame. The index out of bounds errors are easily triggered from python, but it's hard to tell from where exactly. I'll see if I can at least put the python function that called the assert in the assertion message in the future.
 
I don't know if I'm doing this right, but when I tried playing the Cave of Trials scenario, I got the following Asserts:

Spoiler :

Assert Failed

File: CvSelectionGroupAI.cpp
Line: 228
Expression: false
Message:

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

Assert Failed

File: CvInfos.cpp
Line: 2673
Expression: i > -1
Message: Index out of bounds

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

Assert Failed

File: CvInfos.cpp
Line: 6281
Expression: i < GC.getNumTerrainInfos()
Message: Index out of bounds

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

Assert Failed

File: CvTeam.cpp
Line: 6487
Expression: getUnitClassCount(eIndex) >= 0
Message:

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

Assert Failed

File: CvPlayer.cpp
Line: 15425
Expression: getUnitClassCount(eIndex) >= 0
Message:

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

Assert Failed

File: CvPlayer.cpp
Line: 12181
Expression: getNumMilitaryUnits() >= 0
Message:

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

Assert Failed

File: CvPlayer.cpp
Line: 13172
Expression: getPower() >= 0
Message:

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

Assert Failed

File: CvPlayerAI.cpp
Line: 17694
Expression: AI_getNumAIUnits(eIndex) >= 0
Message:

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

Assert Failed

File: CvUnit.cpp
Line: 11925
Expression: !at(iX, iY)
Message:

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

Assert Failed

File: CvUnit.cpp
Line: 12519
Expression: pOldPlot != pNewPlot
Message:

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

Assert Failed

File: CvPlayer.cpp
Line: 13172
Expression: getPower() >= 0
Message:


Hopefully this'll help out with any possible bug hunting. If you need me to perform any actions for you, feel free to tell me and I'll help the best I can.
 
You probably should not have workers wait before clearing forests, or show how many hammers can be gained from clearing the forest, for civilizations that preserve the forest feature and so do not actually clear them.

I removed the <iMinLevel/> tags and the comments from the Kuriotates in CIV4CivilizationInfos.xml and found I am getting asserts less often, but am still getting all of these. I think the iLevel assert listed here is probably due to promotions with <iMinLevel>1</iMinLevel>, all those effects which Kael gave that tag to stop any unit from every purchasing it.
Spoiler :

Assert Failed

File: CvArea.cpp
Line: 635
Expression: getPower(eIndex) >= 0
Message:

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

File: CvPlayer.cpp
Line: 13172
Expression: getPower() >= 0
Message:

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

File: CvArea.cpp
Line: 635
Expression: getPower(eIndex) >= 0
Message:

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

File: CvGameCoreUtils.cpp
Line: 2760
Expression: iLevel > 0
Message: iLevel must be greater than zero

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

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

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

File: CvUnitAI.cpp
Line: 25496
Expression: false
Message:

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

File: CvPlayer.cpp
Line: 23721
Expression: GC.getEventInfo(eEvent).isQuest() || GC.getGameINLINE().getGameTurn() - kTriggeredData.m_iTurn <= 4
Message:

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

File: z:\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: 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: CvCity.cpp
Line: 8326
Expression: getBonusGoodHappiness() >= 0
Message:

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

File: CvInfos.cpp
Line: 2673
Expression: i > -1
Message: Index out of bounds

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

File: CvCity.cpp
Line: 6549
Expression: getBaseGreatPeopleRate() >= 0
Message:

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

Assert Failed

File: CvCity.cpp
Line: 10872
Expression: getSpecialistCommerce(eIndex) >= 0
Message:

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

Assert Failed

File: CvPlot.cpp
Line: 8121
Expression: getCulture(eIndex) >= 0
Message:

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


Assert Failed

File: CvCity.cpp
Line: 6574
Expression: getGreatPeopleProgress() >= 0
Message:

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

File: CvCity.cpp
Line: 11452
Expression: getCultureTimes100(eIndex) >= 0
Message:

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


Assert Failed

File: CyGlobalContext.cpp
Line: 70
Expression: idx>=0
Message:

----------------------------------------------------------
(when going from the city screen to the UNits+ Cities screen fo worldbuilder)

Assert Failed

File: CvGameCoreUtils.cpp
Line: 2760
Expression: iLevel > 0
Message: iLevel must be greater than zero

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

File: CvUnit.cpp
Line: 11925
Expression: !at(iX, iY)
Message:

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

Assert Failed

File: CvUnit.cpp
Line: 12519
Expression: pOldPlot != pNewPlot
Message:

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

File: z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line: 25
Expression: ePlayer != NO_PLAYER
Message: Player is not assigned a valid value

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

File: CvPlayerAI.cpp
Line: 14716
Expression: false
Message:

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

 
Last edited:
New release: mnai-2.8-beta2u. Should be compatible with mnai-2.8-beta1u savegames, but not with 2.7u savegames.

Download
Please extract into "Mods/Fall from Heaven 2" (not into the Assets folder!)

I made this mini-release to fix the typo that caused CvCity::getBonus to behave erratically. Please update, as this bug might cause other unexpected problems.

Other notable changes:
  • Barbarians no longer attack simultaneously. This also fixes a problem where some barbarian units don't move at all because they try to attack while there is already fighting on their plot, and an assert.
  • There is now a BUG option (General/Miscellaneous/Overlay Minimap Water Tiles) to not highlight owned water tiles in the minimap, a feature I coded a while ago. I think this looks better, especially in the late game. See the attached images for a comparison.
For a full list of changes, see the second post of this thread.

Thanks to everybody who reported bugs.

@MagisterCultuum and potentially other modders: This release removes all tags with default values from CIV4UnitInfos.xml, as FfH already does for CIV4PromotionInfos.xml. This is to make navigating easier and reduce download size. At some point I will do this for a few other files, too.
For this release, you can ignore the changes, as there are no other changes to CIV4UnitInfos.xml. For the future, you have two options:
  • Keep all the default values in your mod. This will mess up diffs (e.g. with WinMerge) completely. You'd have to check the differences between two of my versions (or check the commits) and selectively merge them.
  • Follow me in removing the default values. I will release the python tool I used for this with the next version, so you don't have to do it by hand.
 

Attachments

  • default_water_overlay.png
    default_water_overlay.png
    21.1 KB · Views: 153
  • no_water_overlay.png
    no_water_overlay.png
    21.1 KB · Views: 152
Thanks @lfgr.

CIV4UnitInfos.xml is a file I have changed so much that I already had to selectively merge it after comparing with your last version. I completely reorganized the units into different categories to make them easier for me to find what I wanted in Worldbuilder, before Platybuilder added means of sorting units by different types that made the change moot. There are some units I added to the end which broke the organization scheme, but it has seemed like too much work to try to put things back in a vanilla order now. Besides, I added and deleted enough units that Winmerge would struggle keeping thins straight anyway.

My personal preference would be to eliminate all extraneous tags for almost all of the units/promotions/spells/buildings/whatever, but to leave a single entry at the top or bottom of the file with every tag in place. That would make it easier to check and make sure that everything is in the right order whenever adding or editing another unit/promotion/spell/building/whatever.


If you are cleaning up a file to make it smaller and easier to navigate anyway, would you mind also replacing spaces with tabs in all your indents?

Using spaces for tabs is more annoying in python than xml, but I personally prefer to consistently use tabs everywhere. I switched almost everything to tabs in my version a long time ago, so the spaces make Winmerge comparisons more awkward.

I was also wondering about the various "print" statements found in many python files, presumably for error checking. Whenever I edit a python file I usually like to debug it in PyScripter to find syntax errors before testing it in a game. PyScripter always tells me that those Print statements have invalid syntax and that what follows print should be within a set of parentheses.

Is there any real difference between print dir(self.config) and print (dir(self.config)) ?

I don't think this really seems to matter, but PyScripter's debugging process stops early when it runs into such a print statement before finding a real error so those might lead me to miss something more important.
 
Last edited:
Do you get all these asserts when starting the scenario?

I get them repeatedly as I play through the scenario. The later asserts (those outside the first 4) come into play when I fail to answer the riddle correctly and the Meshabber of Dis kills me.
 
My personal preference would be to eliminate all extraneous tags for almost all of the units/promotions/spells/buildings/whatever, but to leave a single entry at the top or bottom of the file with every tag in place. That would make it easier to check and make sure that everything is in the right order whenever adding or editing another unit/promotion/spell/building/whatever.
I think having an example entry in a separate file is a better idea. I plan to have a doc folder with more modding information at some point anyway.

If you are cleaning up a file to make it smaller and easier to navigate anyway, would you mind also replacing spaces with tabs in all your indents?
That's a good point, I will do that for the files where I remove the default tags. I think WinMerge has a "ignore spaces" setting, though. Other graphical diff tools have it, at least.

I was also wondering about the various "print" statements found in many python files, presumably for error checking. Whenever I edit a python file I usually like to debug it in PyScripter to find syntax errors before testing it in a game. PyScripter always tells me that those Print statements have invalid syntax and that what follows print should be within a set of parentheses.

Is there any real difference between print dir(self.config) and print (dir(self.config)) ?

I don't think this really seems to matter, but PyScripter's debugging process stops early when it runs into such a print statement before finding a real error so those might lead me to miss something more important.
This is a difference between Python 2 and Python 3. Python 3 requires parentheses, Python 2 allows both parenthesis and not, with no difference except in edge cases. Civ4 uses Python 2. You'll have to see if you can set PyScripter to Python 2; its website didn't tell me anything useful about that.

I get them repeatedly as I play through the scenario. The later asserts (those outside the first 4) come into play when I fail to answer the riddle correctly and the Meshabber of Dis kills me.
Ok, thanks, I'll look into it at some point.
 
Apparently the 64bit version of PyScripter can only use 64 bit versions of Python. I'm not finding a 64 bit version of python 2.4 to download. I vaguely recall that on my old computer I used to have the old 32 bit version installed with Python 2.5 in addition to the newer PyScripter with Python 3.x, but that with the upgrade to Windows 10 the 32 bit version stopped working.

If using parentheses with print causes no problems in Python 2, I would prefer going ahead and changing those when you are cleaning us the files for other reasons.

I just found that the Ban Sun Mana resolution's effects seem to be fixed with normal CvGameCoreDLL.dll, but not with CvGameCoreDLL_assert.dll included in mnai-2.8-beta2u. Did you forget to update that file?

It may not mean much, but I am still getting these asserts with that CvGameCoreDLL_assert.dll:
Spoiler :

Assert Failed

File: CvGameCoreUtils.cpp
Line: 2760
Expression: iLevel > 0
Message: iLevel must be greater than zero

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

File: CvArea.cpp
Line: 635
Expression: getPower(eIndex) >= 0
Message:

----------------------------------------------------------(When raiding a graveyard)

Assert Failed

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

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

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

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

File: CvGlobals.cpp
Line: 3755
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type ATTACHABLE_GOLSHAN_FIRE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml

----------------------------------------------------------(when using worldbuilder to turn a unit into a Dryad)

Assert Failed

File: CvSelectionGroupAI.cpp
Line: 231
Expression: false
Message:

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

Assert Failed

File: CvCity.cpp
Line: 12816
Expression: eIndex >= 0
Message: eIndex expected to be >= 0

----------------------------------------------------------
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: z:\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: 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: z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line: 25
Expression: ePlayer != NO_PLAYER
Message: Player is not assigned a valid value

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


Assert Failed

File: CvSelectionGroupAI.cpp
Line: 231
Expression: false
Message:

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

Assert Failed

File: CvGameCoreUtils.cpp
Line: 2760
Expression: iLevel > 0
Message: iLevel must be greater than zero

----------------------------------------------------------
'
Assert Failed

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

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




Assert Failed

File: z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line: 25
Expression: ePlayer != NO_PLAYER
Message: Player is not assigned a valid value

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

File: z:\repos\mnai_unofficial\cvgamecoredll\CvPlayerAI.h
Line: 25
Expression: ePlayer != NO_PLAYER
Message: Player is not assigned a valid value

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


Assert Failed

File: CvUnit.cpp
Line: 12905
Expression: getCargo() == aUnits.size()
Message: (May occur erroneously when moving a ship containing some unit that can see some invisible type)

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



Do you have any explanation for why a leader might sometimes be given extra traits, both in the pedia and the game, which disappear when the game is reloaded? thegreekweegee just reported a weird bug with Hafgan the Purger having Pact with Sallos in the pedia and game. I had a similar bug a couple times (I think it was Volanna with Pact with Sallos once and Hafgan with Pact with Statius once) with an older version, but reloading once seemed to solve it for me. I've also like him notice that the game occasionally closes itself during the initialization process.



edit: I am getting a repeated "TradeUtil - unknown item type 10" message in my current game.
 
Last edited:
My personal preference would be to eliminate all extraneous tags for almost all of the units/promotions/spells/buildings/whatever, but to leave a single entry at the top or bottom of the file with every tag in place. That would make it easier to check and make sure that everything is in the right order whenever adding or editing another unit/promotion/spell/building/whatever.
I think having an example entry in a separate file is a better idea. I plan to have a doc folder with more modding information at some point anyway.
For what it matters I'm more on Magister's side for this.
during my few months of modding it was a pain at first to understand the order needed to introduce new effects to an existing unit in RifE (which works with removing the tags with default values). (or when creating a unit) as compared to MnAI or Magister or Extramodmod which had the full list of tags for each unit.
I understand the need for less DL space, but for me the cons of not having the data within the xml file outweights the pros. (having to go check on a non-yet-existing file will complicate things IMO, especially for "new" modders)
 
Apparently the 64bit version of PyScripter can only use 64 bit versions of Python. I'm not finding a 64 bit version of python 2.4 to download. I vaguely recall that on my old computer I used to have the old 32 bit version installed with Python 2.5 in addition to the newer PyScripter with Python 3.x, but that with the upgrade to Windows 10 the 32 bit version stopped working.
Version 2.7 should be fine, as it is mostly backwards-compatible, and it has a 64-bit download (see here). I'm not sure if you really need any python version installed, though; when you say you're "debugging" your python files, you're not actually executing them in any way, right?

If using parentheses with print causes no problems in Python 2, I would prefer going ahead and changing those when you are cleaning us the files for other reasons.
I will keep this in mind. I sometimes use PyCharm, and it always reports me loads of unused variables and the like, so I might do a cleanup at some point.

I just found that the Ban Sun Mana resolution's effects seem to be fixed with normal CvGameCoreDLL.dll, but not with CvGameCoreDLL_assert.dll included in mnai-2.8-beta2u. Did you forget to update that file?
Well dang, good catch. I uploaded the correct file here.

Concerning the asserts: One of my priorities is to add a stacktrace to every assertion error, so it shows the stack of calling C++ functions. It doesn't seem possible to extend that to python, but it would still the called Python API function (like CyGame.something()). This would also make it easier for you to spot if there is something wrong in the python code. Right now, getting reports of assertion errors with no additional information doesn't give me much to work with, unfortunately. On the other hand, if you have a savegame that triggers the assert (or a savegame and steps to reproduce), I can usually at least identify the problem easily (or remove the assert if it doesn't actually mean there's an error).

Anyway, I currently have so much stuff to investigate that I don't think you need to report every unsuspicious assert you come across. If you suspect it is connected to some other problem, feel free to post it, though. At some point, I will also go through an AIAutoplay game with MagisterModMod and look into the asserts I get.

What I can say is that the "ATTACHABLE_GOLSHAN_FIRE not found" assertion most probably means you reference "ATTACHABLE_GOLSHAN_FIRE" somewhere in the python code, but it doesn't exist. Maybe a typo?

Do you have any explanation for why a leader might sometimes be given extra traits, both in the pedia and the game, which disappear when the game is reloaded? thegreekweegee just reported a weird bug with Hafgan the Purger having Pact with Sallos in the pedia and game. I had a similar bug a couple times (I think it was Volanna with Pact with Sallos once and Hafgan with Pact with Statius once) with an older version, but reloading once seemed to solve it for me. I've also like him notice that the game occasionally closes itself during the initialization process.
You mentioned an older version, so this is not restricted to mnai-2.8-beta1u? The bug that I fixed in mnai-2.8-beta2u could have had all sorts of effects.
I never had these problems with MNAI or EMM.

edit: I am getting a repeated "TradeUtil - unknown item type 10" message in my current game.
This seems to be a BUG problem, I'll look into it.

For what it matters I'm more on Magister's side for this.
during my few months of modding it was a pain at first to understand the order needed to introduce new effects to an existing unit in RifE (which works with removing the tags with default values). (or when creating a unit) as compared to MnAI or Magister or Extramodmod which had the full list of tags for each unit.
I understand the need for less DL space, but for me the cons of not having the data within the xml file outweights the pros. (having to go check on a non-yet-existing file will complicate things IMO, especially for "new" modders)
I understand that having all the default tags makes it easier to insert new effects, but it makes it so much harder to read the XML. It is impossible to see at a glance what a unit is doing, because there are so many <b.....>0</b...> tags. You usually cannot even see what entry you're currently in. And when you maintain a mod (and generally, a program), you do much more reading than writing.
That said, I guess the real problem is that the Tag order mostly makes no sense whatsoever. I'm thinking of just making the tag order optional - the DLL already supports this, as far as I can tell, but I'd have to look into how to configure the schema accordingly (as a fun fact the schema already allows you to place every tag that is defined in it in every other tag where you don't specifically declare model=closed. XDR really was a stupid schema format).
 
Version 2.7 should be fine, as it is mostly backwards-compatible, and it has a 64-bit download (see here). I'm not sure if you really need any python version installed, though; when you say you're "debugging" your python files, you're not actually executing them in any way, right?


I will keep this in mind. I sometimes use PyCharm, and it always reports me loads of unused variables and the like, so I might do a cleanup at some point.


Well dang, good catch. I uploaded the correct file here.

Concerning the asserts: One of my priorities is to add a stacktrace to every assertion error, so it shows the stack of calling C++ functions. It doesn't seem possible to extend that to python, but it would still the called Python API function (like CyGame.something()). This would also make it easier for you to spot if there is something wrong in the python code. Right now, getting reports of assertion errors with no additional information doesn't give me much to work with, unfortunately. On the other hand, if you have a savegame that triggers the assert (or a savegame and steps to reproduce), I can usually at least identify the problem easily (or remove the assert if it doesn't actually mean there's an error).

Anyway, I currently have so much stuff to investigate that I don't think you need to report every unsuspicious assert you come across. If you suspect it is connected to some other problem, feel free to post it, though. At some point, I will also go through an AIAutoplay game with MagisterModMod and look into the asserts I get.

What I can say is that the "ATTACHABLE_GOLSHAN_FIRE not found" assertion most probably means you reference "ATTACHABLE_GOLSHAN_FIRE" somewhere in the python code, but it doesn't exist. Maybe a typo?


You mentioned an older version, so this is not restricted to mnai-2.8-beta1u? The bug that I fixed in mnai-2.8-beta2u could have had all sorts of effects.
I never had these problems with MNAI or EMM.


This seems to be a BUG problem, I'll look into it.


I understand that having all the default tags makes it easier to insert new effects, but it makes it so much harder to read the XML. It is impossible to see at a glance what a unit is doing, because there are so many <b.....>0</b...> tags. You usually cannot even see what entry you're currently in. And when you maintain a mod (and generally, a program), you do much more reading than writing.
That said, I guess the real problem is that the Tag order mostly makes no sense whatsoever. I'm thinking of just making the tag order optional - the DLL already supports this, as far as I can tell, but I'd have to look into how to configure the schema accordingly (as a fun fact the schema already allows you to place every tag that is defined in it in every other tag where you don't specifically declare model=closed. XDR really was a stupid schema format).
I have Python 2.7 working now with PyScripter, so the Print statements are not really an issue anymore.

I think it was with a mnai-2.7.2u based version that I first noticed the leaders getting extra wrong traits, but am not certain. I assume thegreekweegee was using the mnai-2.8-beta1u based version.


I do not think ATTACHABLE_GOLSHAN_FIRE is a python issue. I am fairly confident that this assert is related to the artwork for the Kuriotate Dryad UU. The only times "golshan" appears are in its art defines.
Spoiler :
Code:
       <UnitArtInfo>
           <Type>ART_DEF_UNIT_DRYAD</Type>
           <Button>Art/Interface/Buttons/Units/faeriedryade.dds</Button>
           <fScale>18</fScale>
           <fInterfaceScale>0.6</fInterfaceScale>
           <bActAsLand>0</bActAsLand>
           <bActAsAir>0</bActAsAir>
           <NIF>Art/units/Civs/Kuriotates/Dryad/golshan.nif</NIF>
           <KFM>Art/units/Civs/Kuriotates/Dryad/golshan.kfm</KFM>
           <SHADERNIF>Art/units/Civs/Kuriotates/Dryad/golshan.nif</SHADERNIF>
           <ShadowDef>
               <ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
               <ShadowAttachNode>Bip01 Pelvis</ShadowAttachNode>
               <fShadowScale>0.0</fShadowScale>
           </ShadowDef>
           <fBattleDistance>0.20</fBattleDistance>
           <fRangedDeathTime>0.28</fRangedDeathTime>
           <bActAsRanged>0</bActAsRanged>
           <TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
           <AudioRunSounds>
               <AudioRunTypeLoop/>
               <AudioRunTypeEnd/>
           </AudioRunSounds>
           <SelectionSound>AS3D_UN_SPY_SURR_VOX</SelectionSound>
           <ActionSound>AS3D_UN_SPY_SURR_VOX</ActionSound>
       </UnitArtInfo>
I think there might be some effect missing that might not have gotten copied when I borrowed this art from another mod. I don't recall which mod at the moment, and I don't think this art issue has ever caused any real problems.



I don't see why it would be harder to read a file that had none of the default tags included for any unit except for one at the top or bottom just to make things easy to find without leaving the document. Making tag order irrelevant might be nice, but sometimes you want to be able to look at all the tags at a glance in case you forgot what tags are available.




When I was eliminating extraneous tags from CIV4UnitInfos.xml before my last release I accidentally got rid of all the <iAdvancedStartCost> tags, which meant no unit could be placed in Advanced Start games. I fixed this an hour after the release, but it seems to me that it would make more sense to get rid of these tags again and have you assign <iAdvancedStartCost> the default value of 100.

I believe this tag indicates what percentage of the hammers from iCost is the gold price of buying units in Advanced Start games, but the only values I've actually seen used are 100 and -1. A value of -1 in either <iAdvancedStartCost> or <iCost> prevents units from being placed in advanced start games.

In your version, 169 units have <iAdvancedStartCost>100</iAdvancedStartCost>, and 126 of the remaining 158 units have <iCost>-1</iCost>. If you made <iAdvancedStartCost> default to 100, then the tag would only need to be used for 32 instead of 327 units.
 
Top Bottom