Currently Online

Latest Posts

Topic: Increasing longer autosave time

unbound
Avatar
Joined: 2016-10-08, 17:36
Posts: 6
Ranking
Pry about Widelands
Posted at: 2016-11-29, 22:03

Hi all,

I'm wondering why in bigger maps and longer autocrat mode saving games takes so freaking long.

I'm running widelands on a portable pc that just happends to heat up to much on intensive graphics applications (gaming, video and 3d editing), so I usually underclock it and stop all unneeded background services and applications keeping it over an external cooler base. The machine is an Intel core i7-2630QM CPU @ 2GHz with 6 GB ram and a Nvidia GeForce GT 540M, so even though slower, it works okish with most applications.

Yet the longer the game runs the longer it takes to save the game. If I let the default time interval to autosave (30min) and summon enough patience to keep playing, it gets to almost 30 minutes to save a game. Right arround that time, my attention span makes it increasingly difficult to detect time to play between autosaves (I know that kind of says more about my ridiculous obcessiveness than about the game).

My last autosave file (before the one I messed up shutting down the machine to visit the forum) is 2315KB as .wgf and 155MB uncompressed. I question why a 2D save game without undos would be that big, but that shouldn't take more than a few seconds to compress and write to disk. So I wonder, is this situation specific to my system, or does it happends to anyone else? May this be a bug, or is it more by design, I mean, like you are protecting us from playing longer games because you care about us and want us to have a life?


Regards,

unbound

Edited: 2016-11-29, 22:07

Top Quote
SirVer
Joined: 2009-02-19, 15:18
Posts: 1439
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2016-11-29, 22:45

Saving gets slower since our gamestate is not well designed: we have a lot of pointers between game objects that need specific work to be serialized. I think there is low hanging fruit in making the game faster to save and load, but nobody looked into this afaik - if you want to, it would be much appreciated.

Also nobody ever analyzed how .wgf files actually grow - what is taking so much space over time? That would be interesting too and there is probably also some stuff that could easily not be saved or saved differently to make this more compact and faster to reload.


Top Quote
unbound
Avatar
Joined: 2016-10-08, 17:36
Posts: 6
Ranking
Pry about Widelands
Posted at: 2016-11-29, 23:37

Hum...

So instead of waiting for loads and saves I should boot up the ubuntu to bypass mingw or cygwin64 troubles, relearn C++ (hum... C++ doesn't risk the machines memmory like C), study the games source and try to optimize saving routines. It's an idea. I'll try to speed up a few projects I've been over delaying. If I find time (meaning if I can convince myself to finhish good enough unperfect projects) I might do that face-smile.png

Thinkng about it.

Regards

unbound


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1621
Ranking
One Elder of Players
Posted at: 2016-11-30, 00:26

SirVer wrote:

Saving gets slower since our gamestate is not well designed: we have a lot of pointers between game objects that need specific work to be serialized. I think there is low hanging fruit in making the game faster to save and load, but nobody looked into this afaik - if you want to, it would be much appreciated.

Also nobody ever analyzed how .wgf files actually grow - what is taking so much space over time? That would be interesting too and there is probably also some stuff that could easily not be saved or saved differently to make this more compact and faster to reload.

I pointed out this problem over a year ago, after playing a 130 hours game that took 5-10 minutes just to load. people looked for it, and the issue has been improved. save/load time still goes up, but not as mmuch as it used to.I'm sure a skilled programmer willing to devote this issue enough time could do better, though.


Top Quote
unbound
Avatar
Joined: 2016-10-08, 17:36
Posts: 6
Ranking
Pry about Widelands
Posted at: 2016-11-30, 04:01

king_of_nowhere wrote:

"after playing a 130 hours game that took 5-10 minutes just to load. people looked for it, and the issue has been improved"

130 hours game time (if you play 10 hours at 10x normal speed counts as 100 hours) or 130 hours of play?

The game starts getting really slow (15 minutes to autosave) after about 8 hours of game play if I'm recalling it well, but I do speed up the game quite frequently. And it was always slow, but version 19 seams slower to me (it may be because I'm playing the bigger maps - dolomites, the nile and trident of fire - I used to play only maps with one ai oponent).


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3159
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-11-30, 08:17

Version 19 should be faster - it's the big maps that make it slower for you.

We have a very long list of fixes and improvements that we still want to add to the game, so if you had time to look into this issue, it would be brilliant face-smile.png


Busy indexing nil values

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1621
Ranking
One Elder of Players
Posted at: 2016-11-30, 17:25

unbound wrote: 130 hours game time (if you play 10 hours at 10x normal speed counts as 100 hours) or 130 hours of play?

The game starts getting really slow (15 minutes to autosave) after about 8 hours of game play if I'm recalling it well, but I do speed up the game quite frequently. And it was always slow, but version 19 seams slower to me (it may be because I'm playing the bigger maps - dolomites, the nile and trident of fire - I used to play only maps with one ai oponent).

130 hours of game time. i was doing a no metal challenge on trident of fire, i.e. i was making all the mines in the wrong places so they would only have a 5% chance of producing anything. I put a castle in the right place so that the ai could not attack me, and then i just waited until i had enough soldiers to kill. with the strong limitation on the mines, the AI was outproducing me, so I had to wait until it run out of resources, then I had to outproduce it, then i had to replenish all the losses from fighnting face-smile.png


Top Quote