TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Autosave function

Open darkhog opened this issue 8 years ago • 12 comments

I'd like to be able to set an autosave for your game to prevent loss of data due to power outage or simply forgeting to save before exiting. Just add this to the config:

autosave = x, where x is amount of minutes between each autosave (0 to turn it off) Also this:

autosaveonexit=true- will autosave when TIC closes.

The autosave would fail silently if game wasn't saved at least once (new file) or if it can't be saved for another reason (read-only file or loaded from the site)

darkhog avatar Jul 08 '17 20:07 darkhog

I don't like this idea. Often I don't save a game while experimenting with different ideas, and when I want to start over, I just reload the game.

Also, if you mess your code up and want to reload the cart, what happens when the system autosaves just before you reload the cart? You completely lose data.

trelemar avatar Jul 08 '17 20:07 trelemar

Then you'd just disable autosave by setting period to 0 and setting autosave on exit to false. Simplebas that.

darkhog avatar Jul 09 '17 08:07 darkhog

I feel like it'd just cause more frustration. If you forget to save, it's your fault. If TIC saves for you when you don't want, it's TIC's fault. Just remember to save progress.

There's not much that can be done about power outages, these things happen.

trelemar avatar Jul 09 '17 11:07 trelemar

Well, it should be an option, just like autosave in Word is.

darkhog avatar Jul 09 '17 11:07 darkhog

I'm not a big fun of autosave functionality too, but I understand someone could like it. Maybe have a .bkp file saved in the same folder of the original one. Most of all I'd like to have some prompt for saving on exit. That happened a few times... lots of imprecations :)

HomineLudens avatar Jul 09 '17 11:07 HomineLudens

If TIC-80 stored a backup of the file at a set interval, without overriding the actual cart, I'm all for that. It could be stored in backup folder in tics appdata as the cart name + current os time or something similar. That I wouldn't mind. Just don't auto override the actual cart.

trelemar avatar Jul 09 '17 14:07 trelemar

Then it wouldn't be an autoSAVE now, would it? Again, having option to enable autosave doesn't mean you have to use it. Just like you don't have to be a redstone expert to play Minecraft.

darkhog avatar Jul 09 '17 17:07 darkhog

i'd like some autosave feature too. Possibly a backup save. Like, every tot minutes save a file like "autosave.tic" in some folder, so if your pc hangs for any reason, you never lose more than a tot minutes of work (which is incidently what just happened to me, lost 2 hours of work)

msx80 avatar May 23 '18 11:05 msx80

Since kids are really not used to manual saving anymore ( i know, learning opportunity... ) I think keeping an autosave.tic in a backup folder would be a big boon to Tic80

tobi avatar Aug 14 '20 16:08 tobi

Lets autosave in a backup.

nesbox avatar Oct 28 '20 14:10 nesbox

You could implement that the game is saved with checkpoints within the game (when entering a new screen or level, or a certain point of the game), that counts as an autosave, only that would be your responsibility to place those checkpoints.

Kyuchumimo avatar Jul 13 '21 04:07 Kyuchumimo

You can implement in-game autosave by calling pmem() every time interval. (It's not perfect, because the user stores it as an integer.) However, if the program itself requires the concept of a backup file, the program's autosave feature is great.

skz1024 avatar Aug 09 '21 09:08 skz1024