• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE Running multiple instances of project

w0rm

Member
Hi!

I started to develop a p2p network multiplayer game where the same project includes both server and client functionality. Is there an easy to way to start the project twice within GMS2 GUI during development? After running it the first time as server GMS2 doesn't seem to allow starting the project second time while the previously launched program is still executing. I have tried running multiple instances of GMS2 and using the same project but I'm afraid messing up the project by doing that.

Any ideas on how others have been solving this out?

Thx!
 

Pavel

Member
The A/B documentation has an example for Windows, does anybody have an example for macOS? I guess it should be similar as I see from the Output window when I run a game in IDE, however, I tried to repeat the same but it does not work

I tried '/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.1.3.189/mac/YoYo Runner.app' --args -game ~/path/to/my_game/my_game.yyp

there is also `/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.1.3.189/bin/Igor.exe` but I guess this is something different
 
E

ElegantMistake

Guest
Same here.
Is it possible to update the documentation for Mac support?
Does the resources sync when having 2 GameMaker Studio instances open and running a game instance per GMS instance?
 
L

Luke Hollenback

Guest
I know that this is a bit of an older thread, but I ended up finding the answer to this for any future interested parties.

On macOS, one must use the open command to fire up an application bundle such as the YoYo Runner for your currently-installed GameMaker Studio 2 runtime. So, to give an example, I can open a second instance of my game by running the following in my zsh or bash shell on macOS ↝

Code:
open -n -a /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo\ Runner.app --args -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip"
I'll break down this command below ↝

  • open is the command to open an application bundle on macOS.
  • -n indicates that you would like to open a new, unique instance of the application bundle (as macOS will generally opt to only allow a single instance of an app to run at once).
  • -a /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo\ Runner.app provides the path to the YoYo Runner from whatever installed GameMaker Studio 2 runtime that I would like to use.
  • --args tells the command that everything following should be passed as an argument to the specified app rather than to the open command itself.
  • -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip" provides the path to the actual game to run.
All of this can be pulled from the console output from GameMaker Studio 2. For example, look for output like the following when you run your game from the IDE (notice that I don't worry about any of the debug output paths – you can if you really need to, but you probably don't) ↝

Code:
/bin/bash DONE (0)
-n -a "/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.2.5.378/mac/YoYo Runner.app" --args -game "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/GameAssetsMac.zip" -debugoutput "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/debug.log" -output "/var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/GMS2TEMP/arcane_60C4418D_VM/debug.log"
Igor complete.
Starting...
If you want to make this easier on yourself, you can drop the following GML snippet somwhere in your project to have it output a command for you to copy-and-paste to the shell when run from the IDE. Note that you'll need to make GMS2_RUNTIME a valid variable in your environment that holds the path to your installed GameMaker Studio 2 runtime's YoYo Runner app.

Code:
//
// Output one-liner that can be used to start a second instance of the game to the console.
//
show_debug_message("Second instance command ~>")
show_debug_message(
    "\topen -n -a ${GMS2_RUNTIME} --args " +
    parameter_string(0) +
    " " + parameter_string(1)
)
 
Last edited by a moderator:

ZacKow264

Member
Is it possible to open a second instance of the project in-game too? So in the final thing, not during testing?
 

w0rm

Member
Is it possible to open a second instance of the project in-game too? So in the final thing, not during testing?
With the mentioned extension should be possible on Windows platform. I'm using it with my network game prototype in which launcher can start server process or client processes, and server process can further start separate processes for lobbies which run the game and clients connect to.
 

descrubb

Member
MacOS

I made a script that I put in my ~/bin/ folder (which I added to the $PATH variable via .zshrc file)

so now I can run this script file from the terminal just by typing gmsrunner and it will fire up a new instance of the latest project build running from GMS2 IDE.

Cheers!

NOTE: You must have GMS2 open AND have run(f5) a project at least once for the script to work at all.

gmsrunner:
Code:
#!/bin/bash

#MAKE SURE TO REPLACE THE "ys" AND "crazy\ number\ letter\ directory" DIRECTORY NAMES IN THE LINE BELOW -> with the actual directories that are there.
#EXAMPLE /var/folders/zh/shmy6jb93sl6yg8wtks44ymc0000gn/GameMakerStudio2/etc...
cd /var/folders/ys/crazy\ number\ letter\ directory/GameMakerStudio2/GMS2TEMP/

LATEST_FOLDER=`ls -td -- */ | head -n 1`
PATH_TO_FILE=`pwd`
FULL_PATH="${PATH_TO_FILE}/${LATEST_FOLDER}GameAssetsMac.zip"
echo $FULL_PATH

#MAKE SURE TO UPDATE THIS LINE EACH RUNTIME UPDATE
cd /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.3.0.401/mac/

open -n YoYo\ Runner.app/ --args -game $FULL_PATH
 
Last edited:
Top