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

[New Feature] Load save states from command-line or playlist #13350

Closed
asciibeats opened this issue Dec 12, 2021 · 8 comments
Closed

[New Feature] Load save states from command-line or playlist #13350

asciibeats opened this issue Dec 12, 2021 · 8 comments

Comments

@asciibeats
Copy link
Contributor

asciibeats commented Dec 12, 2021

Apologies for posting here. I would like to discuss more on the Libretro forums, especially about what needs to be done to make the following work for everybody, but i just created an account there and i am not allowed yet. If somebody with magical powers reads this, i would appreciate if you gave me access. My username there is "Tilla".

I added a feature to be able to autoload save states via cli or playlist. I call them entry states. My motivation is to get quickly into a preset game when playing with friends. For example: It takes AT LEAST two and a half minutes to get a 4-player game of "Winter Games" for the C64 going. It loads slowly and you have to enter your names every time. With entry states i can prepare those games in advance and then get into them instantly. I have now created a few fun playlists that contain small single-player challenges like "get to the end of the level" having x lives, short duels (directly load into a penalty shootout of a soccer game), the aforementioned sports-game descipline selection and a lot more. For me it's a game changer ;)

From command-line:

$ retroarch -L <core> -e 42 <rom>

From playlist:

{
   "path": "<rom>",
   "entry_slot": 42,
   ...
   "core_path": "<core>",
   ...
} 

Entry states have to be located alongside your other save states and named like rom_name.state42.entry.

If you like to try it, clone my fork and compile the branch "entrystates":

$ git clone https://github.com/asciibeats/RetroArch.git
$ cd RetroArch
$ git checkout entrystates
$ ./configure
$ make -j4

Cheers!

@asciibeats
Copy link
Contributor Author

asciibeats commented Dec 12, 2021

I thought it was maybe too early and i might break stuff i don't know about. Any guidance is very much appreciated. Thanks for your work!

@sonninnos
Copy link
Collaborator

Cool. I have a similar thing planned in my TODO, but with state slots instead of paths.

@hizzlekizzle
Copy link
Contributor

Re: forum, you just have to read a few posts, but I went ahead and bumped you up to a regular user so you should be able to post now.

I don't think anyone's too worried about the old playlist format. We knew a breaking change would happen at some point.

I think a PR would be the best way to get some eyes on this, esp from jdgleaver, who isn't active on the forum.

@asciibeats
Copy link
Contributor Author

asciibeats commented Dec 13, 2021

Cool. I have a similar thing planned in my TODO, but with state slots instead of paths.

I could do that. Like <savestate_dir>/Vice 64/Winter Games.state42.entry. Fits right in. I like it!

@asciibeats
Copy link
Contributor Author

Re: forum, you just have to read a few posts, but I went ahead and bumped you up to a regular user so you should be able to post now.

I don't think anyone's too worried about the old playlist format. We knew a breaking change would happen at some point.

I think a PR would be the best way to get some eyes on this, esp from jdgleaver, who isn't active on the forum.

I did a PR. Thanks for the forum bump! Will open a thread and post here.

@sonninnos
Copy link
Collaborator

BTW load warping and also cartridge versions of Winter Games exist, so that loading times are not really an issue anymore. Autoloadwarp pretty much makes disk versions load almost like a cartridge when TDE is required.

But that is beside the point, since savestates are still important, and luckily in this case they should not affect hiscore savings either.

@asciibeats
Copy link
Contributor Author

BTW load warping and also cartridge versions of Winter Games exist, so that loading times are not really an issue anymore. Autoloadwarp pretty much makes disk versions load almost like a cartridge when TDE is required.

But that is beside the point, since savestates are still important, and luckily in this case they should not affect hiscore savings either.

I have autoloadwarping and tde enabled. Without tde my Winter Games does not run. Did not know there was a cartridge. Thanks for the tip!

BTW entry states are now working with slot indices. I updated my post above.

@asciibeats
Copy link
Contributor Author

The forum post is now live so i am closing this thread. The pull request is ongoing. Thank you for reading and again, for your work. Have a good one!

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