Homepage Forums RetroPie Project Everything else related to the RetroPie Project How to save games in RetroPie / RetroArch

Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #82025
    Floob
    Member

    I’ve just been playing with the save game option in RetroPie / RetroArch and this is what I have so far.

    There are 2 methods of saving games. One is using the “in game” save files, in the same way as you would if you were using the original hardware.
    The second method is to take a “snapshot” using the emulator itself, in this case RetroArch.

    I have found that when playing the games (that are emulated by RetroArch), when you make an “in game” save, i.e. in Zelda on the SNES, the *.srm file will automatically save correctly in the rom folder. The folder can be specified, but the rom folder is default. This will only work correctly if the permissions are fine, which they are by defaut (the pi user must be able to write files in the relevant rom folder).

    This means the next time you run the game, it will happily load the *.srm file and allow you to access your “in game” saves as normal.

    In addition to the game saving the *.srm file, you can set it to keep saving this every x seconds using the retroarch.cfg file and this line:
    autosave_interval =

    Whilst that wont make any difference to where the save happens in the game, it just ensures that it is regularly saved to the SD card – although I’m not sure it has a lot of value as I’m not using it and its working fine (although this may in part be due to me always making sure I exit the emulator cleanly, going back to Emulation Station).

    As I mention, the *.srm save works fine out the box for me, no config changes needed.
    You can verify by searching for *.srm files on the SD card.

    The second method of saving games is using “Save States”, the game itself doesnt have any concept of this, but the emulator (RetroArch) can use them.

    This is very useful for games that dont have a built in save facility, as it allows you to store the position you were in when you stop playing. This is again controlled in the retroarch.cfg file

    Here are the settings to auto save and/or auto load snapshots.

    # Automatically saves a savestate at the end of RetroArch lifetime.
    # The path is $SRAM_PATH.auto.
    # RetroArch will automatically load any savestate with this path on startup if 
    savestate_auto_load is set.
    # savestate_auto_save = false
    # savestate_auto_load = true

    You can save and load these with the keyboard using the settings

    # Saves state.
    # input_save_state = f2
    # Loads state.
    # input_load_state = f4

    or map them to your joypad (in the controller config) using hotkeys: for example
    input_enable_hotkey_btn = 8
    input_save_state_btn = 5
    input_load_state_btn = 4

    If anyone is interested I could put a video together showing how this works.

    #82310
    Floob
    Member

    Video showing the internal / standard save feature:

    #82311
    Floob
    Member

    Video showing save states in RetroPie / RetroArch:

    #82319
    darknighte9
    Participant

    Forgive me for my noobiness but how do you write permissions? I’m trying to get .srm files to be created automatically for Earthbound (am using Retropie and Emulationstation), but so far I have not had any luck… :s

    #82321
    Floob
    Member

    I just gave that a go and it seems to work fine – I created a game file as you do when starting for the first time, then when the game started I cleanly exited back to EmulationStation and the .srm appeared in the rom folder.

    How are you exiting the game?

    If its a permission issue check that your permissions allow user “pi” to write to the snes rom directory (unless you are saving your .srm files somewhere else)
    See the attached pic.

    If you need to update permissions, its probably easiest using a tool like Filezilla.
    https://my.rochen.com/portal/index.php?m=knowledgebase&c=view&id=47

    #82331
    darknighte9
    Participant

    Alright I’m guessing my issue is more with how I am exiting my game then actual permissions. I guess my next question would be how are you exiting back to EmulationStation? I use a SNES Buffalo USB Gamepad controller that I setup using the RetroArch setup and start+select does not work for me as it does for others.

    #82344
    Floob
    Member

    Can you post your controller config here as a txt file?

    Or have you tried exiting the game using the Escape key, as that should do it as well.

    #82365
    darknighte9
    Participant

    Well in my file for my controller I have these lines here

    input_device = “USB,2-axis 8-button gamepad ”
    input_driver = “udev”
    input_b_btn = “1”
    input_y_btn = “3”
    input_select_btn = “6”
    input_start_btn = “7”
    input_up_axis = “-1”
    input_down_axis = “+1”
    input_left_axis = “-0”
    input_right_axis = “+0”
    input_a_btn = “0”
    input_x_btn = “2”
    input_l_btn = “4”
    input_r_btn = “5”

    #82366
    darknighte9
    Participant

    If I added input_exit_emulator_btn =
    to this file would I be able to list both start and select buttons 6 and 7 as exit buttons? I can use escape on my keyboard to exit emulation station but my ultimate goal for my RetroPie is to be able to primarily use the controller once I have everything completely set up for the most part.

    #82370
    Floob
    Member

    Thats its – check from 5 mins in on this video, just add the two lines into your controller file.
    You would use “6” and “7” from your example.

    #82372
    darknighte9
    Participant

    Alright so I added the lines

    input_enable_hotkey_btn = “7”
    input_exit_emulator_btn = “6”

    to my controller file, and upon reboot I was able to use start+select to exit back into EmulationStation. I’m going to go start a new file in Earthbound and save in game and see if a .srm is created after exiting cleanly.

    #82378
    darknighte9
    Participant

    So I made a save in-game, exited cleanly back to ES, reloaded my game and had a save waiting for me and .srm file saved to my ROMS folder. Thanks for all the help floob!

    #93168
    elgur85
    Participant

    Hello there!

    Is it possible to save “states” by only using one button?
    And another for loading states?

    #93193
    Floob
    Member

    Yes, but you wouldnt want to use the button for another function, so you need an unused one really.
    Then you just keep hotkeys enabled (so no need for an enable_hotkey button):

    #93213
    Anonymous
    Inactive

    Alright, I have a different type of question regarding saves. When i exit a game it records the new play count. But if I then just shut down the system or restart it my play count isnt saved. The only way for it to save is to completely exit emulationstation, then preform a shut down from the raspberry’s command line.

    Any idea how to change this?

    #104759
    robertus
    Participant

    sorry i don’t understand how to save game with my ps3 controller

    i see that select + L1 save state, is right?

    then how can i load it?

    and i can save only a state? no more then 1?

    sorry for the noob

    #104775
    Floob
    Member

    @robertus Yes, and Select + R1 to load. You can have multiple save states, choose which one with Select + Left and Right on the joypad.
    This may also help

    #104801
    robertus
    Participant

    [quote=104775] @robertus Yes, and Select + R1 to load. You can have multiple save states, choose which one with Select + Left and Right on the joypad.
    This may also help
    <span class=”embed-youtube” style=”text-align:center; display: block;”>

    </span>

    [/quote]

    thanks a lot i solved ;)

    #111957
    dmm1000
    Participant

    Hi Floob
    really struggling with this
    I have configured a saitek P220 pad and theres nothing registering in thee bottom left hand side of the screen on F2 F4 load or save

    When playing genesis games – where does it save state by default – ?
    what permission command should i give this directory when i log in via ssh ?

    do you need to be the level above the directory you are giving the permissions to when you typw the chmod command ?

    can we not make it much easier by just assigning a keyboard key

    In retroarch do the numbers assigned to joypad buttons 3 and 7 and 9 etc ? are these equivalent to keyboard buttons 3/7 and 9 etc ?

    Sorry for all the questions everything is working except save / load ??

    #112506
    luzior
    Participant

    Hey guys ^^
    First of all I’m sorry for my bad english :/
    So, I saw your video and I decided to do the first method to save my games.
    I copied the retroarch.cfg and renamed as retroarch_Original.cfg. I changed the savefile_directiony to /home/pi/RetroPie/roms/Saves. Also I put “5” seconds for my autosaving files but the game does not even save !!! It’s very embarrasing ! If u are a problem to my issue I’ll thank u a lot ;)

    #112534
    Floob
    Member

    The first method uses .srm saves, these are made by the game itself. Try Super Mario World on the snes and finsih the first level – does an .srm file appear in the roms folder or your custom one at all?

    #112588
    tossy
    Participant

    My save/load state function works fine with Select-L/R with SNES. But the in-game save feature doesn’t work. This is supposed to just work “out of the box” right? All my ROMs are unzipped in the SNES folder. Also, ES always shows “last played / # times played” metadata as zero when that’s not true. How should I troubleshoot this??

    There are .SRM files created for the games I’ve played. A problem with loading?

    #112601
    tossy
    Participant

    I’m doing some more testing and things seem to be working now. I have noticed that failing to exit the emulator with Start-Select and just unplugging will cause the save-data to not take. Probably after a few key gaming sessions, this was the culprit. Pretty lousy fault in the system if you ask me, oh well. I will try the autosave_interval setting, since I can’t always expect a clean exit (either someone will not know, or forget, or my bluetooth controller will turn off and I have no way of reconnecting it without pulling the power, usually)

Viewing 23 posts - 1 through 23 (of 23 total)
  • The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.