Having this capability is essential during the development phase to ensure that we synchronize all game elements correctly between different participants. Godot natively includes the ability to run up to 4 independent instances of the game for testing. However, Unity has not had this feature, at least until now.
The course I am taking, for example, limits testing to compiling and running one instance of the game outside the editor (with the "Build and Run" option) and running a second instance within the Unity editor. It doesn’t explain how to test with more than two players, which has not been easy. Searching the internet, I concluded that the closest thing Unity had to Godot’s functionality was a third-party extension called ParrelSync.
The news is that Unity 6 will finally include the feature that Godot users have already enjoyed. Although there is no stable version of Unity 6 yet, you can already test everything in the Preview versions available for installation from Unity Hub.
The functionality is called Multiplayer Play Mode and allows you to simulate up to 4 players: one from the editor and three other virtual instances of the game.
To install it, we need to go to the Package Manager in the Unity 6 editor and install the Multiplayer Play Mode package from the Unity Registry.
To activate a virtual instance of the game, you need to go to Window > Multiplayer Play Mode and select how many instances you want to launch.
Those instances you select will start a boot process, and once they become active, their respective windows will appear. Don’t worry about the long startup time. It only takes that long the first time. After that, the information is cached, and subsequent startups are much faster.
From that moment on, every time we start the game from the editor, it will play in both the editor and the virtual instances, allowing us to simulate the behavior of independent players.
To operate as one of the players, simply select the window of its instance and interact with the game as the player would.
To stop the game, do so from the editor as you would with a single-player game. This will stop the game in all virtual instances.
To make the windows disappear, just deselect them in the Multiplayer Play Mode window.
With this, we have everything we need to test any multiplayer game.
I hope you found this interesting.