Add an auto-save feature
issueid=2490 11-21-2013 10:35 AM
Senior Member
Number of reported issues by Singbird: 9
Add an auto-save feature
In case of sudden power loss or system crash it would be very helpful to have an auto-save feature

Note: I found bug 1217 while looking for similar RFE's, but since this is not really a bug I decided to create a feature request since I don't know how ADOM team goes through these and whatnot.

So, having recently lost two characters to a system crash the matter of auto-saving of course popped to my mind. It would be nice if ADOM took periodical auto-saves. A win in ADOM typically takes quite a long time (6-12 hours maybe?) so it would be nice if all this used time was protected against sudden termination of the game.

I am playing The Last Remnant currently and this game auto-saves after each area transition. A similar auto-save feature would in my opinion work well for ADOM as well. You would never lose a lot of progress this way, except in some specific locations like greater vaults.

Of course there's the matter of easier save-scumming (got confused by Skeletal King on my ice bridge. Kill ADOM, restore auto-save, try again), but in my opinion protecting "honest" players is more important than avoiding making things easier for dishonest ones.
Issue Details
Issue Number 2490
Issue Type Feature
Project ADOM (Ancient Domains Of Mystery)
Category All
Status Implemented
Priority 6
Suggested Version ADOM 1.2.0 pre 20
Implemented Version ADOM r53
Milestone Initial Steam Release
Votes for this feature 15
Votes against this feature 0
Assigned Users (none)
Tags (none)




11-21-2013 11:03 AM
Ancient Member
The play time is quite the underestimate. I think my personal best is just under 13 hours and I've done a 24 hour long session before (on one char). In other words, there's a ton of investment, so I would like to see this feature.

11-21-2013 11:44 AM
Member
Back in the day, I lost a number of good characters due to forgetting that ADOM was open while doing work on a text-based roleplay site and having to do a shutdown, or a power outage. I took to saving pretty much every time I was about to tab out, just in case I should suddenly be caught for two or three hours doing something else. I would have *prayed* for this feature then. However, when the game is saved, typically the game gets closed. You reload your save, and the save is deleted when you reload.

How much programming would it take to have a save that would *only* be there when you quit without either dying or /quitting? Or are you suggesting that we have a save that would always be there to restore, even if you die/quit?

11-21-2013 12:52 PM
Senior Member
Quote Originally Posted by Kurasu
Or are you suggesting that we have a save that would always be there to restore, even if you die/quit?
Of course not. Ideally it would work something like this.

1. You start a new game, an auto-save is created.
2. You enter Terinyo, a backup of the auto-save is made, a new auto-save is created, and the backup is deleted.
3. You save the game, the normal save file is created and the auto-save is deleted.
4. You restore the game, a copy of your save is made the auto-save, the game is restored.
5. You die, the auto-save is deleted.

So basically there would some save, somewhere, at all times until you die or quit. No matter when your power goes out (loading a game, in the middle of the game, saving the game) you would not lose progress.

If an auto-save feature is too difficult, there should at least be a quick-save that would persist until you save properly, die or quit. Some way not to lose all your progress if your computer dies while you're playing.

Edit: Yes, the play time was quite an underestimate I think. It's probably closer to 20 hours than 10 hours for me.

11-21-2013 01:06 PM
Ancient Member
The ability to make automatic backups, or recreate a savegame from the temporary files after a power loss (a-la NetHack) would be most welcome, indeed. Sage already has an auto-save feature (think it runs every 1000 turns, and can also be manually triggered by pressing 'S' but saying no to the prompt), perhaps it could be ported from its code?

The SVG could be scrambled or encrypted if you're worried about savescumming, but only as a simple security measure, and I'm not even sure it's really necessary. Those who want to do it will usually save the game manually after specific points.

11-21-2013 01:37 PM
Ancient Member
You guys play too fast, my games are anything from 48 hours upwards and I feel like I'm rushing all the time. Maybe because I read all the messages and monster memories. :)

Who cares whether somebody else is save scumming anyway, it is only to his own detriment it doesn't affect you. Unless it is done for getting a global highscore I don't give two ...., but I will tell you that you suck if you do.

Maybe it can only be done on dektops though, laptops have batteries. Maybe it can auto_save on a laptop when the battery reaches 15% or so.

11-21-2013 02:34 PM
Ancient Member
My last win took something like 18 hours, distributed evenly over a three-day long weekend.

I think FLGs include the total (real-world) playing time now, which is pretty neat.

11-21-2013 03:11 PM
Senior Member
Sage's autosaver only works on 1.1.1 [we have a 1.2.0p18 saver that I haven't deployed because what's the point with p19 already out and p20 soon?], but I don't know if I'd recommend using its code .. I imagine the ADOM devs would have a much less hacky way of doing it.

That said, if you play on a server, you're protected from your own power outages.

That said, I'd like this in the game too.

11-23-2013 10:16 AM
Member
Yeah, my main concern about it was that I thought you were forgetting that, when you save in ADOM, you automatically quit the game, and your save is deleted when you *load* the game. Not when you *die* (unless it's been changed recently; I haven't had a crash where I had a saved game with the newest pre6). So this auto-save would have to be a complete reworking of the 'save' format. :) Even with the concerns, I still voted 'yes' on it, of course. As I said: I would have *prayed* for this feature, back when I had a power outage, a stupid moment of forgetfulness, or the ingot bug, destroy a hopeful character.

11-23-2013 11:07 AM
Senior Member
Well... In my opinion the days of deleting the save on load might as well be over with. We wouldn't even be suggesting these kind of features if the save was only deleted on quit or die. It's just some kind of a weird anti-cheat mechanism that honestly doesn't even do anything. You can just save, copy save, restore if you really want to scum.

11-23-2013 11:55 AM
Member
Older roguelikes such as Nethack are able to recover from a crash/power outage because they save all the temp data to the harddrive, ADOM keeps most of it in memory. They saved to the drive to cut down on memory usage as the machines of the day had maybe 2-4mb of it, the recovery was just an added bonus.

11-23-2013 12:10 PM
jt jt is offline
Administrator
Nowadays one probably already has backup files of the save games due to some backup mechanism of the operating system (TimeMachine on OSX, Windows Backup, etc.). And if you haven't you should think about using one. ;)

But I voted yes because having a backup save is always useful for debugging/reproducing problems in the game.

11-23-2013 01:00 PM
Ancient Member
But backing up saves is not the same functionality as autosave.

Right now, if you have been playing ADOM for five hours straight and the power goes down, you'll lose at the very least those five hours of play, no matter what backup solution you have, because the game doesn't generate any file that can be backed up.

The way to avoid that in the current versions is to manually save e.g. every hour and backup the save, but the game is clearly not designed with that in mind because it only allows you to save when quitting, effectively deincentivizing you from saving.

11-23-2013 01:05 PM
Ancient Member
An idea for an anti-savescumming mechanism that would not be worse than the current one (i.e. it would be cheatable, but no more cheatable than the current one) and would not require to delete savegames upon load:

- When you load a savegame, you keep track in RAM of where the savegame was.
- When you die, the savegame is deleted.

This means that if you don't die, but can't complete the game (due to e.g. a power outage) you can get another chance.

11-23-2013 01:44 PM
jt jt is offline
Administrator
Quote Originally Posted by Al-Khwarizmi
But backing up saves is not the same functionality as autosave.
I know, I just wanted to point out that if you live in an area with a lot of power outages, you probably already have some kind of backup mechanism for other important files.

I think it shouldn't be much of a technical problem to add this feature. Which one would you prefer, saving after 'x' steps or saving before changing the map?

11-23-2013 04:02 PM
Ancient Member
I'd prefer x steps, one sometimes stay on one level for hours. It is of utmost importance that this feature doesn't make it easier for people to cheat, although it is easy now it is not necessary to shove it in the player's face. A lot of games have in-game save options and auto-saves nowadays and people have become accustomed to just continue from somewhere before they died and some younger generations will think it is the same for ADoM and actually look to restore the game after it is actually over.

11-23-2013 04:41 PM
Ancient Member
Quote Originally Posted by jt
I think it shouldn't be much of a technical problem to add this feature. Which one would you prefer, saving after 'x' steps or saving before changing the map?
Considering save files are bigger than in 1.1.1 now and take longer to write to disk, I think saving every X turns would be appropriate.

11-23-2013 04:51 PM
Ancient Member
After what anon123 has said, I would like to be able to disable such a feature if it is going let me wait after every x turns to first save. I play on a laptop nowadays, so won't need it anyway.

11-23-2013 07:07 PM
Senior Member
Yes, every x steps is a lot better than on transition.

The saving in pre18 indeed takes longer than before, but I don't think it takes too long for every 1000-2000 turns for example. Still, even more convenient if it would somehow be possible to implement as a non-blocking operation.

11-26-2013 04:04 PM
Junior Member
An autosave, or a reliable save-on-crash is really needed in ADOM. Voted for.

12-23-2013 04:05 AM
Member
I just posted here and was informed that this RFE existed. And yes, yes, I want this so much! I've lost more than one character because I was too lazy to save, thought I knew where all the game crash bugs were, or (on one occasion) had my cat step on the power strip.

My suggestion is this:
1. Instead of deleting the save file on load, update it when the game is saved. Don't delete the old save file until the new version is safely stored.
2. Delete the file whenever the character dies, or if you quit (rather than save-and-quit).

There should always be a save file available. Only if the character dies, or if you deliberately quit, should the save file be erased.

A quicksave feature would also be nice. That way, you could save without actually exiting out of the game completely, making it easier to remember to save in the middle of a five-hour play session. But it's not really necessary.

I don't think I would want a dependable autosave-on-crash as a solution to this problem, because it wouldn't solve the problem of power outages--something that can't stop even the most bug-free program from terminating unexpectedly.

+ Reply