Saving games is very long now (v0.4.6)

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report. For problems building from source, post in Compile.
Post Reply
Message
Author
OurSavior
Space Krill
Posts: 4
Joined: Thu Sep 29, 2016 9:43 am

Saving games is very long now (v0.4.6)

#1 Post by OurSavior » Thu Sep 29, 2016 9:59 am

Hi all,

I'm using FreeOrion 0.4.6 build 2016-09-16.49f9123 MSVC 2013 on windows 7 64bits. While I'm here, many thanks for your great work guys.

Saving games takes a huge time now, compared to 0.4.5 . What I mean is that after confirming save and being back to the game, one might think that save file has been created on disk already but in reality in won't be before 10 to 15 more seconds. I checked that by opening the load game window just after saving a game and trying to find the name of my saved game. If I leave the game before this file has been created on disk, then it won't be created at all and I'll lose my saved game. This happened to me before I understood what the problem was. Some users could lose their last saved game every time they leave the game and never realize what went wrong and how to solve it by waiting 15 seconds before leaving...

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

Re: Saving games is very long now (v0.4.6)

#2 Post by Geoff the Medio » Thu Sep 29, 2016 10:05 am

In the Options "Other" tab, try turning on "Create Binary Save Files".

OurSavior
Space Krill
Posts: 4
Joined: Thu Sep 29, 2016 9:43 am

Re: Saving games is very long now (v0.4.6)

#3 Post by OurSavior » Thu Sep 29, 2016 10:22 am

Thanks, it worked, although I had to restart the game for the option to be in effect after selecting it. Now saved game file is created instantaneously on disk and I checked I could load it immediately after with no problem. I am still worried for other users who might encounter the problem if this is a default setting.

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

Re: Saving games is very long now (v0.4.6)

#4 Post by Geoff the Medio » Thu Sep 29, 2016 10:25 am

It's the default setting because the resulting files are smaller and portable across different operating systems. Saving as binary doesn't compress the data (which might be what's taking long for you... maybe post a log file of the server right after making a save that takes 15 seconds?), making the saves substantially larger on disk. Binary saves also may not load properly for someone who wants to debug your save on a different OS.

OurSavior
Space Krill
Posts: 4
Joined: Thu Sep 29, 2016 9:43 am

Re: Saving games is very long now (v0.4.6)

#5 Post by OurSavior » Thu Sep 29, 2016 10:57 am

I suppose freeoriond.log is the server log (posted). It says it took 10.3 seconds which is what I measured approximately myself this time.

By the way, I just tried to activate the "detailed log info" option by curiosity but it makes the game hang when I try to load a saved game, so I did not activate it finally.
Attachments
freeoriond.log
(35.76 KiB) Downloaded 53 times

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

Re: Saving games is very long now (v0.4.6)

#6 Post by Geoff the Medio » Thu Sep 29, 2016 12:36 pm

According to the log, it's spending most of the time saving just doing the serialization, or converting the gamestate info in memory into a format that can be written to disk.

OurSavior
Space Krill
Posts: 4
Joined: Thu Sep 29, 2016 9:43 am

Re: Saving games is very long now (v0.4.6)

#7 Post by OurSavior » Thu Sep 29, 2016 12:50 pm

I forgot to add that I think I have a rather fast computer. My case is probably not especially bad compared to the average.

rqn1234
Space Krill
Posts: 3
Joined: Fri Aug 28, 2015 4:43 pm

Re: Saving games is very long now (v0.4.6)

#8 Post by rqn1234 » Wed Apr 19, 2017 1:44 pm

I know this thread is a bit old but I am running into the same thing and gathered some data. Attached is the server log showing a game taking about 40 minutes to save. Once I followed the suggestion here to use the 'create binary save files' option that save time went down to under a minute for the same game at the same turn.

It is a pretty standard game. 150 stars, 14 computer opponents. I have a decent computer; Win 10 Pro 64-bit, AMD A8-3850 APU (quad core 2.9GHz), 16gb ram.

I initially had auto save on every turn and the game has always slowed down the further in I get processing turns, fairly normal. With 4.6 it seemed odd as usually right after loading a game it would process turns including that auto save quickly. When it would start to slow down a I tried saving the game, closing, restarting the game, and reloading. Once I did that it would be fast again for 5 to 10 turns. I was thinking maybe there was a memory leak somewhere in the end turn procedures but then I noticed it seemed to be hanging on the save game in the messages. I toggled the auto save to a 5 turn interval and noticed the delay only happened then on the turns with the auto save. That is when I came here and found this thread. Toggled the binary save option and am trying that this morning. First save literally took about a minute. I am going to play for a bit here and see how it goes.
Attachments
freeoriond.log
(196.16 KiB) Downloaded 33 times

User avatar
Oberlus
Small Juggernaut
Posts: 706
Joined: Mon Apr 10, 2017 4:25 pm

Re: Saving games is very long now (v0.4.6)

#9 Post by Oberlus » Wed Apr 19, 2017 2:49 pm

Hi,

That seems the same issue I had. It's been solved in FreeOrion 0.4.7 RC1 (Release Candidate, being tested). Download and install it, it won't delete your saved games and you can load them and continue playing. It's AI is also better, and you can try the new fighters (new ship parts: hangars and launchbays) that are cool.

rqn1234
Space Krill
Posts: 3
Joined: Fri Aug 28, 2015 4:43 pm

Re: Saving games is very long now (v0.4.6)

#10 Post by rqn1234 » Wed Apr 19, 2017 4:41 pm

Oberlus wrote:Hi,

That seems the same issue I had. It's been solved in FreeOrion 0.4.7 RC1 (Release Candidate, being tested). Download and install it, it won't delete your saved games and you can load them and continue playing. It's AI is also better, and you can try the new fighters (new ship parts: hangars and launchbays) that are cool.
It is definitely working better now that I have the binary save option on.

I've downloaded the 0.4.7 RC1 files and I'll get that set up here soon. You had me at better AI but fighters on top of that is just all kinds of fun to play with.

Post Reply