- Home /
Is possible to Make a Frontend for Retroarch ?
Hello Everyone !
I wat to realize a 3D frontend for retroarch, and the idea is of a gameroom with some arcades inside and iwant that when i touch an arcade (trigger) the frontend goes on "pause mode" and Retroarch loads up and play the game of the arcade. when i quit retroarch i want to come back into the frontend and choose another game and so on ... Now, i have made a 3D gameroom with 2 coinops, one for R-type and the other one for bubble bobble. i can control a "capsule" for the player
The questions are : How can i launch the BATCH file with retroarch when i touch the trigger infront of the cabinet ? How can make that the frontend "pause" while i'm playng the game and then "unpause" when i quit Retroarch ??
Thank you for every answer , have a nice day and stay safe ! :D
Answer by Eno-Khaon · Dec 11, 2021 at 06:55 PM
While this doesn't exactly cover *everything*...
You can launch an external process by utilizing System.Diagnostics and Process.Start().
You can define command line arguments within the ProcessStartInfo passed into Process.Start().
Finally, this is only viable because Retroarch supports command line arguments.
Answer by marxotto2 · Dec 12, 2021 at 10:32 AM
Thanks Eno-khaon For the answer !!!
is possible to create this script in BOLT Visual scripting ?? and at wich game bject i have to link this script ?? the Coin-op model or the player ??
thank You again !!! :D
Well, while the idea is straightforward, the implementation is rather involved overall.
First, I don't have experience with visual scripting for Unity. I do all of my own (without using visual scripting, rather), so I don't know what limitations it does or doesn't have.
Logically, you'd associate a given game-to-load with a given arcade-machine-in-game, so I guess it would make sense for a script to load a game to be on the arcade machine?
To expand on this, if you wanted machines to be dynamically generated and have associated texturing where applicable, you'd potentially need to scan some defined folder for applicable file types (i.e. the games), then have (ideally) matching names to those files as pre-formatted images to load and print onto each side of each arcade machine.
Either way, this isn't really something with a fixed solution. There's a huge number of ways to approach this. Incidentally, the only reason this idea happens to work out without extensive effort is because Retroarch happens to support command line arguments.
Also, an additional note related to your original question:
Unity games pause when not in focus by default, so that aspect wouldn't really be an issue to begin with.
Thank you Again for your suggestions !!
Unfortunatley i'm not a programmer and i don't know C#, for this reason i prefer to use visual scripting , but obviusly this method have more limitations than classic coding ...
about the texturing , i have just created the cabinet with own textures, and every model have own trigger zone ...
In any case , i will try to learn about C# to make something more accurate , but is difficut for me to learn the concepts behind the strings ...
In any case thank ypou for your help ! :D
hi again @Eno-Khaon !!
excuse me for disturbing you again, but this problem is drivin' me crazy ...
I'm searching for a solution and i've found something about "TRIGGERS" and "PROCESS.START" , but i don't know how to use this command in the code .
this is the simple code that i've found :
using System.Diagnostics;
using System;
private static void RunFile()
{
Process.Start(Environment.CurrentDirectory + @"RTYPE.bat");
}
I have an error, and i don't know how to connect this action to the trigger code ...
I hope that you can help me .
Thank you again !! :D
Wait, a batch file? Unless there's something I'm misunderstanding, that seems a bit redundant based on the pieces I'd found in my answer.
From what I can tell, it looks like you should be able to do something like this:
public class ArcadeMachine : MonoBehaviour
{
// Point this at the necessary core
// to emulate the selected game
public string libretroCorePath;
// Point this at the ROM file for the
// intended game to launch
public string romPath;
public void LaunchGame()
{
ProcessStartInfo startInfo = new ProcessStartInfo();
// Since this should always be the same,
// this can/should be defined as a
//static variable somewhere
startInfo.FileName = retroarchExecutablePath;
startInfo.Arguments = string.Format("-L {0} {1}, libretroCorePath, romPath);
Process.Start(startInfo);
}
}
Then, on a script attached to your "player", you'd set up your interaction scheme (collision, raycast, etc.) to call the "LaunchGame()" function on the intended Arcade Machine.
Your answer
![](https://koobas.hobune.stream/wayback/20220613050423im_/https://answers.unity.com/themes/thub/images/avi.jpg)