Before deploying a simulation server testing and debugging locally can significantly improve development and iteration times. There are a few ways of accomplishing this.
Using the Unity editor as a simulator allows us to easily debug the simulator. This way we can see logs, examine the state of scenes and game objects and test fixes very rapidly.
To run the Editor as a simulator run the editor from the command line with the proper parameters:
--coherence-simulation-server: used to specify the program should run as a coherence simulator.
--coherence-ip: tells the simulator which IP it should connect to, using 127.0.0.1 will connect the simulator to a local server if one is running.
--coherence-port: specifies the port the simulator will use
--coherence-world-id: specifies the world id to connect to, used only when set to worlds.
--coherence-room-id: specifies the room id to connect to, used only when set to rooms.
--coherence-unique-room-id: specifies the unique room id to connect to, used only when set to rooms.
For example:
If you're not sure which values should be used adding a COHERENCE_LOG_DEBUG
define symbol will let you see detailed logs, among them are logs that describe which IP, port and such the client is connecting to. This can be done in the Player settings: Project Settings -> Player -> Other Settings -> Script Compilation -> Scripting Define Symbols
To learn more about simulators see Simulators.
Another option is making a simulator build and running it locally. This option more closely emulates what will happen when the simulator is running after being uploaded.
You can run a simulator executable build in the same way you run the editor.
This allows you to test a simulator build before it is uploaded or if you are having trouble debugging it.
When using a rooms-based setup, you first have to create a room in the local replication server (e.g. by using the connect dialog in the client).
The local replication server will print out the room ID and unique room ID that you can use when connecting the simulator.
To learn more about building simulator build see Simulators Build and Deploy.