Page 1 of 1

Smarter autosaving (ie: Not in combat)

Posted: Fri May 23, 2014 6:48 pm
by chainedlupine
One thing that is somewhat annoying about Factorio is the autosave functionality and how it triggers like clockwork every X minutes. (Default is two, I believe.)

There is a definite pause as the game writes to disk, particularly on larger factories/levels. I actually don't mind this for the most part, but there is a point where it becomes a real problem and that is during combat.

First of all, it's annoying the game is trying to save at that moment. There's nothing like being chased by 50 large biters and have run out of ammo and your Mk2 shields and batteries are flatlined -- And then the game pauses as it autosaves, breaking my concentration, where kiting left and right is important and only a half-dozen pixels separate me from life and death.

Secondly, I don't want the game to be trying to save at that moment, anyway. I've had the game save just 0.3 seconds before I was about to die in a completely unavoidable situation (ie: being chased by homing worm shots), and that's pointless.

What I propose is the autosave system is changed slightly. Something like where if the player has taken damage (to either shield or health), then reset the autosave counter. That way, if the player is in a combat situation, then the game will be less likely to try saving at a point that will either be disruptive or useless.

You could do more elaborate analysis of the situation the player is in, and try to determine when he's "in-combat" versus "out-of-combat" (perhaps look at how close the player is to any enemy entities and whether the player or any nearby entities have taken damage within X time), but I think just resetting the autosave counter on player damage would be enough to stop the most annoying two issues I mentioned above.

Re: Smarter autosaving (ie: Not in combat)

Posted: Fri May 23, 2014 7:01 pm
by FishSandwich
OR, you could turn autosave off and just save manually before going into battles. Works wonders for me.

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun May 25, 2014 2:19 pm
by ssilk
With multiplayer this would be an hard issue, which forbids playing, so it can be assumed, that this will be fixed with introducing true multiplayer.

Autosave in battle

Posted: Thu Sep 22, 2016 11:06 am
by H_Sage
Please do another autosave system.
Autosave very annoying during the battle. Really need the type of test, like - "get damaged / damage caused during 10 seconds" and let autosave once again make this test as long as the character is safe.

Re: Autosave in battle

Posted: Thu Sep 22, 2016 12:32 pm
by orzelek
Yeah it's very annoying especially if you are doing some kind of drivebys with car or tank. You want to turn and autosave pops up and.. yeah :D

Re: Autosave in battle

Posted: Fri Sep 23, 2016 12:04 pm
by ssilk
Added to viewtopic.php?f=80&t=21367 Game Save File ans -Speed Related Suggestions

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun Jan 22, 2017 9:48 am
by Jürgen Erhard
To add to what the OP said (and I totally agree): it would probably be easiest if there was a simple option "Don't auto-save while moving". Would fix the "I'm kiting biters, don't break my flow!" too.

Yes, I AM THE NECROMANCER (Necromancer was my favority class in Diablo II :D)

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun Jan 22, 2017 3:19 pm
by Xeanoa
I would like to hear some technical explanation why the game needs to pause anyway. Just save in the background, maybe make use of the multiplayer catchingup feature if you have to?

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun Jan 22, 2017 3:22 pm
by Rseding91
Xeanoa wrote:I would like to hear some technical explanation why the game needs to pause anyway. Just save in the background, maybe make use of the multiplayer catchingup feature if you have to?
Because the simulation has to be stopped to copy out the data to be put in the save. If it wasn't then the map would corrupt every time it got half way through saving and something changed with the other half.

Just like how MP has to pause to save the map before someone can download it.

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun Jan 22, 2017 4:21 pm
by deepdriller
Is it possible to sort of dump the current state in an external saving module? SUre, that would probably spike the memory usage, but could get rid of the pause.

Re: Smarter autosaving (ie: Not in combat)

Posted: Sun Jan 22, 2017 4:22 pm
by Rseding91
deepdriller wrote:Is it possible to sort of dump the current state in an external saving module? SUre, that would probably spike the memory usage, but could get rid of the pause.
That's what saving is.

Re: Smarter autosaving (ie: Not in combat)

Posted: Mon Jan 23, 2017 5:16 pm
by Piroko
Rseding91 wrote:
Xeanoa wrote:I would like to hear some technical explanation why the game needs to pause anyway. Just save in the background, maybe make use of the multiplayer catchingup feature if you have to?
Because the simulation has to be stopped to copy out the data to be put in the save. If it wasn't then the map would corrupt every time it got half way through saving and something changed with the other half.

Just like how MP has to pause to save the map before someone can download it.
Wouldn't it be possible to do a copy of the game-state in local RAM and do the actual saving process from that copy in a background task while the game already continues?

Re: Smarter autosaving (ie: Not in combat)

Posted: Mon Jan 23, 2017 5:24 pm
by Rseding91
Piroko wrote:
Rseding91 wrote:
Xeanoa wrote:I would like to hear some technical explanation why the game needs to pause anyway. Just save in the background, maybe make use of the multiplayer catchingup feature if you have to?
Because the simulation has to be stopped to copy out the data to be put in the save. If it wasn't then the map would corrupt every time it got half way through saving and something changed with the other half.

Just like how MP has to pause to save the map before someone can download it.
Wouldn't it be possible to do a copy of the game-state in local RAM and do the actual saving process from that copy in a background task while the game already continues?
That's *what it is doing* when it saves.

It copies and saves at the same time using threads.

Re: Smarter autosaving (ie: Not in combat)

Posted: Mon Jan 23, 2017 6:22 pm
by Piroko
Alright, didn't think it would take that long to do a copy of the game-state within RAM but Factorio has grown quite a lot over the years as well.

Re: Smarter autosaving (ie: Not in combat)

Posted: Fri Jan 27, 2017 12:00 pm
by ssilk
Added to viewtopic.php?f=80&t=21367 Game Save File ans -Speed Related Suggestions

Re: Autosave in battle

Posted: Mon Jan 30, 2017 9:10 am
by neoc
Autosave in general should be postponed if the player is doing stuff at the moment, up to a configurable time span.

Not doing anything = not building, not shooting, not being attacked

Re: Autosave in battle

Posted: Tue Jan 31, 2017 1:34 pm
by ssilk
Autosave in general should not disturb the game-play at all. :)

Re: Autosave in battle

Posted: Wed Feb 01, 2017 5:07 pm
by Xeanoa
ssilk wrote:Autosave in general should not disturb the game-play at all. :)
What really bugs me about the pause is, that the game ignores clicks that happens during the pause. Usually, that means having to interrupt and fix the missing clicks. An example would be if you place inserters, and you miss one because it decided to pause and ignore your command to place one.

Re: Autosave in battle

Posted: Wed Feb 01, 2017 6:31 pm
by ssilk
When there is no pause this needs not to be fixed. That is the target (see linked thread) and I'm 70% sure the devs want to fix this, but not when or if ever. :)