Chronicles of Mankind

Well, I have spent quite some time today with digging for the reason of that loop but I'm still clueless. :dunno:
I am no longer sure about Caste civic being guilty.

EDIT:The only thing thet helped is restarting the game from an earlier autosave to postpone the loop for some time.

If anyone has any ideas let me know.

I noticed some infinite loops on the following circumstances, while researching the logs:
  • Computer's Settler pathfinding algorithm, happened once. Log showed a Settler trying to find a safe path, couldn't find it, so started going back and forth without moving. Loading a save from previous turn was a hack way to pass through, as the circumstances that were trouble are now different (file BBAI_Team_4.txt)
  • Computer's Spy. This one is more recent. This is what last entries from my logs shows:
From xml.log
Code:
[51206.270] Loading XML file Assets\xml\GameInfo/CIV4EspionageMissionInfo.xml
[51206.273] Load XML file Assets\xml\GameInfo/CIV4EspionageMissionInfo.xml SUCCEEDED
[51206.273] SetGlobalClassInfo (Civ4EspionageMissionInfo/EspionageMissionInfos/EspionageMissionInfo)

From PythonDbg.log
Code:
10:28:14 DEBUG: SpyUtil - stored: {'turn': 1367, 'version': 1, 'values': {0: [0, 636, 2184, 0, 1102, 1132, 0], 1: [893, 0, 1317, 0, 1021, 509, 0], 2: [2563, 946, 0, 0, 858, 497, 0], 3: [0, 0, 0, 0, 0, 0, 0], 4: [1337, 767, 853, 0, 0, 1835, 0], 5: [1610, 498, 416, 0, 2570, 0, 0]}}

Besides these two, I couldn't theorize much about the cause of infinite loops. Maybe we can try to find a trend of what we players are doing at the time? For that matter, I suggest we could try some controlled new saves, with different settings of civics and computer players, but we should narrow the search more before it.

EDIT: any of these civics do something plausible to cause the hang? I managed to pass the turn that hangs coming from a previous save and letting one of my cities get razed by Barbarians. Then it showed up on the log, but it doesn't shows up on my problematic turn-sequence.

Civics Change: Lady Xoc(Maya) from 'Monarchy' to 'Empire'
Civics Change: Lady Xoc(Maya) from 'Church' to 'Public Works'
Civics Change: Lady Xoc(Maya) from 'Chronicles' to 'Religious Censorship'
 

Attachments

Last edited:
Hi - I've wandered over from the Quick Modding Questions thread to try and help with the game freeze problems. I've debugged this savegame
Hi I have been experiencing similar crashes right around the Renaissance Era - Industrial Era switch. Save is attached.
and found out that, upon changing civics, the AI gets in an infinite loop of CvPlayer:: processCivics calling CvPlayer::changeSpecialistYieldPercentChanges, which calls CvGame::recalculateModifiers, which (via CvPlayer::recalculateModifiers) again calls processCivics as part of the recalculation. My conclusion is that the SpecialistYieldPercentChanges tag is broken and can't be used safely in any way. SpecialistExtraCommerces seems OK though (doesn't cause modifiers to be recalculated).

Various failed assertions came up as well; I've mostly ignored these, in part, because I know that @devolution has fixed some issues in the RoM/AND DLL already and just hasn't made them available yet. The worst thing I saw was an array access out of bounds in the "Movement Limits" code, resulting from a missing pPlot->getOwnerINLINE()!=NO_PLAYER check at the very end of CvUnits.cpp. Perhaps the Chronicles mod could just disable the Movement Limits component(?). And one thing that is probably easy to fix: An error popup during launch complained about CIVIC_PROLETARIAT in the LeaderHead XML file.

If you can't work around the problems in the DLL, then I could share a DLL with my tentative bugfixes for those two critical problems I encountered. I've used my own project setup though and I'm not sure about possible side-effects of that, and generally haven't really tested the DLL. (All this is assuming that the regular Chronicles of Mankind DLL is compiled from the latest RoM-AND DLL[edit] source code.)
 
Last edited:
Wow! Man you are awesome! :bowdown:
and found out that, upon changing civics, the AI gets in an infinite loop of CvPlayer:: processCivics calling CvPlayer::changeSpecialistYieldPercentChanges, which calls CvGame::recalculateModifiers, which (via CvPlayer::recalculateModifiers) again calls processCivics as part of the recalculation. My conclusion is that the SpecialistYieldPercentChanges tag is broken and can't be used safely in any way. SpecialistExtraCommerces seems OK though (doesn't cause modifiers to be recalculated).
Ah-ha! So it wasn't me breaking something afterall.
However it's still a bug I cannot fix but 45 can.
In the meanwhile I'll try to find a simple work around.

Movement limit: I don't want to disable it because I love it. Altough sometimes it is buggy it works most of the time and if not, than I just have to reload the save file, sometimes more than once. Annoying but not gamebreaking.

Proletariat civic: I fixed that in the patch IIRC... At least I don't get that error.

(All this is assuming that the regular Chronicles of Mankind DLL is compiled from the latest RoM-AND DLL[edit] source code.)
No. It IS the very same dll of AND2. Since I cannot work with it I don't tuch it, not to break anything.

Great thanks for your time and effort for trying to help. :worship:
 
Movement limit: I don't want to disable it because I love it. Altough sometimes it is buggy it works most of the time and if not, than I just have to reload the save file, sometimes more than once. Annoying but not gamebreaking.
OK – I see you're aware of the problem. :)
Proletariat civic: I fixed that in the patch IIRC... At least I don't get that error.
Ah, it's fixed through the Civics XML in the hotfix yes.
 
So finally here is an other Hotfix!
st%2Csmall%2C215x235-pad%2C210x230%2Cf8f8f8.u3.jpg

Great thanks for f1rpo for pointing to the real cause of the infinite loops. :hatsoff:

Here are the only changes:

Caste:
axed +1 commerce from specialists (again, to prevent a rare bug inherited from AND2)
+1 free specialist per city

I have tested it with one of jopin's save files and it worked. I don't have now the time and patience to test all the savefiles you guys have sent me but I ask everyone to test the save files he uploaded, just to make sure. THX!

Note though, that is is only a workaround and the original bug still lurks deep inside the dll... and possibly some others elsewhere. So if you face a new crash, loop, bug or whatever, please, post a save file.

Now that this one is done, I may have a chance to do some real modding because I am full of ideas I want to do.
But I also want to play my mod and still have health issues (:yuck:) so don't expect anything big any time soon.
 

Attachments

So finally here is an other Hotfix!
Note though, that is is only a workaround and the original bug still lurks deep inside the dll... and possibly some others elsewhere. So if you face a new crash, loop, bug or whatever, please, post a save file.

I've tested some stuff during the week after my previous post. It seems this bug would happen with other civics that provides the same bonus from specialists, like Theocracy. I used the same hotfix baseline (changing the yield to research I think) to continue playing. So, if anyone still have bugs during their play, this could be another scenario to consider. I had a feeling that would be the case, and @f1rpo response made clear what was happening. It was good to understand the interaction between files and settings, thanks!
 
I've tested some stuff during the week after my previous post. It seems this bug would happen with other civics that provides the same bonus from specialists, like Theocracy. I used the same hotfix baseline (changing the yield to research I think) to continue playing. So, if anyone still have bugs during their play, this could be another scenario to consider. I had a feeling that would be the case, and @f1rpo response made clear what was happening. It was good to understand the interaction between files and settings, thanks!
So what was it exactly you had to change?
Because I just did some tests and the remaining civics with SpecialistYieldPercentChanges tags (Theocracy, Nobility and Public Works) did not send the game into an infinite loop. I think because they are all affecting different specialists; Caste on the other hand changed most of them.
So for the moment I see no need for more fixing but maybe I miss something...
 
So what was it exactly you had to change?
Because I just did some tests and the remaining civics with SpecialistYieldPercentChanges tags (Theocracy, Nobility and Public Works) did not send the game into an infinite loop. I think because they are all affecting different specialists; Caste on the other hand changed most of them.
So for the moment I see no need for more fixing but maybe I miss something...
It being a coincidence is a possibility. I have the logs and save files from the turn, lemme check here and I'll edit post with both. Before, this happened just now.

Just got another kinda of infinite turn that solved on a strange way: i gave all my expendable technologies to a civ. It happened before, with another civ, that wanted 'Humanism' so they could change to Open Borders civic. I gave it away and the turn passed as usual. Now, this fresh log from the second happening.

From the log with infinite turn:
[150613.312] Player 1 (Vietnamese Republic) setTurnActive for turn 3138
[150613.312] Begin best tech evaluation...
[150613.312] Evaluate tech path value:
[150613.344] tech Mutual Assured Destruction : cost 1, value 7229
[150613.344] Evaluated tech path value leading to Mutual Assured Destruction as 722900
[150613.344] Player 1 (Vietnamese Republic) continues toward tech Mutual Assured Destruction , start tech NONE
[150613.766] Player 1 (Vietnamese Republic) suggests civic switch from Survival->Prosperity on initial pass (values 84 and 102)
[150614.188] Found near-future civic Liberal with value 471
[150614.234] Found near-future civic Mercantile with value 76
[150614.297] Found near-future civic Volunteer Army with value 691
[150614.375] Found near-future civic Interventionism with value 76
[150614.422] Found near-future civic Naval Supremacy with value 186
[150614.422] Found near-future civic M.A.D with value 194
[150614.422] Waiting for near future civics before switching
[150615.297] Begin best tech evaluation...
[150615.297] Evaluate tech path value:
[150615.297] tech Mutual Assured Destruction : cost 1, value 7229
[150615.297] Evaluated tech path value leading to Mutual Assured Destruction as 722900
[150615.297] Player 1 (Vietnamese Republic) continues toward tech Mutual Assured Destruction , start tech NONE

After reloading save and giving away all techs:
[151785.203] Player 1 (Vietnamese Republic) setTurnActive for turn 3138
[151785.203] Begin best tech evaluation...
[151785.203] Evaluate tech path value:
[151785.234] tech Mutual Assured Destruction : cost 1, value 6207
[151785.234] Evaluated tech path value leading to Mutual Assured Destruction as 620700
[151785.234] Player 1 (Vietnamese Republic) continues toward tech Mutual Assured Destruction , start tech NONE
[151785.625] Player 1 (Vietnamese Republic) suggests civic switch from Survival->Prosperity on initial pass (values 84 and 102)
[151785.844] Player 1 (Vietnamese Republic) prefers civic switch from Private->Church on pass 1 (values 157 and 154)
[151786.312] Found near-future civic Liberal with value 468
[151786.375] Found near-future civic Mercantile with value 76
[151786.438] Found near-future civic Volunteer Army with value 691
[151786.516] Found near-future civic Interventionism with value 76
[151786.562] Found near-future civic Naval Supremacy with value 186
[151786.578] Found near-future civic M.A.D with value 194
[151786.578] Waiting for near future civics before switching
[151786.578] Found near-future civic Liberal with value 468
[151786.578] Found near-future civic Mercantile with value 76
[151786.578] Found near-future civic Volunteer Army with value 691
[151786.578] Found near-future civic Interventionism with value 76
[151786.578] Found near-future civic Naval Supremacy with value 186
[151786.578] Found near-future civic M.A.D with value 194
[151786.578] Waiting for near future civics before switching
[151787.438] Begin best tech evaluation...
[151787.438] Evaluate tech path value:
[151787.438] tech Mutual Assured Destruction : cost 1, value 6207
[151787.438] Evaluated tech path value leading to Mutual Assured Destruction as 620700
[151787.438] Player 1 (Vietnamese Republic) continues toward tech Mutual Assured Destruction , start tech NONE

Could it be another track of infinite loops?

EDIT: I've posted two saves: 1) Loading AD-1897-October and passing turn causes the infinite passing turn; 2) Loading AD-1897-March and keep passing turns, the bug won't happen on turn 3138. But the Vietnamese civ would ask Political Philosophy some turns before the bug.
 

Attachments

Last edited:
It may be different. Please post that save file. Thx!
Edit'ed with the Techs hang saves. For the Theocracy hang on the passing turns, what caught my attention on the logs was this on BBAI_Team_3.log:

[17544.609] Player 3 (Iroquois Empire) setTurnActive for turn 1449
[17544.705] Player 3 (Iroquois Empire) suggests civic switch from Warlords->Theocracy on initial pass (values 170 and 233)
[17544.809] Player 3 (Iroquois Empire) suggests civic switch from Palace Economy->Coinage on initial pass (values -298 and -219)
[17545.352] Found near-future civic Intolerant with value 242
[17545.371] Estimated number of turns to justify 20 (threshold for switch, with 1499 turns since last revolution, at this game speed: 320)
[17545.371] Player Iroquois Empire switches from Warlords to Theocracy

The logging stopped at this file, so no more actions after this for the same civ or the next ones. What I tried to successfully pass the turn was modifying the CIVCivicInfos.xml, restoring the previous behavior of Theocracy.

<!--SpecialistYieldPercentChanges>
<SpecialistYieldPercentChange>
<SpecialistType>SPECIALIST_PRIEST</SpecialistType>
<SpecialistYieldPercents>
<iYieldPercent>0</iYieldPercent>
<iYieldPercent>0</iYieldPercent>
<iYieldPercent>50</iYieldPercent>
</SpecialistYieldPercents>
</SpecialistYieldPercentChange>
</SpecialistYieldPercentChanges-->
<SpecialistCommercePercentChanges>
<SpecialistCommercePercentChange>
<SpecialistType>SPECIALIST_PRIEST</SpecialistType>
<SpecialistCommercePercents>
<iCommercePercent>0</iCommercePercent>
<iCommercePercent>50</iCommercePercent>
<iCommercePercent>0</iCommercePercent>
<iCommercePercent>0</iCommercePercent>
</SpecialistCommercePercents>
</SpecialistCommercePercentChange>

I think these lines were on the file already, just commented the actual ones and restored the previous and it kinda worked. I am not sure if the cause of the bug is this one, or something latent and it just 'solved', further investigation would be useful.

The hang happens on the passing turn of AD-0476-Summer. Shared the AD-0472-Winter to provide more leverage for logging. With no further action, just passing turns, it should hang on the same turn, nonetheless.
 

Attachments

No, it has to be something on your end because I have managed to pass several turn by just forcing "End Turn" (SHFT+ENTER). See auto.rar
Than had another 30 or so turns on AI autoplay and switched from Warlords to Theocracy in 530 AD.
So I'm not finding the bug :scared:
 

Attachments

Questions to everyone playing CoM:

Do you still experience bugs? Infinite loops? MAFs?
What do you think about:

the new gathering mechanics? I think it is a nice mechanic for early game, as it gives a job for idle works that don't have improvements to do. I don't know if it is intended, but gathering destroys improvements, right? Happened once to me.
hunting? It gives a purpose to explore and hunt wild animals, as the buildings, like Poultry, and the specials wonders, or even hurry food and production, helps the early game when you need to develop one or two cities. And now there's a reason to build Hunters and Scout units!
balance? I like both mechanics above and I like to exploit their potential. It comes to a matter of experience and exploration, some experienced player will abuse some stuff more than a newcomer. Overall, I don't think there's much to say that some feature X is balanced, because it is relative and depends on too many variables.
AI performance? I think it's lackluster since the last time I played RoM:AND (maybe two years ago?). I don't know what changed, but automated workers stay idle to many times after a natural disaster (volcano, earthquake, hurricane). I won't say they chose the worst improvement to the plot, but what concerns me is that they aren't aware that the plot is empty and could be improved. There's a feature, I think it comes from BUG, that circles around the plots with colors: Red for plot being worked but no improvement, light blue for plot not being worked and no improvement, etc. So there's an algorithm implemented to notice empty plots. Relative to workers AI, I think this is what wonders me.

As City automation goes, I think it' decent but could be improved. The path I notice is the same as the old builds or even vanilla game: Culture > Food > Happiness, etc. Some choices I find odd, like Military buildings, but that's the cost of giving up the micromanaging.

For AI opponents behavior, I think they are good. They build an army before war, chose good flanks to attack, knows when to retreat and diplomacy is a good kind of annoyance. My concern would be related to the city governor and worker automation, that I think is related to the automations for the player. Sometimes AI has empty plots (and if I recall correctly, it happens since vanilla game...).

I think I found some odd behavior related to one of my previous post. It seems AI search for M.A.D tech, but can't find the previous tech that enables or leads it, as it research is enabled by a building. So it won't research any techs until it gets M.A.D, but will never happen. So suddenly AI stops researching techs. If anyone could help understanding it and provide more info I would appreciate.

Some new bug I found is related to the Poultry building. As I've read on the XML files, it seems Poultry is replaced by Cannery, then it is replaced by Food Processor Plant. By the Modern Era (or later, I don't remember), Poultry is available again to be built. When it's production is done, it is still available to be built. So an automated city that decides to build Poultry will keep building it forever. A workaround I did was disabling it's construction beyond Modern era. But I couldn't find what causes this behavior. Maybe something related to Ducks as a source of construction?

And finally, I have a nuisance with the Guilds buildings. After changing from Guilds civics, the Guilds buildings should be disabled and stay disabled. But for some reason, there is some turns a message appears on the log saying it enabled, and then a turn later it message says it's disabled. It happens with National Mint too, if I'm not mistaken. I didn't notice it being enabled, only messages being displayed.
 
Questions to everyone playing CoM:

Do you still experience bugs? Infinite loops? MAFs?
What do you think about:
  • the new gathering mechanics?
  • hunting?
  • balance?
  • AI performance?


I started game -loop
started second- loop
started third - loop

Getting little upset now.

Dont get me wrong most of mankind mods does this, but my first game of chronicles was success. i got till end game so i was happy to finally get working game, but again..

I have tried custom scenario, custom game, original map, chronicles map, Huge map, large map.. so its not about performance.
 
I started game -loop
started second- loop
started third - loop

Getting little upset now.

Dont get me wrong most of mankind mods does this, but my first game of chronicles was success. i got till end game so i was happy to finally get working game, but again..

I have tried custom scenario, custom game, original map, chronicles map, Huge map, large map.. so its not about performance.


An update:

i replaced hotfix xml over old. Loaded latest save and it gave couple errors and after that loop ended and i could continue the save game.
 
I think I found some odd behavior related to one of my previous post. It seems AI search for M.A.D tech, but can't find the previous tech that enables or leads it, as it research is enabled by a building. So it won't research any techs until it gets M.A.D, but will never happen. So suddenly AI stops researching techs. If anyone could help understanding it and provide more info I would appreciate.

Some new bug I found is related to the Poultry building. As I've read on the XML files, it seems Poultry is replaced by Cannery, then it is replaced by Food Processor Plant. By the Modern Era (or later, I don't remember), Poultry is available again to be built. When it's production is done, it is still available to be built. So an automated city that decides to build Poultry will keep building it forever. A workaround I did was disabling it's construction beyond Modern era. But I couldn't find what causes this behavior. Maybe something related to Ducks as a source of construction?

And finally, I have a nuisance with the Guilds buildings. After changing from Guilds civics, the Guilds buildings should be disabled and stay disabled. But for some reason, there is some turns a message appears on the log saying it enabled, and then a turn later it message says it's disabled. It happens with National Mint too, if I'm not mistaken. I didn't notice it being enabled, only messages being displayed.

Thx for feedback. I can fix MAD and Poultry.
Will check Guilds too.
An update:

i replaced hotfix xml over old. Loaded latest save and it gave couple errors and after that loop ended and i could continue the save game.
So the hotfix works, right?
Btw what kind of errors?
 
And finally, I have a nuisance with the Guilds buildings. After changing from Guilds civics, the Guilds buildings should be disabled and stay disabled. But for some reason, there is some turns a message appears on the log saying it enabled, and then a turn later it message says it's disabled. It happens with National Mint too, if I'm not mistaken. I didn't notice it being enabled, only messages being displayed
Could you please upload a save for that to investigate? A game set up with worldbuilder may or may not produce the same results.
Thx!
 
Could you please upload a save for that to investigate? A game set up with worldbuilder may or may not produce the same results.
Thx!
I think guild buildings have the same problem as Poultry. Namely, improper upgrade.
These are easy to fix. I want many upgradable buildings to obsolete again. The rule I will use is this:
  • if a building has at least 2 upgrades (an upgrade and an upg. of the upg.) than this building obsoletes with the same tech that enables the second upgrade
  • if a building has only 1 upgrade and it makes sense to obsolete it, than I will choose a tech that is at least one era later than the tech that enables the 2nd upgrade
  • if it is unreasonable to obsolete a building despite having upgrades (e.g. Village Hall line), than it is not obsoleting at any point
 
1.0.2.3 (Hotfix)


Buildings
=========

Poultry
obsoletes with Manufacturing

all Guild Halls
obsoletes with Manufacturing


Civics
======

Caste:
upkeep changed to medium (from none)



Techs
=====

fixing MAD breaking AI logic
 

Attachments

Back
Top Bottom