Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Save State Archiving - Feature Request #1630

Closed
thorst opened this issue Aug 11, 2016 · 4 comments
Closed

Auto Save State Archiving - Feature Request #1630

thorst opened this issue Aug 11, 2016 · 4 comments

Comments

@thorst
Copy link

thorst commented Aug 11, 2016

I was lamenting how easy it is to overwrite your save states with a friend. We both looked at each other and immediately had the same idea. I did some google searches and there are a bevy of solutions involving cron nightly backups. For ease of use/implementation many suggest setting retroarch to centralize the save states directory. However, to me this isn't elegant as you can progress significantly in a days time.

Writing-
It would be nice to detect a state being written and then back it up immediately. I'm not sure if you can tie into the controller keypress or save state event. If not you would have to use a file system watcher (https://www.infoq.com/articles/inotify-linux-file-system-event-monitoring).

Files set-

  • You could use a ever increasing number that increments by 1. Ex. *.state0.0, *.state0.1, .... *.state0.3243
  • You could use epoch *.state0.1470913540
  • You could use a 0-9 suffix that would require each save to rename existing files. So at first it writes .0, then on next save it renames .0 to .1 and then it creates a new .0

Cleanup-
I would think you would default to 5 or 10. The chances of you by accident saving 5 times is a stretch I think. For the 3rd option above you wouldn't need to check how many files existed. That would be part of the steps in creating the files. For options 1 and 2 you would need to sort the names and then delete the oldest (top) one. In this way, epoch would be easier because it will sort better out of the box, due to being a portable string (think .0, .1, .10, .2).

Considerations-
Would need to look at the retroarch config to see where save state are being saved, to support default beside rom or centralized storage.

Restoring-
Here is where it would be great if retroarch supported this out of the box (maybe I should move my request over there?). I'm guessing we couldn't (wouldnt want to?) assign a special key to restore a miss-save. Chances are you would have to go to the console or share and delete you .state0 file and replace it with .state0.0. In this method epoch would be the least user friendly, though it could be tolerable.

Implementation-
Is this something that could be included in retropie by default or as a package. I am capable of writing this, but it would have to be in python as I am not nearly as strong with shell scripting. If you can capture the events it feels like it would be better to be part of the core package. If there isn't such a way and it needs to use a file system watcher then we may as well make it a package. In which case I could just write a python script and post a repo on github.

So I'm looking for a "Yes, write it yourself, there is no event" or a "No, there is an event, we can bake it in"

Thanks,

@joolswills
Copy link
Member

joolswills commented Aug 11, 2016

it sounds a bit over engineered to me, and not sure it is something we would want to include by default - feel free to make a third party script for users though. For ertroarch changes you would need to feed them back to the retroarch project as we don't maintain that.

@thorst
Copy link
Author

thorst commented Aug 11, 2016

I just asked over at retroarch. They have a "Undo Save State" feature. Is this exposed in retropie, if so how do I get to it? Is there a way to make this a shortcut on my controller?

@joolswills
Copy link
Member

I have no idea - you could ask on the retropie / retroarch forum - this is the PR libretro/RetroArch#3069

@dankcushions
Copy link
Member

you can use the undo save state stuff in retroarch in retropie if you update retroatch via source. it's in the quick menu in the RGUI. this issue section should not be used for support requests, though.

@thorst thorst closed this as completed Aug 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants