RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    Quitting a game via command line / ssh

    Scheduled Pinned Locked Moved Help and Support
    scriptingssh
    9 Posts 2 Posters 1.1k 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.
    • T
      teethree89
      last edited by

      Pi Model or other hardware: Pi 4
      Power Supply used: Canakit 3.5A
      RetroPie Version Used: 4.7.18
      Built From: Pre made SD Image on RetroPie website using the Pi imager

      Hello, I am trying to build kind of a custom loader that the user can choose three games from instead of having the whole emulationstation menu to contend with, this is something that I am building in the godot game engine to port over to linix with the godot emulator and run on the pi. I am running into a little road block with changing games on the fly, as the emulator for godot will be running a "game" and when the user selects a game it will switch over to that one. I have my single-game boot working fine via run command, and I tried using this script https://pastebin.com/jmNJxMcJ to kill the game, but it seems it just looks for a running emulator, which it does not find.

      Any simple commands on how to switch over from one game too another on the fly like this?
      Much appreciated.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        The script you linked assumes the program/emulator is started by runcommand, which is not the case here.
        Find the process corresponding to your game/emulator with ps -ef and then use it's name to stop it with killall <proc_name>.

        T 1 Reply Last reply Reply Quote 0
        • T
          teethree89 @mitu
          last edited by

          @mitu
          Alrighty, I gave that a shot and it gives me a list of processes and PID's but not names if I am reading it correctly, here is a pastebin of the process list, https://pastebin.com/4cGwJvUe I think the process im looking for is 508?

          Thank you,

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            Sorry, I'm a bit confused - I thought you'd be running your Godot based game or custom loader ? Your process list shows an arcade game started from EmulationStation, the standard RetroPie front-end.

            I think the process im looking for is 508?

            No, in the example list you'd need to stop retroarch, which is started from runcommand.

            T 3 Replies Last reply Reply Quote 0
            • T
              teethree89 @mitu
              last edited by

              @mitu ah sick that worked to kill the game, here is the pastbin for the godot-engine, im assuming i should try killall godo-engine?

              https://pastebin.com/LmfZeWpg

              1 Reply Last reply Reply Quote 0
              • T
                teethree89 @mitu
                last edited by

                @mitu sorry for the double post, I see the paste cut off some of the output, here is an updated pastebin https://pastebin.com/BnNU3EEM

                1 Reply Last reply Reply Quote 0
                • T
                  teethree89 @mitu
                  last edited by

                  @mitu think i got it, used the following and got back to command line:

                  ps -ef | awk '/tester/ {print $2}' | xargs kill
                  
                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @teethree89
                    last edited by

                    That would catch only when you run the tester.zip rom, it' better to match on godot-engine if the name of the process (frt_3.3.2_pi2.bin) has such an obscure name.

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      teethree89 @mitu
                      last edited by

                      @mitu ah perfect that worked too, thank you very much!

                      1 Reply 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.