Hangs When Saving Game with 5 or More AI Players

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
pdesrivieres
Space Krill
Posts: 7
Joined: Mon Jan 06, 2014 12:39 am

Hangs When Saving Game with 5 or More AI Players

#1 Post by pdesrivieres »

I installed the latest test build http://sourceforge.net/projects/freeori ... e/download and I find it hangs when I try to save on the first turn. I tried various galaxy setups with different seed values and # of star systems and the result is always the same. Finally I discovered I could save as long as I set the # of AI players to 4 or less. The problem is the same with the latest stable build http://sourceforge.net/projects/freeori ... e/download.

I am running the game on WinXP SP3 on a desktop nearly 10 years old!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Hangs When Saving Game with 5 or More AI Players

#2 Post by Geoff the Medio »

Can you attach freeorion.log and freeoriond.log from immediately after attempting to save such a game? I regularly save and load 6 AI games without problem...

pdesrivieres
Space Krill
Posts: 7
Joined: Mon Jan 06, 2014 12:39 am

Re: Hangs When Saving Game with 5 or More AI Players

#3 Post by pdesrivieres »

I tried the latest version, FreeOrion-6870-Test-Win32-Setup.exe, and reproduced the problem with the default settings. I have attached a zip file containing the log files.
Attachments
FreeOrion.zip
(143.44 KiB) Downloaded 64 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Hangs When Saving Game with 5 or More AI Players

#4 Post by Geoff the Medio »

How soon after starting the game are you trying to save? In particular, are you trying to save while the AIs are still playing their turns (green right arrows next to names in the Empires list)? If so, does it make a difference if you wait until they've finished playing their turns (switched to ... next to their names)?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Hangs When Saving Game with 5 or More AI Players

#5 Post by Dilvish »

I regularly save games with 10 AIs, and have occasionally saved them with 20. The AIs first turn has more going on, with various structures being initialized, and as Geoff notes, the server has to wait for them to respond with state-save information. Also, the delay might be due to your system being taxed by the server and human client also performing save related tasks at that time, in addition to but independent of the AIs.

As a further complication that could cause a corrupted save file (at least with multiplayer games, I'm not certain it works like this for single player games), even after the game starts responding again, don't rush to quit. The dialog behavior should probably be changed; I think the dialog drops once you select the filename and it sends the save command to the server (which starts a flurry of activity that might cause your system to hang for a bit). The dialog dropping, however, is not directly tied to the responses from the AI clients-- the server may still need to wait for responses from some of the AIs without this being apparent in the UI. I generally wait until the next turn stops before I quit, to be sure that the server's save process has been able to complete.

I don't think I'll have time myself to look at this anytime soon, but I'll bookmark it as an eventual reminder in case no one else gets to it.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

pdesrivieres
Space Krill
Posts: 7
Joined: Mon Jan 06, 2014 12:39 am

Re: Hangs When Saving Game with 5 or More AI Players

#6 Post by pdesrivieres »

If I get a chance this weekend I'll try and gather more information now that I know how to tell if the AI turn is still in progress. At the time when it hangs, CPU utilization is very low so no thread is in a busy loop.

I wonder if it is tied to the old OS, WinXP SP3, or the old hardware Pentium 4; this is a 10 year old system! I don't see this behavior on my new MacBook Pro running OS X 10.8.5.

p.s. I'm a developer with a Computer Science degree (class of 1989 at Carleton University) who works on multi-threaded backend systems written in C++ or Java, on Linux (CentOS).

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Hangs When Saving Game with 5 or More AI Players

#7 Post by Geoff the Medio »

The latest SVN should hopefully make problematic saving substantially more difficult, by forcing the player to wait for the AIs to finish their turns before allowing initiating a save.

pdesrivieres
Space Krill
Posts: 7
Joined: Mon Jan 06, 2014 12:39 am

Re: Hangs When Saving Game with 5 or More AI Players

#8 Post by pdesrivieres »

I installed and ran the latest build, FreeOrion-6931-Test-Win32-Setup.exe, and I wasn't able to reproduced the issue. :-)

Post Reply