Hanging issue on AI's turn

Quibblesome

Warlord
Joined
Nov 8, 2009
Messages
231
Got the latest patch so im now on v12f (love the new interface btw).
Been playing a very interesting game as Miriam. However i'm stuck as the the game appears to hang on the AI's turn. The game is still "usable", I can still scroll around the map and click on things but the AI's turn never ends.

I can only assume that someone is stuck on an infinite loop somewhere. How would one debug this scenario? I'd attach a save but unfortunately i'm too thick to find the save games......
 
The latest patch is g.
When you save a game, I think you can see the folder where it's saved. First test if the problem persists with patch g. If it does, please attach a save - without one I can't do anything.
 
Ah yes, sorry it was 12g I was running. I attach the save:

My last few actions have mainly been revolving around spreading Edenism to both Lal and the University. I just convinced the University to switch to Edenism. My intention is to attack Lal once i'm finished with Deadrie.

I've also been at war with Deadrie for AGES.
 

Attachments

Well that part of the code is a rather complex mess. I don't have a clear understanding of it myself. Basically a unit checks what plot is the best one to move to, and in the process checks if it can move to that plot at all. Then when it has decided what plot to move to, it tries to actually move there and checks again if it can move there. The problem is sometimes certain variables are different in all those different checks. In this particular case a unit's AI thought it could move to a certain plot, tried to move there but then on a second different check noticed that it couldn't move there after all. So it went back to the AI code to see what's the best plot to move to. The result was the same, so it tried again to move to that same plot, but couldn't... etcetera. This led to an infinite loop. The cause was the restriction on capturing native life infested bases that I added.
 
Nice one on the debug, quick turn around. I got another for you though. Last game I played had Miriam with a base that was 31555 turns away from finishing its drone riots.

Its proximity to a signed 16 bit integer's max value (32767) is probably of note. Save attached.
 

Attachments

I'd need a save of just prior to the riot to know the cause of the riot. Nevertheless, I think I can guess the cause of this issue. Could drawing a SorenRandomNumber from a negative number result in this?

I'll release a patch with this small fix.
 
Just a heads up, I am experiencing the hang in between turns with my version 13k saved game. Basically it goes to "waiting for other factions", I can still scroll around the screen, but nothing happens even after 30 minutes or so.

I'm playing a Morganite faction, and am involved in a largish war with Miriam at the moment. Saved game file attached. Edit: attached recent auto-saves as well.
 

Attachments

Just a last quick follow-up, in case anyone is curious. I've had this happen in three different games now, and have narrow down the parameters. This invariably happens later in standard-sized maps, and always exactly two turns after I go to war with Miriam's Believers faction. Not sure why it's them in particular, but there it is.

I've fought larger battles, and later in games, against Yang, Lal, and the Spartans with various factions. It's always war with Miriam that causes the problem.
 
I seem to have missed your post on 12 July. Too late to investigate that save now. If this happens under patch l too, please attach another save.
 
I seem to have missed your post on 12 July. Too late to investigate that save now. If this happens under patch l too, please attach another save.

This might have been the same thing as with the Peacekeeper save I forwarded to you last week. IIRC I was at war with Miri too then.
 
I seem to have missed your post on 12 July. Too late to investigate that save now. If this happens under patch l too, please attach another save.

Will do, Maniac. Gives me a good excuse to fire up a new game and try out the l patch. :)
 
Back
Top Bottom