Game freezing between turns, "Waiting for Other Civilizations" keeps flashing

I'm not sure what is causing this crash, but it keeps occurring around the new Enlightenment Era I've added in my mod, but right before the Industrial Era is reached.

Has anyone else seen a similar error?
Maybe an infinite loop somewhere in the code?
 
Maybe it's a loop in the Technologies requirements. Tech A requires B which requires A. It typically happens when the AI reaches the point where it can research either A or B or a Tech further and is stuck in the impossibility to choose the path.

PS/Edit: this kind of technology loop happened to me a long time ago but I honestly don't remember if it resulted in an infinite loop or if it crashed the game to desktop.
 
Thankyou guys for your help. I will check and see if its due to a tech loop of some kind and I'll let you know what happens.

If it turns out to be someone else, would either of you or anyone else who recalls ending a turn and it being stuck at "Waiting for Other Civilizations", be willing to let me know what caused it and a possible solution?

Update: I checked, none of the techs in question would cause a tech loop...so I'm not sure what it is...
 
Make sure that each Tech has a legitimate Advisor. It is important for AI decisions.
 
One way to at least check which civilization is causing the problem would be putting this code in onBeginPlayerTurn:
Code:
	Player = gc.getPlayer(iPlayer)
	name = Player.getCivilizationDescriptionKey() 
	CyInterface().addImmediateMessage('%s' %(name),'')
Might give you a pointer to where the problem lies.
 
In BtS, that would be CvEventManager.py.
 
This could also be caused by naval units, I believe, most likely Privateers or similar pirate units. Keep an eye on the thread Leoreth just made here, or have a look around in his modmod's subforum (Rise and Fall of Civilization: Dawn of Mankind), where people discussed it as well sometime ago. I believe they found that another mod had tried to fix this bug as well, but failed, or something like that. I don't quite remember, but it's a lead at any rate. However, if this is what causes your infinite turn, then I believe there is no official fix that prevents it from ever happening (you can sidestep it by reloading an older save and deleting the unit that is causing it, but...).
 
Units are the first culprits for infinite loops (not just naval units, path finding is often the cause, grouping/ungrouping another).

Here, it looked like Sword_Of_Geddon assumed it appeared after the creation of a new intermediate era. It could of course come from a unit that is only buildable as from this new era.

To trace which unit is problematic, I'm using a Python tool from Civjo. I got it here.
 
At one point somebody uploaded a savegame, which would freeze just like the one in this thread. With no clues whatsoever on what went wrong, I came up with the idea to profile the game. I compiled a profile DLL, started the game, made it run into the freeze issue and then attached very sleepy and waited a while. Eventually I stopped profiling and it told me where the CPU time went, which clearly showed that more or less everything was in a specific loop with a questionable stop condition. The game worked when the loop control code was rewritten. It turned out to be a very effective way to locate which loop the game is stuck in (assuming it is inside the DLL).

If you don't know how to even get started profiling, then read the makefile link in my signature.
 
So the loop could be a DLL problem? Does what is in your signature fix it? Forgive me, this part of the modding is very new to me.
There is an issue somewhere in the DLL or python where a loop never reaches the end condition. It might be triggered by "stupid" xml settings, such as a loop in tech requirements. Figuring out where it get stuck is a strong hint to why it goes wrong and it can presumably be fixed easily once the why has been figured out. The big problem now is that there is no real clue to where or why it gets stuck in a loop.

The makefile link provides an updated makefile, which can be used to compile a profiling DLL file. However first step would likely be to figure out how to even compile any DLL if you aren't doing that already. Sadly there aren't any great guides for that, though the modiki has one, which was good enough to get me started.
 
Back
Top Bottom