World Mode

Running a Replication Server in World mode is intended for long-term, large, and persistent game sessions. There is only one project active on the replication server so the schema for the project must be indicated when launching the application using the --schema option.

Command Syntax

replication-server world --schema PATH [options]

Replication Server World Mode Options

The following is an overview of options used when self hosting the replication server in world mode.

Basic Options

  • --help : prints out the options available for the mode. Usage: replication-server --help world

  • --eula : prints out the EULA

Basic Network Configuration

  • --udp-port : The port to listen to for UDP connections Default: 32001

  • --tcp-port: The port to listen to for TCP connections Default: 32001

Ping Service Configuration

  • --ping-port: The port for ping service to listen to. Service disabled if 0. Default: 0

  • --ping-rate-limit: Maximum pings per second for the ping service. Use 0 to disable rate limiting. Default: 1000

WebRTC Network Configuration

  • --signalling-port: The port for WebRTC signalling (offer/answer exchange, ICE candidates) Default: 32002 Note: coherence Cloud provides WebRTC signalling but when self-hosting you have to provide your own signalling service and STUN / TURN.

  • --web-port: The port to listen to for WebRTC connections Default: 32003

  • --public-ip: The public IP for WebRTC connections via NAT Default: ""

Connection Configuration

  • --send-frequency: The packet send frequency in packets per second. Default: 20

  • --recv-frequency: The packet receive frequency in packets per second. This is the maximum rate at which the replication server will receive packets on a connection. If a connection sends packets at a higher rate it will be throttled and potentially disconnected. Default: 60

  • --disable-throttling: This option will disable packet receive rate throttling. Best used in client hosting with 3rd party relays that support DDOS protection. Default: throttling is enabled by default, this option has no parameters.

  • --disconnect-timeout: This sets the timeout in ms for disconnecting a client after not receiving any packets. Default: 5000 Notes: coherence connections maintain a keep-alive system that ensures that as long as a connection is possible that the connection is kept alive.

Environment Configuration

  • --schema: Specifies the coherence schema used for serialization of entities, components, and commands. Default: "" Notes: The string parameter is a CSV string of paths to .schema files. See schema explanation.

  • --env: Specifies the runtime environment. Default: "enduser" Values: (prod, staging, test, dev, enduser) Notes: The environment is included with metrics output and some logs. "prod" and "staging" are equivalent with respect to security. In development, the "dev" and "test" environment options remove some authentication restrictions as does "enduser" so they should not be used in a public production setting. "enduser" should only be used when client hosting. When developing, use "dev" as "test" is primarily for coherence internal testing.

  • --secret: The secret used for API request and client authentication. Default: "local-development" Notes: The default should be used for local development only. For API requests, the request bearer authentication must match the secret. See API reference for more info. See Authentication for more details on the use of --secret.

  • --room-secret: This secret is used to authenticate a client connecting as a host. Default: ""

  • --max-entities: The maximum number of entities supported by this replication server. Default: 65536 Notes: it is reasonable to tune this down if there's a well defined, game-specific, max number of entities to save on memory overhead.

  • --max-clients: The maximum number of clients (not counting simulators) allowed to connect. Default: 200 Notes: The maximum number of clients is capped at 100 unless the unlock token is supplied using the --unlock-token option.

  • --max-queries-per-client: The maximum number of queries allowed per client. Default: 15 Notes: See Areas of Interest to learn more about query types. This maximum is the number of total queries active not the number of times queries are applied. Too many queries can degrade replication server performance, so limiting the number of queries per connection can prevent some malicious client activities.

  • --min-query-distance: The minimum amount of change in Unity units to a live query that will result in the query re-processing the entire set of entities. Default: 0.1 Notes: this value applies to the position as well as the radius. If there are a large number of entities or a large number of players, then tuning this value will affect performance. Generally, very large or slow-moving queries can have a larger value.

  • --auto-shutdown-timeout-ms: Specifies the number of milliseconds before a replication server with no connections automatically shuts down. Default: 0 Notes: 0 disables the auto-shutdown, otherwise it is a minimum of 10000ms.

  • --unlock-token: Internal to coherence, it is used to define the project and organization. OK to leave blank. Default: ""

  • --project-id: Specifies the project id. This is output in logs to help differentiate multiple replication servers and collect metrics by project. See Monitoring. Default: "local"

  • --host-authority-features: CSV string that defines which advanced simulator authority features are supported. Default: "" Values: [create-entities,validate-connection]

  • --local-ip-override: Specifies the local IP for this instance of the replication server. Default: "127.0.0.1" Note: Used with WebRTC to associate a specific IP when auto-detection won't work. Also used in Windows to bypass localhost firewall restrictions when testing.

  • --version-override: Overrides the replication server version. Used for internal debugging only. Default: ""

Logging Configuration

  • --log-target: Enable logging context sensitive logs to the console and / or files. Default: "" Notes: The option parameter is a single LOG_TARGET or a CSV string of LOG_TARGETS. The syntax of a LOG_TARGET is: (console|file):(plain|colored|json):(trace|debug|info|warn|error):[filePath] It is also possible to have this parameter appear more than once each with a single LOG_TARGET instead of using CSV. Usage: --log-target "console:colored:info"

  • --log-stats-freq: The frequency, in seconds, that enabled stats are logged to the log targets. Default: 0 Notes: a frequency of 0 means the stats are not logged.

Monitoring Configuration

  • --use-p-prof: Enables Golang pprof Default: disabled by default, this option has no parameters, just include to enable.

  • --stats-port: The port for requesting statistics and profiling. See Monitoring. Default: 32000

  • --out-stats: The frequency, in seconds, of updates to profiling stats. See Monitoring. Default: 1

  • --api-port: The REST API port. See API Reference for more info. Default: 32004

  • --analytics-enabled: Enables coherence telemetry in "dev" and "enduser" environments. Default: disabled by default, this option has no parameters.

Note: experimental and deprecated options are not detailed here. For more info on those, please contact [email protected]

Last updated

Was this helpful?