ParrelSync is an open-source project which allows you to open multiple Unity Editor instances, all pointing to the same Unity project (using Symbolic links).
Pros
Short iteration times
Easy to debug since every client is an Editor
Works with Unity versions prior to Unity 6
Cons
Can be more resource demanding than just running builds
Each clone requires the whole project to be duplicated on disk (1 clone means 2x the disk space, and so on). This might be a lot for huge projects.
Install ParrelSync as described in their Installation Instructions
UPM Package installation is preferred as coherence supports it out-of-the-box
If installed via .unitypackage, you need to set CloneMode.Enabled
by yourself. One way is by adding the following script to an Editor folder in your project:
Open ParrelSync > Clones Manager. Create a new clone, and open it
Continue development in the main Editor. Don't edit files in clone Editors
Make sure baked data is up-to-date before starting to test, and that the Replication Server is running with the latest schema generated
Enter Play Mode in each Editor
coherence tells apart ParrelSync clones from the main Editor, so it's easier for you to not edit assets in clones by mistake.
An easy way to test your game locally is to simply create a build, and open several instances of it.
You can also connect the Editor alongside the builds, with the extra benefit of being able to inspect the hierarchy and the state of its GameObjects.
Pros
Easy to distribute amongst team members and testers
Well-understood workflow
Can test with device-specific constraints (smartphones, consoles, ...)
Cons
Not the shortest iteration time, as you need to continuously make builds
Harder to debug on the builds (requires custom tooling on your side to do so)
Make sure you've read through Local Development and have started a Local Replication Server.
Let's create a standalone build. Before we do so, check a few settings:
In Project Settings > Player make sure that the Run in Background option is checked.
Go to Project Settings > Player and change the Fullscreen Mode to Windowed and enable Resizable Window. This will make it much easier to observe standalone builds side-by-side when testing networking.
With these in place, we're ready to build.
Open the Build Settings window (File > Build Settings). Click on Add Open Scenes to add the current scene to the build.
Click Build and Run.
When the build is done, start another instance of the executable (or run the project in Unity by just hitting Play).
Click Connect in the connection UIs on both clients. Now, try focusing on one and using WASD keys. You will see the box move on the other side as well.
Multiplayer Play Mode (MMPM) is Unity's official solution for local multiplayer testing, available from Unity 6.
Pros
Short iteration times
Tighter integration within the Editor, doesn't require multiple (standalone) Editors open
Cons
Requires Unity 6+
Can be more resource demanding than just running builds
Install MPPM as described in their Installation Instructions
Open Window > Multiplayer Play Mode
Enable up to 4 virtual Players
Make sure that the baked data is up-to-date before starting to test, and that the Replication Server is running with the latest schema
Enter Play Mode
coherence tells apart virtual Players from the main Editor, so it's easier for you to not edit assets in clones by mistake.
Now we can build the project and try out network replication locally. To do so, we need to launch and connect to a .
You can run a local Replication Server directly on your machine! You can either:
Go to: coherence > Local Replication Server > Run for Rooms or Run for Worlds
In the coherence Hub, open the Replication Servers tab. From here, you can run a server for Rooms or Worlds:
Regardless of how you launch it, a new terminal window will open and display the running Replication Server:
If the console opens correctly and you don't see an error line (they show up in red), it means your Replication Server is running! Now you should be able to connect to it, in the game.
It is often useful to be able to run multiple instances of your game on the same device. This allows you to simulate multiple player connections.
There are multiple ways to do this:
Dive into the individual pages to see our recommendation for each option.
With the game and the RS running, you can now connect and play the game.
If you can't connect
Did you change something in the configuration of your connected Prefabs? You have to bake again, and restart the Replication Server.
Time to bake!
In this section, we:
Ran a local Replication Server
Saw how to run multiple instances of the game
Connected to the Replication Server
Select a folder (e.g. Builds
) and click OK.
Whether you run a Replication Server for Rooms or for Worlds depends on , which in turn requires the correct corresponding .
of the game
Use the package (recommended, only available in Unity 6)
Use a third-party plugin, such as
Connecting is done using our API. For now, use one of the Sample UIs we provide. You should already have one in the scene if you followed the steps in the section.
You will notice it because there will be a little chef's hat next to the coherence folder, or a warning sign on Bake buttons:
Now that we know things work locally, it's time to !