Run games locally

How to run multiplayer games locally?

Development time

We’re working on multiplayer games, however during development it’s easiest and quickest to work locally. Elympics supports 3 distinct run network modes when running from the gameplay scene in Unity Editor:

  • Local Player and Bots - local gameplay, no external server needed. This is the easiest, and sometimes most misleading.
  • Half Remote - play on the network, launching your game in server or client mode from the editor. Meant for development and debugging.
  • Debug Online Player - directly connect to Elympics-hosted game instance - the same mode that will be used in production! Remember that in order run it this way, you’ll need to upload your Linux game build first!

Half remote mode

Half remote mode will allow us to run both server and client games between multiple editor instances and/or game builds. In our case, one of the editors will act as a server, and all others will join as players (clients). Here comes a very convenient package bundled with Elympics: ParrelSync.

In order to create another editor, launch ParrelSync -> Clones Manager and add a new clone of your game by clicking Create a new clone. This can take a while. After it’s done, you should be able to see two clones of launchable Unity instances.

Two Clones

In some cases in order to test your game, you’ll only need 2 distinct clones (one for the server and one for the player). So let’s Open in New Editor in Clone 0 options – this will launch another Unity editor with the same exact project, that will be the player during our tests.

With 2 editors open (root and clone), we need to specify which of those is the server, and which is the client. To do that, let’s launch Elympics Config by going to Tools -> Elympics -> Select or create Config.

In that inspector window you should see one ElympicsConfig with all its settings. After scrolling to the bottom, make sure that Mode is selected as Half Remote, and Player 1 should have Is Bot option checked.

Change to half remote

So: let’s set the main editor as Server in half-remote mode.

The second editor (Player 0), edit the same settings and set it as player, and connect to your loopback IP (the same as in the screenshot below):

Static options set for half remote

Player 1 should be set as bot, so that we’re able to start the game with only one player. Alternatively, you can create another editor clone and launch it as the second player.

That’s it! We should be able to run our game! 🎉

First, start Play mode in the editor that was configured as the server. Once it starts, do the same in the clone editor (player). The two instances are connected, and you can debug the game state as it’s being actively synchronized between instances of the Editor, in a very similar way to the production environment.