Autosave and shutdown

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

Locutus73
Captain Atari
Captain Atari
Posts: 485
Joined: Wed Feb 07, 2018 6:13 pm

Autosave and shutdown

Postby Locutus73 » Fri Jan 11, 2019 11:21 am

Hi @Sorgelig. Yesterday I was thinking about two distinct usability topics and it came to my mind that they could fit together in a nice solution.

GUI Shutdown menu option: I know this is a false issue, but a recurrent question by users (very common in Discord chats) is how do I shutdown/poweroff MiSTer? Each and every time I explain that Linux filesystem in mounted RO if not accessed by SSH/FTP, that MiSTer runs an /etc/resync script which syncs the filesystem each 5 seconds, that it’s safe to go back to the main menu, wait 6 seconds and turn power off, but… regardless users keep asking, they don’t understand and don’t feel safe. So, adding a “technically useless” shutdown option (maybe in the core reset menu) which first syncs the filesystem, then displays something like “Now it is safe to turn off MiSTer” and finally launches an “halt now” command would bring several benefits: it reassures the users, it makes supporting-people life easier with no more “how do I shut down MiSTer” questions and it would be a “Trojan horse” for the next feature.

Recently @kitrinx/Rysha introduced a nice autoload/autosave feature to the GameBoy core: each time you load a game, the gamesave is loaded, each time the GUI is opened, the gamesave is saved. This is very nice for gaming console endusers which find saving a gamesave a counterintuitive
experience: I know, it’s logical and all, but that’s it: console users save the game with an ingame menu and they expect to do just that. Now my idea is: let’s make this autoload/autosave the default behaviour (maybe the only behaviour or something global in MiSTer.ini), remove (or hide if implementing the global MiSTer.ini option) the "Load Backup RAM" and "Save Backup RAM" menu options and add an autosave triggered by keyboard reset combos… this way the user experience would be:
- They start a game and the gamesave/backupRAM is autoloaded
- If they change game they launch the OSD and the gamesave is autosaved
- If they change core they launch the OSD and the gamesave is autosaved
- If they reset MiSTer with the OSD, the gamesave is autosaved
- If they reset with a keyboard combo the gamesave is autosaved
- If they want to shutdown MiSTer, they’ll use the new shutdown menu so they will launch the OSD and the gamesave is autosaved
Essentially users would get a seamless console experience and wouldn’t be confused anymore (at least for gamesaves).
I understand that this could create many gamesaves when randomly testing games, but this could be alleviated both using a smart save mechanism (save only if the game has an actual backup RAM and if the content has changed from the last load/save) and having a distinct and consolidated directory for gamesaves, i.e. /media/fat/saves/SNES/Super Mario World (USA).sav which would consolidate the clutter.

Many thanks in advance.
Regards.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Autosave and shutdown

Postby Sorgelig » Fri Jan 11, 2019 1:15 pm

For those who keeps asking you can make shutdown placebo-script :)

Adding this option as standard will give false assumption MiSTer requires a special procedure to shutdown which is untrue. So, i don't want to make a useless option giving negative points.

JamesF
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 146
Joined: Sat Dec 15, 2018 6:46 am

Re: Autosave and shutdown

Postby JamesF » Fri Jan 11, 2019 1:19 pm

Big +1 for the seamless autosaving, and separate Saves directory for each console outside the Rom directory.

jft
Atari nerd
Atari nerd
Posts: 46
Joined: Sun Oct 28, 2018 12:07 pm

Re: Autosave and shutdown

Postby jft » Fri Jan 11, 2019 2:10 pm

Sorgelig wrote:Adding this option as standard will give false assumption MiSTer requires a special procedure to shutdown which is untrue.


You are absolutely correct - it is strictly a user experience thing over any actual technical need. But I think there are products that exist in which the designers had to take a similar approach, in order for a user to wrap their head around. For that I have to agree with Locutus on this topic.

User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 166
Joined: Wed Sep 26, 2018 6:03 am

Re: Autosave and shutdown

Postby kitrinx » Fri Jan 11, 2019 2:43 pm

I'm obviously a proponent of making the game saving user experience as seamless as possible. Losing saves is a bad feeling, and I'd like to do what I can to minimize that and get MiSTer feeling a little bit more like emulators, everdrives, and real games in terms of saving. Of course on MiSTer there are some technical limitation to work around so that there's no accidental corruption and etc, which is why it's a little tricky to get right.

As I play with the changes I made to Gameboy with OSD saving more and more, I find that it's a pretty good compromise. It seems like selecting "Save game" from the menu wouldn't be much different, but in practice it's a lot more handy to just flip open the OSD real fast and feel good that my game is recorded without worrying about accidentally hitting Load and etc. While not quite as perfect as just always having the peace of mind that the game is recorded, it's pretty close to that experience as long as you get in the habit of opening the menu before you turn off MiSTer. I'm not a fan of the fake placebo shutdown button though. Educating people of the actual behavior and making this behavior consistent between cores is better than tricking them into doing useless actions.

Regarding the save game directory vs saves besides ROMs: I'm not strongly in favor of either method, and I've seen both done in the past, though the isolated save directory seems to have become the more favored over the years. I think ROM name collisions are very rare, and not a real concern, which leaves the only significant difference to be data management. If one wants to backup their saves or migrate to a new set of ROMs, having them in a separate folder makes this significantly easier to do. Given that many users use "pack" style ROM sets which get updated periodically, this could make their lives much easier.

Locutus73
Captain Atari
Captain Atari
Posts: 485
Joined: Wed Feb 07, 2018 6:13 pm

Re: Autosave and shutdown

Postby Locutus73 » Fri Jan 11, 2019 2:54 pm

Sorgelig wrote:For those who keeps asking you can make shutdown placebo-script :)

Adding this option as standard will give false assumption MiSTer requires a special procedure to shutdown which is untrue. So, i don't want to make a useless option giving negative points.


To tell you the truth I do have a shutdown.sh script In my personal MiSTer setup, because it’s connected to a Sonoff S20 domotic socket with open source Sonoff-Tasmota firmware and the script first syncs the filesystem and then actually powers off the DE10-Nano.
Anyway, my point is that I don't care about the shutdown aspect, that wasn't the gist of my post: I really believe that the OSD (and reset keycombo) triggered autosave and the central /media/fat/saves directory would lead to a great user experience, it’s something I’d really love to have in MiSTer… the only requirement is finding a way to make users open the OSD and IMHO it should be something which doesn’t require an explanation, something in the user interface/experience which make users do that naturally.
If you think a “placebo” shutdown.sh is useful for that and then you’ll consider the autosave and /media/fat/saves, I’ll prepare the placebo immediately :lol: and, btw, saying “Now it is safe to turn off MiSTer” wouldn't be a lie, it would be safe not for the sync aspect, but because the game has been saved :wink:


Regards.

Locutus73
Last edited by Locutus73 on Fri Jan 11, 2019 3:25 pm, edited 5 times in total.

Locutus73
Captain Atari
Captain Atari
Posts: 485
Joined: Wed Feb 07, 2018 6:13 pm

Re: Autosave and shutdown

Postby Locutus73 » Fri Jan 11, 2019 3:01 pm

kitrinx wrote:I think ROM name collisions are very rare, and not a real concern

Name collision is rare and, somehow, it would lead to an useful behaviour... we can have Super Mario World (USA).sfc repeated in different locations many times, but in the end, it's always the same USA SMW rom. IMHO it makes sense to share the same /media/fat/saves/SNES/Super Mario World (USA).sav... you save a game started in a /media/fat/SNES/1 US - S directory, then another day you choose the same game from /media/fat/SNES/4 Game Series Collections/Developer/Nintendo and you can continue from the same gamesave. To me it seems more a feature than a bug :D
Patched ROMs probably will have different names anyway, just like /media/fat/4 Translations/Non-English/Italian/Super Mario World (U) [T+Ita.095].smc
A different solution could be appending a CRC32 of the ROM to the name, i.e. /media/fat/saves/SNES/Super Mario World (USA).B19ED489.sav, but, honestly, IMHO it's an exaggerated solution and sharing the same Super Mario World (USA).sav for all Super Mario World (USA).sfc is ok.

Regards.

Locutus73
Last edited by Locutus73 on Fri Jan 11, 2019 5:48 pm, edited 1 time in total.

Locutus73
Captain Atari
Captain Atari
Posts: 485
Joined: Wed Feb 07, 2018 6:13 pm

Re: Autosave and shutdown

Postby Locutus73 » Fri Jan 11, 2019 3:24 pm

Another sensible not lying approach could be a short overlay (similar to the one we see with the resolution and timings) each time a game is started with something like “Remember to open the OSD to save your game progress”, or even better, something like:
“Super Mario World (USA).sav loaded.
Remember to open the OSD to save your game progress.”

Regards.

Locutus73

User avatar
Newsdee
Atari God
Atari God
Posts: 1461
Joined: Fri Sep 19, 2014 8:40 am

Re: Autosave and shutdown

Postby Newsdee » Fri Jan 11, 2019 4:59 pm

It will simply take one lost save to never forget to backup progress... :lol:

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Autosave and shutdown

Postby Sorgelig » Fri Jan 11, 2019 8:00 pm

1) I will make separate folder for saves.
2) Most cores don't know if specific game really has backup memory as there is no definitive signs of it. So, for example you can see load/save backup options in Genesis or NES, but it doesn't mean game really has it! More over some games may use this range of addresses for something else triggering the fake save. That's why to use the save or not is at user discretion.

Autosave is god but should be disable by default. It may be useful when you start to play some game where you really want to saves. But not exactly you want to do this for every game.
With this option, you can enable autosave and save the settings in case if you want tit enabled always and by default.

User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 166
Joined: Wed Sep 26, 2018 6:03 am

Re: Autosave and shutdown

Postby kitrinx » Fri Jan 11, 2019 9:53 pm

Sorgelig wrote:2) Most cores don't know if specific game really has backup memory as there is no definitive signs of it.


NES has a "battery" flag in the iNES header, genesis has Backup RAM ID to indicate it, TG16's save ram is only used for save games, as it's a special ram inside the system, SNES has SRAM indicated in the ROM type, I am not sure of SMS. Gameboy also has battery as part of ROM type.

slingshot
Atari God
Atari God
Posts: 1128
Joined: Mon Aug 06, 2018 3:05 pm

Re: Autosave and shutdown

Postby slingshot » Fri Jan 11, 2019 10:16 pm

kitrinx wrote:
Sorgelig wrote:2) Most cores don't know if specific game really has backup memory as there is no definitive signs of it.


NES has a "battery" flag in the iNES header, genesis has Backup RAM ID to indicate it, TG16's save ram is only used for save games, as it's a special ram inside the system, SNES has SRAM indicated in the ROM type, I am not sure of SMS. Gameboy also has battery as part of ROM type.


The Genesis headers for RAM are mostly useless.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Autosave and shutdown

Postby Sorgelig » Fri Jan 11, 2019 10:29 pm

kitrinx wrote:
Sorgelig wrote:2) Most cores don't know if specific game really has backup memory as there is no definitive signs of it.


NES has a "battery" flag in the iNES header, genesis has Backup RAM ID to indicate it, TG16's save ram is only used for save games, as it's a special ram inside the system, SNES has SRAM indicated in the ROM type, I am not sure of SMS. Gameboy also has battery as part of ROM type.


I didn't check Gameboy. SNES - yes, it relay on the flag. Other consoles aren't relay on headers as they are useless. Especially Genesis header is useless.

Locutus73
Captain Atari
Captain Atari
Posts: 485
Joined: Wed Feb 07, 2018 6:13 pm

Re: Autosave and shutdown

Postby Locutus73 » Sat Jan 12, 2019 12:09 pm

Sorgelig wrote:I will make separate folder for saves.
Great man :cheers:

Sorgelig wrote:With this option, you can enable autosave and save the settings in case if you want tit enabled always and by default.
Options are always appreciated.

Thank you.
Regards.

Locutus73

Campus
Atarian
Atarian
Posts: 7
Joined: Mon Jan 21, 2019 1:46 am

Re: Autosave and shutdown

Postby Campus » Mon Jan 21, 2019 2:30 am

Great idea! Would it be possible to have multiple save slots for each game the way TempGBA does it for example. There you can even see a screenshot of the game state when saving. Would that be possible?


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 10 guests