That code is garbage; a cluster of memory leaks, buffer overflows and access violations. I would be surprised if that code was not causing crashes.
At a glance - and without actually testing - I suspect the intended meaning is something like this:
Code:
int iJ;
pStream->Read(&iJ);
if (iJ > 0)
{
m_paiCondemnCivicCount = new int*[iJ];
for (int iI = 0; iI < iJ; ++iI)
{
int iK;
pStream->Read(&iK);
if (iK > 0)
{
m_paiCondemnCivicCount[iI] = new int[iK];
pStream->Read(iK, m_paiCondemnCivicCount[iI]);
}
else
{
m_paiCondemnCivicCount[iI] = NULL;
}
}
}
else
{
m_paiCondemnCivicCount = NULL;
}
I would have to look at the surrounding code to be sure though. However, given the poor quality of that code snippet, I would be wary of any code from the same source.
About half an hour ago I got a warning from Windows 10 saying that it needed to close Civilization 4 to prevent the loss of data because I was running out of RAM.
I have 8gb of ram on the laptop and thought using all of that up seemed unlikely, so I checked Resource Manager. It did not show much ram associated with the Civ4 program, but showed more than 4gb of memory in the "modified" category ("memory whose contents must be written to disk before ti can be used for another purpose") even after closing Civ4, until I restarted the whole computer.
I'm no expert on the matter, but I think what we had was a serious memory leak.
The save I made just before closing the program again caused a crash, as did all the previous saves from that game.
This was with a test version of my modmod were I had deleted the troublesome fixed borders resolution in hopes that this would solve the problem. (I do like the idea of such a resolution, but not the the current implementation which makes it impossible for cities founded or captured late in the game to expand their culture at all to access resources.)
I just now downloaded the debug DLL to see if it helps identify issues.
The debug DLL seems way slower, so I hope we fix the problems and get a new regular dll soon.
When first opening the program to start a new game I got this message:
Note that in my modmod, converting religions switches out dummy buildings that add or subtract mana types assocated with or opposed to that faith.
Also note that this is in an advanced start game, before existing advanced start. (I'm playing as the Ljosalfar and chose to convert to FoL through the popup as soon as it was founded. It it weren't my leader's favorite religion it would not get founded until after starting the game so I wouldn't have that option.)
I got this message after accidentally pressing the advanced start Build Improvement (Automated) button:
Code:
Assert Failed
File: CvInfos.cpp
Line: 6322
Expression: i > -1
Message: Index out of bounds
----------------------------------------------------------
Assert Failed
File: CvCity.cpp
Line: 7713
Expression: getBonusGoodHealth() >= 0
Message: getBonusGoodHealth is expected to be >= 0
----------------------------------------------------------
Code:
Assert Failed
File: CvArtFileMgr.cpp
Line: 182
Expression: false
Message: get##name##ArtInfo: was not found
----------------------------------------------------------
This also seems to be mod-specific. Most likely related to your mana buildings. Looks like you are setting the FreeBonus to a negative value which is not expected.
I got this message after accidentally pressing the advanced start Build Improvement (Automated) button:
Code:
Assert Failed
File: CvInfos.cpp
Line: 6322
Expression: i > -1
Message: Index out of bounds
That error is in the canStartMission() function. I wasn't able to replicate. What exactly do you mean by "selecting a unit in worldbuilder"? Are you trying to edit a unit?
I do use comments to help organize some xml files. I guess I could delete them if necessary.
This also seems to be mod-specific. Most likely related to your mana buildings. Looks like you are setting the FreeBonus to a negative value which is not expected.
Note that the Build Improvement (Automated) button in Advanced Start is not just about improvements. It lets the AI make all sorts of decisisons about what to purchase, including units, technologies, buildings, cities, etc.
This is the getFreePromotions() code again. Are you making calls to this function from python?
I call it once in CvEventManager.py under def onUnitCreated(self, argsList): in a snippet of code that prevents heroes that start with equipment from generating extra copies of that equipment when they are resurrected (or duplicated by the Black Mirror or Hall if Mirrors). It is within the conditional if isWorldUnitClass(iUnitClass):, so it shouldn't be running except for world units.
I call it 9 times in CvSpellInterface.py:
Once under def atRangeNecrototem(pCaster, pPlot):, to prevent newly initialized units from running in fear before being granted starting promotions that would make them immune to fear.
Once under def onMoveBlizzard(pCaster, pPlot): to stop units starting with Winterborn from being hurt when initialized on tiles with Blizzards.
Once in helpRecruitMercenaryType to determine whether to list promotion perks.
Twice in def reqRecruitMercenaryType(pCaster, eSpell, sUnitClass): to prevent undead mercenaries from being recruited by players for whom death mana is banned or demons for players who are neither Infernal nor Ashen Veil.
Twice in def spellRecruitMercenaryType(pCaster, eSpell, sUnitClass): when assigning the correct racial promotions to the mercenaires.
Once in def reqTakeEquipmentPromotion(pCaster, unit, eSpell=-1): to prevent Barnaxus himself from loosing his pieces (and thus golem-teaching ability)
Once in def helpShowSummonDetails(lpUnits, eSpell, sUnit, iNum = 1): to prevent listing summon perks which would already be listed in the unit help details already included.
I call it twice in CvGameUtils.py:
Once to make the Ban Death Mana resolution also block the construction of undead units (like Pyre Zombies) and
Once under def applyBuildEffects(self, argsList): when determining whether to grant racial promotions to units of Tolerant civs in cities of other cultures.
I call it 4 times in CustomFunctions.py:
Once is in the Sluagh generating code to let it know to use the Alternate Type for Werewolves and
Three times in the giftUnit code to allow water walking or flying units to appear on water.
I call it once in WBUnitScreen.py, in a section of code I commented out for your version. (This is not really necessary, but it makes it more convenient to quickly resurrect dead heroes from their sluaghs.)
It is called twice in the BUG ReligionUtil.py, to determine what units qualify as priests. That is not something I changed. (I should though, as priests in my version don't have Channeling 2.)
It is used 3 times in both CvPediaUnit.py and SevoPediaUnit.py under def placePromotions(self): when dealing with whether to display the various spell sphere promotions. (I did not touch this code either. Perhaps I should amend it to take into account those spell spheres that Vampirism or Unholy Taint may also make accessible.)
Haven't seen this one. Likely related to something new in your mod.
This message first appeared when I used a wolf to construct a wolf pen.
I have added some new building art, but not for that.
That error is in the canStartMission() function. I wasn't able to replicate. What exactly do you mean by "selecting a unit in worldbuilder"? Are you trying to edit a unit?
That function is used Platyping's more recent changes to WBUnitScreen.py, to generate the list of missions which you can force a unit to perform.
I the updated MNAI worldbuilder with that function was released before this Beta but not yet merged into it.
(I still have not gotten around to identifying all the newly exposed python functions to update worldbuilder to use them yet.)
I forgot to copy the exact error, but I also got one when I used worldbuilder to reduce a unit's level to zero, saying the number should be greater than zero. It shouldn't be too hard to edit the python code to make 1 instead of 0 the floor here.
edit: I just got these during another player's turn:
The game is picky about XML comments. Sometimes they are fine. Other times they throw these errors. I'm not sure what criteria it uses to decide which comments are acceptable. If you check the PythonDbg log right when that error pops up you might be able to trace it to a specific XML file.
Each religion has 2 dummy buildings. One adds +1 of the associated mana. The other 'adds' -2 of the opposite sphere.
I would prefer to make it only -1, but the code still treats that as equivalent to +3.
As long as the game is working as expected I guess this isn't a problem. -1 is often used in the code to signify a NULL field. Passing a -1 to a function that isnt expecting it can result in strangeness.
Note that the Build Improvement (Automated) button in Advanced Start is not just about improvements. It lets the AI make all sorts of decisisons about what to purchase, including units, technologies, buildings, cities, etc.
That's in the setXY code. Looks like there is a log output right before it hits this assert (not BBAlog -- one of the others). If you see this again, try and find the log entry which will tell us what plots the unit is moving from and to.
The game is picky about XML comments. Sometimes they are fine. Other times they throw these errors. I'm not sure what criteria it uses to decide which comments are acceptable. If you check the PythonDbg log right when that error pops up you might be able to trace it to a specific XML file.
The CvSelectionGroup error is related to Worldbuilder 4.17. You're calling canStartMission with a mission value of 41 which doesn't correspond to anything in FFH
Also, I don't see the CvArtFileMgr error when building a wolf pen in MNAI.
Ah, yes, that must be it then. Is there a fix? (Besides just not using Blue Marble and the grid in combination with each other, I mean. That's more of a workaround, if anything.)
It's part of Advanced Diplomacy which is placed under Advanced Tactics in this mod. Non-agression pact doesn't enforce peace like a peace treaty does. Instead it is a gentleman's agreement. If one side breaks the pact, they should get a diplomatic penalty for doing so.
Those are options in the diplomacy screen. They may be gated by some prerequisites. Not sure on that. Diplomacy code is not an area am I very familiar with (which is why I'm trying to merge someone else's code who has worked on that facet of the game).
Er, no, not as such. I can request a declaration of war, embargo, change of civic(s), change of religion, etc. from the AI, but I can't offer any of those things to the AI, and in my experience the AI never offers anything for them. You only ever get the chance to suck up in hopes of future favors, rather than any immediate tangible benefit.
Unless there actually are techs or something that let you offer those things to the AI in trade, but I doubt it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.