pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[Feature Request]: Auto save and load state

Open NineKain opened this issue 1 year ago • 8 comments

Description

Let me preface by saying that no one should rely on savestates and you should save to memcard and restart your game regularly.

The current way for auto-saving and auto-loading is with a prompt asking if you want to save, and if you want to load, that works great when using PCSX2 itself, but wrecks integration with frontends (like Playnite)

If you launch a game thru a frontend, or you make a shortcut to a game, it will never ask you to load a savestate by default, it will always boot without asking, for it to load that savestate you have to indicate it manually each time by setting a launch option (e.g. -statefile [statename]), doing this manually one by one is not only tiresome but unrealiable, as when the savestate is deleted or removed, the line should be removed manually one by one for all games.

I see two possible solutions to this problem:

The better one, which is to auto save or auto load the savestate based on CRC or ID (SLUS, SCUS whatever) automatically, one could even opt in or out of this new way of loading, this would solve all frontend or shortcut savestates problems automatically, and it shouldnt be that bad to implement since GameDB exists with almost all CRC's/ID's on the PS2

The worse but still good one, make a new command line argument, called -autostate or something similar, which would load the latest save state made for that game, be it manual, automatic when exiting or whatever, this wouldnt be that optimal but I guess it would be even easier to implement.

Please take this into consideration, I'd love to see it realized.

Reason

It would make integrations with frontends and desktop shortcuts much easier, and I guess people using Steam Deck would love it too

Examples

RetroArch has this for almost all cores, PPSSPP has something similar, it somewhat common.

NineKain avatar Dec 08 '24 12:12 NineKain

this is a bad idea , because poeple shouldn't be relying on savestates

Mrlinkwii avatar Dec 17 '24 16:12 Mrlinkwii

this is a bad idea , because poeple shouldn't be relying on savestates

Read the first line again please

NineKain avatar Dec 17 '24 17:12 NineKain

I'd be interested in tracking the last memory card write event in savestates. If it gets too far, loading the savestate presents an OSD warning?

F0bes avatar Dec 17 '24 18:12 F0bes

Sorry, misclicked.

F0bes avatar Dec 17 '24 18:12 F0bes

This could be considered if we decide to proceed with #12101

F0bes avatar Dec 17 '24 20:12 F0bes

Thank you.

NineKain avatar Dec 17 '24 20:12 NineKain

I agree, to the point I'd prefer autosave/autoload to be the default if you opt into the "Restore State on Load" option. In other words, the prompt when starting and closing the game could be removed. It's the thing you want to do 99% of the time after all when you enable this option 🙂

For the remaining 1% where you don't want to restore state on load, you could right-click the game in the menu and choose to boot it while discarding the save state.

I believe this is the approach used in PPSSPP, which makes it more of a "fire and forget" option.

Calinou avatar Dec 20 '24 01:12 Calinou

That is definitely not happening. That would mean our defaults would be emulating a console that never ever turns off. There are games that can not handle this, hence the nagging introduced with https://github.com/PCSX2/pcsx2/pull/12101. Save states are best used for debugging or cheating your way through a hard level where you can't save to your memory card.

F0bes avatar Dec 20 '24 01:12 F0bes