• 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
 
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?
 
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:
Top