Smarter autosaving (ie: Not in combat)

Post your ideas and suggestions how to improve the game.
Post Reply
chainedlupine
Inserter
Inserter
Posts: 48
Joined: Mon May 19, 2014 4:35 am
Contact:

Smarter autosaving (ie: Not in combat)

Post by chainedlupine » Fri May 23, 2014 6:48 pm

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.

FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by FishSandwich » Fri May 23, 2014 7:01 pm

OR, you could turn autosave off and just save manually before going into battles. Works wonders for me.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10467
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by ssilk » Sun May 25, 2014 2:19 pm

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.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Jürgen Erhard
Filter Inserter
Filter Inserter
Posts: 266
Joined: Sun Jun 12, 2016 11:29 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Jürgen Erhard » Sun Jan 22, 2017 9:48 am

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)

Xeanoa
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Apr 26, 2016 4:32 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Xeanoa » Sun Jan 22, 2017 3:19 pm

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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 9246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Rseding91 » Sun Jan 22, 2017 3:22 pm

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.
If you want to get ahold of me I'm almost always on Discord.

deepdriller
Fast Inserter
Fast Inserter
Posts: 179
Joined: Sat Apr 11, 2015 7:52 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by deepdriller » Sun Jan 22, 2017 4:21 pm

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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 9246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Rseding91 » Sun Jan 22, 2017 4:22 pm

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.
If you want to get ahold of me I'm almost always on Discord.

Piroko
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jan 06, 2016 7:06 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Piroko » Mon Jan 23, 2017 5:16 pm

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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 9246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Rseding91 » Mon Jan 23, 2017 5:24 pm

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.
If you want to get ahold of me I'm almost always on Discord.

Piroko
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Jan 06, 2016 7:06 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by Piroko » Mon Jan 23, 2017 6:22 pm

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.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10467
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Smarter autosaving (ie: Not in combat)

Post by ssilk » Fri Jan 27, 2017 12:00 pm

Added to viewtopic.php?f=80&t=21367 Game Save File ans -Speed Related Suggestions
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: No registered users