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

    Create a custom ES system able to launch games for many systems

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatiocustomisationscustom theme
    157 Posts 15 Posters 72.5k 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.
    • cyperghostC
      cyperghost @meleu
      last edited by

      @meleu
      You got me wrong :D

      How long took it to create that?

      IMHO it's reasonably fast.

      I ment how many hours of work did you invest to create that script.

      Thank you about the xargs
      The reason for doing this is, if someone created a gamelist.xml of the best roms then a script can extract pure rom_pathes out of it and then uses your script for symlinking.

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

        @cyperghost said in [Create a custom ES system able to launch games for many

        I ment how many hours of work did you invest to create that script.

        I think it took 3 hours, but it's a completely inaccurate measurement. I was constantly interrupted by the kids, which delays. On the other hand I'm quite familiar with bash scripting since early 2000's and a bit familiar with xmlstarlet since I wrote that tool to create launching images based on ES theme.xml files, which speeds up...

        The reason for doing this is, if someone created a gamelist.xml of the best roms then a script can extract pure rom_pathes out of it and then uses your script for symlinking.

        You can easily get the rom paths from a gamelist.xml using xmlstarlet. Here is the command line:

        xmlstarlet sel -t -v "/gameList/game/path" gamelist.xml
        

        EDIT: be aware that the command above gets the path exactly as they are in the gamelist.xml file, then probably you won't get the full path to the ROM.

        If you want to put them in a file like your my_beloved_roms.txt above, you just have to redirect the output:

        xmlstarlet sel -t -v "/gameList/game/path" gamelist.xml > my_beloved_roms.txt
        

        I hope it helps.

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

          @cyperghost be aware that the xmlstarlet trick I said above gets the path exactly as they are in the gamelist.xml file, then probably you won't get the full path to the ROM.

          I edited the post with this info.

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          1 Reply Last reply Reply Quote 1
          • UDb23U
            UDb23 @meleu
            last edited by

            @meleu wow !

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

              @meleu I have come across a few issues. Forgive me if these are user errors.

              Issue #1 - The original Script in the OP does not work after updates made to Retropie-Setup Script at all, and your fancier script that creates the link and gamelist works with some modifications. On Friday @BuZz made a modification to the Retropie-Setup Script. It requires some scripts to need a sudo command to operate. I thought this only affected scripts in the retropie menu, but I have created your script exactly as you have it and placed it in the exact location you have shown. If i run it from command line with bash the script runs and gives me the "this is not a symbolic link" error. When i try to launch a rom from my batman folder i get a Permission Denied error. I tried adding a few sudo commands into the script but can't figure it out.

              Here is the log that I get:

              lvl2: 	 Attempting to launch game...
              lvl2: 		/home/pi/bin/runcustom.sh /home/pi/RetroPie/roms/mario/MarioBros.zip
              lvl1: 	...launch terminated with nonzero exit code 32256!
              

              And here is the error on command line of pi:

              sh: 1: /home/pi/bin/runcustom.sh: Permision denied
              

              I tried several fixes to this and I can't get a solution to work. Your fancier script does the same thing, However I am able to get your fancier script to work doing the following:

              You must run the script to create the symbolic link as a bash command:

              bash ./add-game-to-custom-system.sh -d ~/RetrioPie/roms/.......
              

              You must also change the command line is es_systems.cfg to a bash command

              <command>bash /home/pi/bin/runcustom.sh %ROM%</command>
              

              Everything works great with this script running as bash.

              So this leads me to issue number 2 - Note issue #1 was on a retropie 3B running latest version of ES with updated setup script. Running everything off of installed SD card. Issue #2 below is running off of the latest version of ES. I did NOT update the setup script on this build. I am running ES off of a 16gb SD card. My roms are all on a USB stick.

              Issue #2 - symbolic link is not permitted when roms are on USB drive. Here are screenshots of the error. The first screenshot is using the normal paths as noted in your directions (this worked on my other build with roms on the SD card)
              0_1497846798859_a62ebc4b-80ec-4e68-bea0-45e85a641bee-image.png

              So i tried to use the actual path of the usb stick /media/usb0/ and here is the same error
              0_1497846870731_61619e4b-e8aa-4c7a-953d-4d14f1175d36-image.png

              So then i tried your fancier script and again received the following errors - It did not create a link, but a black gamelist did appear in the mario folder.

              0_1497854077009_a270c127-df6b-42c8-a36f-cae3f8e93fe7-image.png

              If anyone has had success with this when Roms are on a USB please let me know the trick!

              E meleuM 2 Replies Last reply Reply Quote 0
              • E
                EctoOne @TMNTturtlguy
                last edited by

                @TMNTturtlguy It was mentioned somewhere in this thread that symbolic links only works when on linux partitions. I have my Roms on a Fat32 Stick and made a SymLink Folder on my SD which contains all new systems with the links and gamelists.
                And I always had to use bash to get any script to work.

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

                  @EctoOne thanks! Yes I did remember now that @meleu said it only works on Linux partitions. Did you have to create a new partition on your sd card or just a new folder?

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

                    @TMNTturtlguy said in Create a custom ES system able to launch games for many systems:

                    Did you have to create a new partition on your sd card or just a new folder?

                    A new folder on a Linux partition and change the es_systems.cfg accordingly.

                    Check the FAQ in the OP, the answer for question 3 has a link to the conversation about that.

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

                      @TMNTturtlguy about the issue #1, those fancy scripts are clearly lacking the permission to execute. A simple chmod +x scriptname should solve it.

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

                        @meleu Here is a 7zip download containing all of the scripts and configuration files for adding 50 new collections into Emulation Station. I've also included a readme file where I tried to document how it all works. Users keep their roms and matching media in the normal folders, everything is based upon symbolic links (for both the roms/media themselves and the specialized gamelist.xml files).

                        This method adds new emulator folders in /opt, new systems into es_systems.cfg, new /roms folders, new scripts, and new specialized gamelist.xml files for them all.

                        The only prerequisite is that the scripts expect the rom filenames to be named according to the Hyperspin/EmuMovies naming convention.

                        But...hopefully you can gleam some usefulness out of it and be able to update/adapt it to make it more generic and global for use. Hope my included readme text file explains it well enough as well as you looking over the shell scripts themselves to make sense. Also, of course, if you add these, you'll need to update whatever theme you use as well so they'll show properly in ES.

                        I copied them over and zipped them on Windows ... so you might have to chmod 755 on the scripts to get them back to executable on your Pi (not sure if they kept those permissions or not).

                        https://mega.nz/#!5Zt2ga6b!mgcwbDPW1o18hS1DT_QwL7nHiqEDk7Eg7ZA3RVeOnwk

                        pjftP 1 Reply Last reply Reply Quote 3
                        • pjftP
                          pjft @dmmarti
                          last edited by

                          @dmmarti thanks for sharing this - great to see the momentum and engagement here.

                          I plan on making all of these obsolete, but we're likely looking at an August timeframe given that we're at the end of June and I'm still working on the all, last played and favorites auto systems.

                          Still, great to see the use cases in the interim :)

                          meleuM 1 Reply Last reply Reply Quote 4
                          • meleuM
                            meleu @pjft
                            last edited by

                            @pjft said in Create a custom ES system able to launch games for many systems:

                            I plan on making all of these obsolete

                            Do you really mean ALL. Including the "custom systems" like konami, cps2, megaman, shoot'em ups, etc?

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

                              @meleu said in Create a custom ES system able to launch games for many systems:

                              Do you really mean ALL. Including the "custom systems" like konami, cps2, megaman, shoot'em ups, etc?

                              You forgot the reason this all started....TMNT! Cowabunga!

                              0_1497980318872_cMKM4HA.jpg

                              1 Reply Last reply Reply Quote 2
                              • pjftP
                                pjft @meleu
                                last edited by

                                @meleu I don't mean making the systems obsolete, but the way we create them. I envision this all being done within EmulationStation, but it's still a ways off.

                                1 Reply Last reply Reply Quote 2
                                • UDb23U
                                  UDb23
                                  last edited by

                                  Shoot'em Up SVG logo ready !

                                  alt text

                                  Available here.

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

                                    @meleu Is there anyway that we can point the custom folders with the symlinks to use a custom launching image? right now the symlinks in the script point the linked roms to use the launching image associated with the /opt/retropie/configs/folder for the system the rom originated from. So if mega man was from the nes folder, it would use the nes launching screen found in /opt/retropie/configs/nes

                                    Is there a way to set it so that all of the sym links in the megaman folder use a launching image specific for just megaman? can the custom runcomand script in the es_systems.cfg for the custom systems have a line to point to the symlink folder for the launching image? Thanks

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

                                      @tmntturtlguy said in Create a custom ES system able to launch games for many systems:

                                      @meleu Is there anyway that we can point the custom folders with the symlinks to use a custom launching image?

                                      We can think in a workaround for it, but currently not.

                                      Maybe it's better to use the game specific launching image feature.

                                      More info in the docs: https://retropie.org.uk/docs/Runcommand/#adding-custom-launching-images

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

                                        @meleu Thanks Man,

                                        I thought about the game specific but then it would show the mega man launch image if I launch it from the NES system....I guess it isn't the end of the world, but I would like to get it so that mega man.zip shows the mega man lunch when launched from the mega man system and mega man.zip has the nes launch when launched from the nes system.

                                        This is not a bid deal at all, so no worries. Thanks

                                        1 Reply Last reply Reply Quote 1
                                        • namyzarkN
                                          namyzark
                                          last edited by

                                          @TMNTturtlguy & @meleu

                                          I love this. I've tried following along with this due to the design of what my wife wants, but it isn't working.

                                          Let me describe the end goal: the wife says there are too many game systems. CPS1, CPS2, CPS3, Capcom, FBA, Galaxian, GameGear, GBC, GBA, NES, SNES, Genesis, etc etc etc

                                          She wants a 'couple' main system directories. Like Nintendo, Arcade, & Sega. In each of these 'main system' groups there will be sub-systems. Nintendo would have GBC, GBA, NES, & SNES.

                                          Thus far I've managed to create a new main system. The sub folders are just that, sub folders. They don't launch correctly (incorrect emulator is my best guess). Anything either of you can do to help and get me on the correct path to fix the issue I am having?

                                          Thank you in advance.

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

                                            @namyzark I suggest you to use the @TMNTturtlguy 's trick here: https://retropie.org.uk/forum/topic/11499/change-es_systems-cfg-script

                                            • Useful topics
                                            • joystick-selection tool
                                            • rpie-art tool
                                            • achievements I made
                                            namyzarkN 2 Replies Last reply Reply Quote 2
                                            • 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.