Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Custom savefile/state location isn't working



  • This is what I did and guy on forums suggested:

    Edited /opt/retropie/configs/all/retroarch.cfg
    
    savefile_directory = "/home/pi/RetroPie/savefile"
    
    savestate_directory = "/home/pi/RetroPie/savestate"
    
    edited /opt/retropie/configs/n64/mupen64plus.cfg
    
    SaveStatePath = "/home/pi/RetroPie/savestate"
    
    SaveSRAMPath = "/home/pi/RetroPie/savefile"
    

    I switched savestates location instead from USB to the same folder as savefiles because I don't need it on a pendrive and I want everything in the same folder on my sd. The saves still save in roms folder. How do I do this then so it works?

    Link to the tutorial: https://retropie.org.uk/forum/topic/241/strategy-for-save-states-and-saves/2



  • @Psychol324 I made a small script for this!
    Get it here: savepath-a-small-script-to-set-srm-and-state-location-on-the-fly
    This script automatically sets path to your savegames. You can ask questions regarding this in the thread.

    By default ROM-location = Savegame location
    In my setup I separated ROMs from all savegames but let the savegames stored in a folder on the USB storage.

    Regards

    EDIT: Take care. This script only works for libretroemulators. MUPEN isn't one of these!



  • @psychol324 said in Custom savefile/state location isn't working:

    I switched savestates location instead from USB to the same folder as savefiles because I don't need it on a pendrive and I want everything in the same folder on my sd. The saves still save in roms folder. How do I do this then so it works?

    Haha... just tested it on my own. Even if pathes are changed the emulator reverts them back ;) Anyone got a solution?



  • @cyperghost It's very complicated, I read that you have to give permissions somehow so I gues I'll pass and I will just back up my games one by one.



  • @psychol324 Permissions are a usual method in unix systems.
    The chmod +x set a file to be executable for the current logged in user (=usually user: pi)
    If you write sudo chmod +x the file gets executable for root users and isn't executable for user pi anymore.

    So don't worry if it seems a bit uncommon at first - but it's a powerfull instance on unix.

    About the script: these $1 things are parameters that can be sended to a script, so that this can work with it. In the RetroPie-case
    $1 means just, ROM is started with a specific system... maybe mame, nes, gb, snes, fba, atari2600
    $2 is the emulator used lr-gambette, lr-stella, lr-pisnes, fba...
    $3 is the used romfile for ex: /home/pi/RetroPie/gb/Tetris.gb

    So this script just says in the case /home/pi/RetroPie/scripts/SavePath.sh "all" "/home/pi/savegames/$1"
    open config file for retroarch for all systems (as you parsed parameter all)
    use location /home/pi/savegames/current system to save SaveStates and battery saves. Current system depends on your choosen ROM. It is a nes-ROM then location is
    /home/pi/savegames/nes

    for a SuperNES-game it would be
    /home/pi/savegames/snes

    for a GameGear-game it would be
    /home/pi/savegames/gg

    N64 for ex does not work this way :(



  • @cyperghost Are you sure ?
    IIRC chmod +x set the file to be executable by all (u+g+o) regardless if used with sudo or not. If you want the file to be executable by the owner only, you have to chmod u+x it.
    Moreover it doesn't change the owner/group of the file according to the current user (chown can change owner).



  • @sano said in Custom savefile/state location isn't working:

    @cyperghost Are you sure ?
    IIRC chmod +x set the file to be executable by all (u+g+o) regardless...

    Yes you're right of course!
    The sudo command isn't also needed in this case.
    But I prefer to use sudo only in cases I really need it ... sometimes it seems to be missused as general method.



  • It's weird because I noticed that now my games are saving in the folder which I set, I don't know though when it started to work, maybe when I updated my Retropie to newest version or maybe it worked from the beginning but the old saves aren't working, I had save state from Metal Gear and Zelda II and Metal Gear state isn't working and Zelda state disappeared or maybe I didn't copy it. Although there's no huge loss because I barerly played right now because I'm testing stuff.

    So if anyone is interested in changing the destination then it's working at least on the newest version of Retropie but watch out with the old save STATES, I'm not sure if they'll work at least I didn't test it thouroughly and I'm not sure if they get obsolete after moving destination or maybe I screwed something, I'm talking about states, the ingame saves are working fine because I had my Zelda II save and GTA advance intact.

    Also I read that my way might overwrite old saves if you keep everything in one folder because if you play the same game on a different platform then the save game gonna have the same name so you have to change the destination on each platform individually which is pretty problematic if you format your stuff often.



  • @Psychol324 This can also be caused by emulator updates.
    Old SaveStates do not work anymore. SRM are stable as they intended to be pert of ROMs

    @psychol324 said in Custom savefile/state location isn't working:

    Also I read that my way might overwrite old saves if you keep everything in one folder because if you play the same game on a different platform then the save game gonna have the same name so you have to change the destination on each platform individually which is pretty problematic if you format your stuff often.

    Therefore I wrote that script.



  • @cyperghost I'm not sure if I understand your script, when do I choose "1$" or "all" in 4.1? and in instruction 5 either I edit retropie.cfg with save file/state = all or I have to open all systems cfgs and use "1$" as destination? If I use 1$ then it seems it's the same as the method I linked but instead writing full paths you write 1$?

    You said the system overwrites the paths, did you find a solution, does giving permission works for overwriting if yes then to what I should give permission?



  • @psychol324 Hello

    Choose all ... this uses config /opt/retropie/configs/all/retroarch.cfg - you did that already.

    The parameter for the save pathes can made dynamical if you use $1
    So /home/pi/RetroPie/savegames/$1 for a GameBoy game will be /home/pi/RetroPie/savegames/gb
    /home/pi/RetroPie/savegames/$1 for a NES games will be /home/pi/RetroPie/savegames/nes....

    In my humple opinion /home/pi/RetroPie/scripts/SavePath.sh "all" "/home/pi/savegames/$1" is the best setup

    It saves STATEs and SRM files into one location in depence of the system (gb, nes, snes) and used the config file for all base settings.

    Instruction point 5 can be understand following. Usually the setting for savefile_directoryand savestate_directory are commented out with a #.
    So you have to set them "active" by uncommenting them.

    So if you already have setted them up like savefile_directory = "/home/pi/RetroPie/savefile" you are fine.
    So the script will always overwrite this: like savefile_directory = "/home/pi/RetroPie/savegames/gb"
    Hope I was clear now ;)


Log in to reply
 

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.