LogoLogo
⚠️ Outdated documentationGo to LatestHomeAPI
SDK 0.7.4
SDK 0.7.4
  • Welcome
  • Overview
    • What is coherence?
    • How does coherence work?
    • Features and Roadmap
    • Rooms and Worlds
    • Requirements
  • Get Started
    • Install coherence
    • Scene setup
    • Prefab setup
    • Build and run
    • Baking and code generation
    • Create a free account
    • Deploy replication server
    • Share builds
  • Authority and communication
    • How authority works
    • Authority transfer
    • Commands / Messages
    • Client messages
    • Server-side and input queues
    • Input prediction and rollback
    • Animations
  • Persistence
    • Overview
    • Configuring persistence
    • Storage
    • Example – A global counter
  • Optimization
    • Overview
    • Simulation frequency
    • Areas of interest
    • World size
    • Level of detail
    • Interpolation
    • Extrapolation
  • Connected entities
    • Overview
    • Entity references
    • Parent-child relationships
    • CoherenceNode
  • Simulators
    • Overview
    • Client vs. simulator logic
    • Build and deploy
    • Simulator load balancing
    • Room Simulators
    • World Simulators
    • Simulator Slugs
    • Testing Simulators Locally
  • Tutorial project
    • Get the Tutorial Project
    • Start Tutorial
      • 1. Transforms
      • 2. Physics
      • 3. Persistence
      • 4. Animation and Variables
      • 5. AI Navigation
      • 6. Network Commands
      • 7. Team based
      • 8. Connected Entities
  • Game Services
    • Game account
    • Key-value store
    • Matchmaking
  • Developer Portal
    • Overview
    • Dashboard
    • Enabling Game Services
    • Configure Rooms
    • Manage Worlds
  • API reference
    • Network SDK
      • CoherenceSync
      • MonoBridge
      • LiveQuery
      • Archetype
      • Sample UI
      • Settings Window
      • Custom Bindings (Advanced)
      • PlayResolver
      • Rooms
      • Worlds
    • Cloud API
      • API tokens and keys
      • Game account
      • Key-value store
      • Matchmaking
    • Replication Server
    • Simulation Server
  • Schema reference
    • Overview
    • Specification
    • Field Settings
    • Archetypes and LOD-ing
  • Resources
    • Downloads
    • SDK Update Guide
    • Video Tutorials
    • Glossary
    • CLI Utilities
    • Simulator CLI arguments
    • Helper Scripts
    • Troubleshooting
  • Community
    • Discord
  • Additional information
    • Pricing
    • SLA
    • Unreal Engine support
    • WebGL
    • Peer-to-Peer (P2P)
    • Known Issues
    • Changelog
Powered by GitBook
On this page
  • Running the editor as a simulator
  • Running a simulator build locally
  • Connecting a simulator to a room

Was this helpful?

Export as PDF
  1. Simulators

Testing Simulators Locally

Before deploying a simulation server testing and debugging locally can significantly improve development and iteration times. There are a few ways of accomplishing this.

Running the editor as a simulator

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:

"Editor Path"
--coherence-simulation-server 
--coherence-ip 127.0.0.1 
--coherence-port 32001 
--coherence-world-id 0 
--coherence-room-id [room-id]
--coherence-unique-room-id [room-uid]

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

Running a simulator build locally

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.

"simulator build path"
--coherence-simulation-server 
--coherence-ip 127.0.0.1 
--coherence-port 32001 
--coherence-world-id 0 
--coherence-room-id [room-id]
--coherence-unique-room-id [room-uid]

This allows you to test a simulator build before it is uploaded or if you are having trouble debugging it.

Connecting a simulator to a room

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.

Last updated 3 years ago

Was this helpful?

To learn more about simulators see .

To learn more about building simulator build see .

Simulators
Simulators Build and Deploy