[SUG][EDITOR] "Autosave" type function

Started by namida, August 14, 2020, 08:48:35 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

How frequent should auto-saves be?

Every minute
3 (50%)
Every 2.5 minutes
0 (0%)
Every 5 minutes
3 (50%)
Every 10 minutes
0 (0%)
Longer
0 (0%)
I would disable them
0 (0%)

Total Members Voted: 6

Voting closed: August 31, 2020, 12:37:24 AM

namida

Prompted by a crash-during-save leading to a user losing a significant amount of work, I'm wondering if autosave should be implemented?

To be clear - this would NOT automatically invoke the "Save" function. That itself has far too much potential for damage, too. Instead, it would be more like, every so often, a copy of the level is saved to a seperate file - perhaps in an "Autosave" subfolder or something.

It would be possible to disable this feature, probably on both a "Disable permanently" and "Disable until I close the editor" basis.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

mantha16

+600000000000000000000 from me for obvious reasons lol

IchoTolot

A few extra autosave files would be a handy safety addition. :)

WillLem

Since Mantha has already cast 600 quintillion votes in favour of this, it hardly seems worth throwing my vote in as well. However, +1 for what it's worth :lemcat:

namida

Autosave functionality, in and of itself, is implemented in commit f1421b6.

In its current state, it saves a copy of the level every 60 seconds, and cannot be disabled. These will come later - most likely before any stable release (certainly, the next stable release will have an option to disable autosave, but it may not have an option to configure the autosave timing).
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

Continuing on, let's talk about how frequent a copy should be saved. Implementing the option to configure this will likely happen if there's a lot of disagreement over the frequency; whereas if people are mostly / wholly in agreement, it'll likely be a single fixed frequency. Again, I'll stress that an option to turn it off altogether will happen either way. I'll put a poll up for this.

The other question is whether old autosave files should be removed after some time, and if so, how long this should happen after. This could be either a timeframe ("clear any older than 24hrs") or a quantity (keep no more than 20 autosaves). Feel free to comment on this via posts for now, I'll possibly put up a poll later.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

WillLem

Quote from: namida on August 24, 2020, 12:36:36 AM
The other question is whether old autosave files should be removed after some time, and if so, how long

In what way will they be stored?

Dullstar

I'd suggest the following:

Time Interval: No greater than 1 minute, but no less than 10 minutes, assuming it isn't configurable. Maybe 5 minutes?
When to remove: Keep a fixed number of autosaves. When this number is exceeded the oldest is automatically deleted.
Other: Don't autosave if no changes have been made since the previous save/autosave.

Edge case with this set of suggestions: should the autosave timer be running constantly, or should it not start until the user makes a change to the level?

I think it would be preferable to have the time interval and how many to store configurable.

namida

Quote from: WillLem on August 24, 2020, 03:54:39 AM
Quote from: namida on August 24, 2020, 12:36:36 AM
The other question is whether old autosave files should be removed after some time, and if so, how long

In what way will they be stored?

In an "autosave" subfolder, with a filename consisting of the time at which they were saved + the level's title. These can be opened exactly the same way as any other level file.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

mantha16

looking at how many files are in the autosave folder already some kind of limit i think will be good like deleting the oldest once you hit that limit

namida

#10
Since this will be easier to do than I expected, I'm going to make all of this configurable. You will be able to configure how often autosaves are made (in whole minute increments), and how many autosaves are kept. Defaults will be "every 5 minutes" and "keep the last 15 autosaves" respectively.

So far I've added these options to the config menu / to loading and saving settings; but they don't actually do anything yet.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

#11
This feature is now fully implemented as of commit 5634026 and available to test in the V1.26-D experimental build.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)