Main > Driving & Racing Cabinets
SOLUTION: Use one PC to start games on two or more PC's (for twin cabs etc)
Pstylz:
Hi everyone,
I thought I would share my solution to use one PC to start a game on two (or more) PC's simultaneously - the use case for this is where one master cabinet "PLAYER 1" selects the game and starts that game on 2 PC's (in my case - my twin racing cabs).
• Eliminates the need to use a frontend on each cab
• Eliminates the need for the same game to be manually started on each cab at the same time
• Stops the initial "network sync" errors with some games if they are not both started at the same time
• Eliminates confusion for players
I am using the following to achieve this:
• LaunchBox (BigBox)
• AHK - AutoHotKey
• EXE Slideshow - this was used to make an animated "<<< Select Game on P1" screen for the PLAYER 2 cab
How it works:
• There is an AHK script that runs in the background on the PLAYER 2 cab looking for a "game" script in the folder C:\AHK to run. When no game is selected from PLAYER 1 the script keeps looping.
• While PLAYER 2 cab is waiting for a game selection from PLAYER 1 cab, an animated EXE slideshow is running on PLAYER 2 cab
• When PLAYER 1 selects a game, a "game" script is copied to folder C:\AHK on the PLAYER 2 cab
• The looping script on PLAYER 2 cab finds that a "game" script is in folder C:\AHK. It starts the game on PLAYER 2 cab, deletes the script from C:\AHK so the looping script can continue looking for game changes from PLAYER 1 cab
An extra:
• When the ESCAPE key/exit button is pressed on the PLAYER 1 cab it will send a script to the PLAYER 2 cab to exit the current playing game and open the EXE Slideshow on the PLAYER 2 cab and wait for a game selection from the PLAYER 1 cab
AN EXAMPLE: DAYTONA USA SELECTED ON PLAYER 1 CAB
--- Code: ---#SingleInstance force
;---- COPY DAYTONA USA GAME.AHK TO PLAYER 2 CAB ----;
;---- NOTE= Y:\AHK IS THE NETWORKED DRIVE ON PLAYER 2 CAB (C:\AHK) ----;
FileCopy, C:\AHK\FilesToCopyToP2\Daytona USA\GAME.ahk, Y:\AHK
;---- START DAYTONA USA ON PLAYER 1 CAB ----;
Run, C:\AHK\Links\2P\Daytona USA.lnk, , Max
;---- WHEN ESC IS PRESSED ON PLAYER 1, CLOSE ALL GAMES ON PLAYER 1 AND SEND A CLOSE ALL GAMES SCRIPT TO PLAYER 2 ----;
ESC::
FileCopy, C:\AHK\Escape\GAME.ahk, Y:\AHK
Send !F4::
Process, Close, TeknoParrotUi.exe
Process, Close, sdaemon.exe
Process, Close, supermodel.exe
Process, Close, Daytona.exe
Process, Close, emulator_multicpu.EXE
Process, Close, parrotloader.exe
Process, Close, OpenParrotLoader64.exe
Process, Close, ParrotLoader64.exe
Process, Close, BudgieLoader.exe
Process, Close, Wmn5r.exe
Process, Close, Rally.exe
Process, Close, MK_AGP3_FINAL.exe
ExitAPP
return
--- End code ---
PLAYER 2 - LOOKING FOR GAME LOOP SCRIPT:
--- Code: ---;---- LOOK FOR GAME SCRIPT TO EXECUTE GAME ----;
IfExist, C:\AHK\GAME.ahk
Run GAME.ahk
Loop
Sleep, 2000
Reload
--- End code ---
AN EXAMPLE: DAYTONA USA GAME SCRIPT THAT IS SENT TO PLAYER 2 CAB WHEN A GAME IS SELECTED ON PLAYER 1
--- Code: ---#SingleInstance force
;---- CLOSE ALL POTENTIAL RUNNING GAMES ----;
Process, Close, TeknoParrotUi.exe
Process, Close, sdaemon.exe
Process, Close, supermodel.exe
Process, Close, Daytona.exe
Process, Close, emulator_multicpu.EXE
Process, Close, parrotloader.exe
Process, Close, OpenParrotLoader64.exe
Process, Close, ParrotLoader64.exe
Process, Close, BudgieLoader.exe
Process, Close, Wmn5r.exe
Process, Close, Rally.exe
Process, Close, MK_AGP3_FINAL.exe
;---- START DAYTONA USA ON PLAYER 2 CAB----;
Run, C:\AHK\Links\2P\Daytona USA.lnk, , Max
;---- DELETE GAME SCRIPT FROM LOOP SEARCH FOLDER ----;
FileDelete, C:\AHK\GAME.ahk
;---- IF ESC IS DETECTED CLOSE ALL POTENTIAL RUNNING GAMES ----;
ESC::
Process, Close, TeknoParrotUi.exe
Process, Close, sdaemon.exe
Process, Close, supermodel.exe
Process, Close, Daytona.exe
Process, Close, emulator_multicpu.EXE
Process, Close, parrotloader.exe
Process, Close, OpenParrotLoader64.exe
Process, Close, ParrotLoader64.exe
Process, Close, BudgieLoader.exe
Process, Close, Wmn5r.exe
Process, Close, Rally.exe
Process, Close, MK_AGP3_FINAL.exe
;---- CHECK IF EXE SLIDESHOW IS RUNNING ----;
Process, Exist, Player 2 - Waiting Screen 0.4.exe
If Not ErrorLevel ; errorlevel will = 0 if process doesn't exist
Run, C:\AHK\Player 2 - Waiting Screen 0.4.exe, , Max
ExitAPP
return
--- End code ---
This is a pretty easy way to sync the execution of a game on multiple PC's - there's probably better ways, but hope this helps.
One draw back, is that you need to create a few scripts for every game you want to run on your cabs, this includes when you add new games.
Because this process is only required for my racing cabs and it only has a select few games, its easy to manage and isn't an issue for me.
If anyone would like further explanation please let me know.
nugarp:
Never did I ever imagine AHK would be used to replace socket functionality. Neat trick you have there - thanks for sharing.
If you code at all or are curious, take a look at nodejs and the socket.io library. You won't need to keep polling. It's super user friendly.
Sent from my SM-G950U using Tapatalk
Empo:
Sorry for dragging up an old thread. But this is a question i have been wondering about as i want this function in my setup. Very nice use of AHK to obtain this function i must say.
But in my digging regarding this i found the PsExec: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
PsExec i think would be a better solution, anyone tried this ? (i already start my games in the twin driver setup using bat. files)
Pstylz:
--- Quote from: nugarp on April 24, 2021, 12:26:35 am ---Never did I ever imagine AHK would be used to replace socket functionality. Neat trick you have there - thanks for sharing.
If you code at all or are curious, take a look at nodejs and the socket.io library. You won't need to keep polling. It's super user friendly.
Sent from my SM-G950U using Tapatalk
--- End quote ---
Thanks for the feedback. :cheers:
Thank you for the suggestion but unfortunately I'm not skilled enough to code (very well) - I'm just a good "tinker-er" haha.
And fortunately the polling on P2 machine barely has any impact on system resources.
Pstylz:
--- Quote from: Empo on February 16, 2022, 06:00:00 pm ---Sorry for dragging up an old thread. But this is a question i have been wondering about as i want this function in my setup. Very nice use of AHK to obtain this function i must say.
But in my digging regarding this i found the PsExec: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
PsExec i think would be a better solution, anyone tried this ? (i already start my games in the twin driver setup using bat. files)
--- End quote ---
No worries. Hoped this helped or gave you further inspiration for other solutions. :cheers:
I did attempt to use PsExec many moons ago, but found I had issues with it.... cant remember what now, but i think P2's controls failed to register when games were initiated with PSExec
Navigation
[0] Message Index
[#] Next page
Go to full version