RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    How To Create Favorites System in Retropie (yes system, not folder!)

    Scheduled Pinned Locked Moved Ideas and Development
    favoritessystememulationstaion
    57 Posts 10 Posters 16.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TMNTturtlguyT
      TMNTturtlguy @lilbud
      last edited by

      @lilbud @meleu I think the issue with having to run a script is that you will have to do this each time you create a new "favorites" or "Mario" or any system. You would also need to run the script any time you add a new game to the "Mario" system.

      If we can find a way to get the runcommand.sh to do this for us, it will work all the time. What i have done is created a copy of the runcommand.sh file and named it runcommandfav.sh. In my es_systems.cfg, i have just changed the runcommand file to the fav.sh file and left all the normal systems running off of the standard runcommand.sh file. This way we don't effect anything we already have set up.

      1 Reply Last reply Reply Quote 0
      • TMNTturtlguyT
        TMNTturtlguy
        last edited by

        Just an FYI for anyone reading through this thread. The directions at the top in the very first post do work without any issues. I have now implemented this on 2 separate builds with 2 different branches of ES running (main branch and screensaver branch).

        The long line of posts are simply @lilbud and myself trying to find a away to avoid having to set the emulator for each rom in your folder. You can follow the directions in the first post and create any system you want, like "Fighters". You can put any roms from any systems in there, you just have to manually set the emulator the very first time you launch the rom by pressing "A" button and setting the emulator for that rom.

        lilbudL 1 Reply Last reply Reply Quote 0
        • lilbudL
          lilbud @TMNTturtlguy
          last edited by

          @TMNTturtlguy Does anyone know Recalbox manages favorites? Cause watching the videos, it seems like they got this figured out.

          Creator of the Radiocade: https://retropie.org.uk/forum/topic/6077/radiocade

          Backlog: http://backloggery.com/lilbud

          TMNTturtlguyT 1 Reply Last reply Reply Quote 2
          • TMNTturtlguyT
            TMNTturtlguy @lilbud
            last edited by

            @lilbud Recall box vidoes is what inspired me last night! I saw @fernbuilds videos that had Batman and Mario and Sonic systems, and thought it would be so cool if we could do that. I can build a bartop machine and put cool TMNT graphics and marquee on it and run all the TMNT games ever made! I probably need to grow up some day!?!

            So like @lilbud has asked, any recall box experts out there? @fernbuilds, any thoughts?

            1 Reply Last reply Reply Quote 0
            • meleuM
              meleu
              last edited by meleu

              OK guys, here is my contribution to the messy creative favorites makeshift method you're trying to implement.

              Premises

              • It uses symbolic links only. I did this way intentionally. I think that duplicating files is a bad practice. Imagine someone with various PlayStation games as favorites...
                That being said, the step 2 of the OP needs to be adapted. Here is the command to create the symbolic link:
              ln -s ~/RetroPie/roms/nes/MyFavoriteNesGame.nes ~/RetroPie/roms/favorites/MyFavoriteNesGame.nes
              
              • There's no need to create the /opt/retropie/configs/favorites directory. Then the step 4 of the OP is completely unnecessary.

              es_systems.cfg

              Here is my version:

               <system>
                   <name>Favorites</name>
                   <fullname>Favorites</fullname>
                   <path>/home/pi/RetroPie/roms/favorites</path>
                   <extension>.zip .ZIP .smd .SMD .smc .SMC .sfc .SFC .nes .NES .bin .BIN .pbp .PBP</extension>
                   <command>/home/pi/bin/runfavorites.sh %ROM%</command>
                   <platform>all</platform>
                   <theme>favorites</theme>
                </system>
              

              /home/pi/bin/runfavorites.sh

              And here is the little script that makes the magic (thanks to sed and regular expressions sorcery):

              #!/usr/bin/env bash
              
              # testing if it's a symbolic link
              if [[ ! -L "$1" ]]; then
                  dialog --msgbox "ERROR: \"$1\" is not a symbolic link." 0 0
                  exit 1
              fi
              
              # getting the name of the file that the symbolic link points to
              rom="$(ls -l "$1" | sed 's|.*-> ||')"
              
              # getting the system based on the folder the rom is stored
              system="$(echo "$rom" | sed 's|\(.*/RetroPie/roms/[^/]*\).*|\1|' | xargs basename)"
              
              # now launch runcommand normally
              /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ "$system" "$rom"
              
              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              1 Reply Last reply Reply Quote 2
              • TMNTturtlguyT
                TMNTturtlguy
                last edited by

                @meleu It looks like you are requiring that the games be placed into a subfolder for each system? The symbolic link is linking an entire folder. This seems to defeat the purpose of what I am doing. I am not trying to create a favorites folder, I am creating a new system, just like the arcade system in which you can put several different platforms into one system. I don't want to have to have a folder in each of my systems, and i don't necessarily intend for people to have duplicates off all of their roms either, unless they choose to do so. The intent is that we can have a favorites, or a Mario, TMNT, Batman, Fighters or Street Fighter system. We can create a system background and system logo for each of these. I can then place all of the TMNT games from all of the systems into one spot. here is a link to a video by @fernbuilds, i am not sure if he is on attract mode or recal box.

                I think your script and idea is very good as well! Thanks for your help and time. This may be what @lilbud is looking for so he doesn't have to manually select his emulator for each rom.

                meleuM fernbuildsF 3 Replies Last reply Reply Quote 0
                • SanoS
                  Sano
                  last edited by

                  @meleu I like the way you presented it :)
                  This is interesting and plenty of fun to do, but at most a not-so-pretty workaround.
                  BTW all my roms stay zipped when the emulator allows it, so checking for suffix wouldn't work for me :)

                  Correct me if I'm wrong, but as I said earlier, the clean way to do this would be first to replace the gamelist.xml files by system with a common DB (sqlite ?).
                  This would allow to detach the ES interface from the system>rom scheme.
                  ES would then be able to sort and present games by metadata (system/editor/genre/keyword/date/favourite...), and launch them with correct emulator according to the rom folder.

                  I know it would be a huge lot of work, but I don't see any other clean solution to do this.
                  I also found out yesterday that aloshi worked on a sqlite branch of ES back in 2015...

                  meleuM 1 Reply Last reply Reply Quote 0
                  • meleuM
                    meleu @TMNTturtlguy
                    last edited by

                    @TMNTturtlguy said in How To Create Favorites System in Retropie (yes system, not folder!):

                    @meleu It looks like you are requiring that the games be placed into a subfolder for each system?

                    I think you misread my post. I'm using the same folder as you suggested in the OP: ~/RetroPie/roms/favorites/. All the links/favorites for any system will be placed in that folder.

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    TMNTturtlguyT 1 Reply Last reply Reply Quote 0
                    • meleuM
                      meleu @TMNTturtlguy
                      last edited by

                      @TMNTturtlguy Here is an example of the results (I used your arcade theme from ComicBook for favorites):

                      0_1496559702720_rsz_captura_de_tela_de_2017-06-04_035813.jpg

                      The games:

                      • G.I. Joe (NES)
                      • Sonic (Mega Drive)
                      • Tekken Advance (Gameboy Advance)
                      • Wall Jump Ninja (Atari 2600)
                      • X-Men (SNES)
                      • Useful topics
                      • joystick-selection tool
                      • rpie-art tool
                      • achievements I made
                      1 Reply Last reply Reply Quote 0
                      • pjftP
                        pjft
                        last edited by

                        Give me a couple of weeks, as this is in my backlog of "fun things to implement on ES", as mentioned in a few other posts. :)

                        Just want to make sure the screensaver stuff is merged into the main branch, so I can move on to other things.

                        TMNTturtlguyT 1 Reply Last reply Reply Quote 2
                        • meleuM
                          meleu @Sano
                          last edited by meleu

                          @Sano said in How To Create Favorites System in Retropie (yes system, not folder!):

                          BTW all my roms stay zipped when the emulator allows it, so checking for suffix wouldn't work for me :)

                          The script works for everyone that stores the ROMs in valid places (I mean ~/RetroPie/roms/SYSTEM_NAME). The script has nothing to do with suffix and I think it would work for you.

                          Edit: FYI, all my ROMs on my example above are zipped and they worked just fine.

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          1 Reply Last reply Reply Quote 0
                          • SanoS
                            Sano
                            last edited by

                            @meleu Yes, I understand your piece of code is looking for the symbolic link target, so it's based on the system rom folder.
                            I was actually talking about @lilbud script ;)

                            lilbudL 1 Reply Last reply Reply Quote 1
                            • lilbudL
                              lilbud @Sano
                              last edited by

                              @Sano I could never get that script to work. It would always crash

                              Creator of the Radiocade: https://retropie.org.uk/forum/topic/6077/radiocade

                              Backlog: http://backloggery.com/lilbud

                              1 Reply Last reply Reply Quote 0
                              • TMNTturtlguyT
                                TMNTturtlguy @meleu
                                last edited by

                                @meleu thanks! I think I am still misunderstanding. Do I still need to copy or move my roms into the /roms/favorites folder? When I read your instructions I am thinking you were trying to avoid placing the roms in the roms/favorites folder because of your comments on pax games.

                                Thanks!

                                1 Reply Last reply Reply Quote 0
                                • SanoS
                                  Sano
                                  last edited by Sano

                                  Nope, in oder to avoid copying the roms data (very space inefficient), you have to create a symbolic link in the favourite folder, which target your rom in its original system folder.
                                  It's the purpose of this line :
                                  ln -s ~/RetroPie/roms/nes/MyFavoriteNesGame.nes ~/RetroPie/roms/favorites/MyFavoriteNesGame.nes

                                  After this, @meleu script will simply look at the target of the symlink (the folder of the original rom file) to determine the system to use.

                                  TMNTturtlguyT 1 Reply Last reply Reply Quote 1
                                  • TMNTturtlguyT
                                    TMNTturtlguy @pjft
                                    last edited by TMNTturtlguy

                                    @pjft thanks, I know this is on your radar, however I am not sure ES needs to a changed to do what I am trying to do. All I am doing is replicating what the arcade system does. I am creating a system that can store and launch any rom from any system. Like arcade can hold mame, fba, and neo get in one system, the Mario system per @lilbud can hold nes,SNES,n64,go,gba,nds, etc.

                                    The original steps I created do exactly what the arcade system does. No changes to Es required. The arcade folder requires that you select the emulator type at Rom launch, so does my new system, again, Mario in @lilbud case. @lilbud was just looking for a way to avoid having to select the rom emulator for each rom in his folder. I think this has gotten more complicated than intended.

                                    All this is, is a simple instructions on how the arcade system works, and how you can create any system you want.

                                    Thanks for all the help and look forward to more development on this front!

                                    Eidit: I finally understand @meleu script and it is brilliant, but also fairly complex. I think it is great if you want the rom in 2 places for sure!

                                    1 Reply Last reply Reply Quote 1
                                    • TMNTturtlguyT
                                      TMNTturtlguy @Sano
                                      last edited by

                                      @Sano @meleu wow, now I get it! It was 2:30 am when I read your script @meleu so please forgive me. I now see that i replace the "myfavoritenesgame" with the actual rom name! I feel dumb now....I was reading that as a subfolder name within the NES folder. My mistake!

                                      1 Reply Last reply Reply Quote 1
                                      • pjftP
                                        pjft
                                        last edited by

                                        @TMNTturtlguy not a bother - this is a nice use case even for custom folders and collections...

                                        A question around these symlinks, though: would they only work on the SD card/on a Linux partition, or if you have a USB drive formatted as FAT32 with the roms, would that still work as well?

                                        TMNTturtlguyT 2 Replies Last reply Reply Quote 2
                                        • TMNTturtlguyT
                                          TMNTturtlguy @pjft
                                          last edited by TMNTturtlguy

                                          @pjft I haven't had a chance to test yet and won't for a few hours. Maybe @meleu can answer.

                                          To your point, this will probably only work if the USB you are using is in use with the ad card that the script was run on. Example. I have 2 separate builds each running off an 8gb ad card. I have just one 128 USB drive with all my roms. If I run the script in build A it should work fine. When I remove my USB and place it in build b it will not work because the USB drive does not include any of the runcommand.cfg files or es_sytem files. You would have to do a duplicate setup on build b. I am not positive this is the outcome, but just projecting this thought.

                                          Edit: I should clarify this is the case with or without the script. You would need to set up the favorites or "any system name" folders and .cfg files on both systems sd cards either way.

                                          1 Reply Last reply Reply Quote 0
                                          • TMNTturtlguyT
                                            TMNTturtlguy @pjft
                                            last edited by

                                            @pjft said in How To Create Favorites System in Retropie (yes system, not folder!):

                                            @TMNTturtlguy not a bother - this is a nice use case even for custom folders and collections...

                                            @pjft - question regarding your upcoming work on the favorites, I am assuming your work will be geared towards selecting roms and have them moved or linked to the favorites folder much like the script that @meleu has written, however as he has stated, it will be handled in ES and not a "hack" to make it work. Your work will not include the creation of custom systems though, like Mario, or Batman, or Sports? Is that a fair statement.

                                            If the above is true, i think i will spend some time to develop a few systems in my theme and then start a completely new post and change the name from "Favorites" to something on the line of "Custom Systems". In hind sight I should never have called this thread favorites, I only did that as it was a hot topic and i had a system logo created for it! Then users can choose to copy their roms into their custom system, or move them to the system so they only exist once. They will also have the ability to run @meleu script if they choose. But this won't be a tutorial on how to create favorites, I will leave that to you expert coders, this will be geared towards creating any system with the expectations is works like the Arcade folder. You place your roms and gamelist there and you set your emulator for each rom.

                                            pjftP meleuM 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.