Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • Floob
    Member
    Post count: 1629

    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.

    Floob
    Member
    Post count: 1629

    Video showing the internal / standard save feature:

    Floob
    Member
    Post count: 1629

    Video showing save states in RetroPie / RetroArch:

    darknighte9
    Participant
    Post count: 6

    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

    Floob
    Member
    Post count: 1629

    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

    darknighte9
    Participant
    Post count: 6

    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.

    Floob
    Member
    Post count: 1629

    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.

    darknighte9
    Participant
    Post count: 6

    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”

    darknighte9
    Participant
    Post count: 6

    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.

    Floob
    Member
    Post count: 1629

    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.

    darknighte9
    Participant
    Post count: 6

    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.

    darknighte9
    Participant
    Post count: 6

    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!

    elgur85
    Participant
    Post count: 34

    Hello there!

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

    Floob
    Member
    Post count: 1629

    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):

    Anonymous
    Inactive
    Post count: 16

    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?

    robertus
    Participant
    Post count: 22

    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

    Floob
    Member
    Post count: 1629

    @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

    robertus
    Participant
    Post count: 22

    [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 ;)

    dmm1000
    Participant
    Post count: 1

    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 ??

    luzior
    Participant
    Post count: 2

    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 ;)

    Floob
    Member
    Post count: 1629

    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?

    tossy
    Participant
    Post count: 9

    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?

    tossy
    Participant
    Post count: 9

    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.