Version:

AzNetworking and Multiplayer Gem Settings

Overview

This page documents console variables (CVARs) and other settings that can control Networking and Multiplayer behavior in Open 3D Engine (O3DE).

Networking commands

Use the following console functor (cfunc) commands to control the connection of clients to servers for networked games or simulations.

SettingDescriptionParametersNotes
hostOpens a multiplayer connection as a host for other clients to connect to.
connectOpens a multiplayer connection to a host.(Optional) IP address and port, separated by ‘:’. For example, 0.0.0.0:1234.Defaults to cl_serveraddr:cl_serverport.
disconnectDisconnects any open multiplayer connections.
LoadLevelUnloads the current level and loads a new one with the given asset name.
Used to setup the initial level for the game or simiulation.
(Required) Path to a level file.Command is not specific to network or multiplayer but used for all games and simulations.
sv_launch_local_clientLaunches a local client and connects to this host server.Only works if currently hosting.

These console commands can be executed dynamically via the console command line or placed within a console command configuration file.

When using a console command configuration file, it is common practice to place the file in the project root directory. Use .cfg as the filename suffix. Commands will be executed in the order written.

For a networked game or simulation, a typical server configuration file should contain:

host
LoadLevel <path to Level>

A typical client configuration file should contain:

connect

Console commands in configuration files can be passed to client and server launchers using the console-command-file option. Example:

MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg

Client settings

The cl CVARs control client behavior.

SettingDescriptionDefaultNotes
cl_clientportThe port to bind to for game traffic when connecting to a remote host, a value of 0 will select any available port.0
cl_serveraddrThe address of the remote server or host to connect to.LocalHost
cl_serverportThe port of the remote host to connect to for game traffic.33450
cl_InputRateMsRate at which to sample and process client inputs.33 ms
cl_MaxRewindHistoryMsMaximum number of milliseconds to keep for server correction rewind and replay.2000 ms
cl_renderTickBlendBaseThe base used for blending between network updates, 0.1 will be quite linear, 0.2 or 0.3 will slow down quicker and may be better suited to connections with highly variable latency.0.15

Client to server connection settings

SettingDescriptionDefaultNotes
cl_ClientEntityReplicatorPendingRemovalTimeMsHow long to wait prior to removing an entity for the client through a change in the replication window, entity deletes are still immediate.10000 ms
cl_DefaultNetworkEntityActivationTimeSliceMsMax Ms to use to activate entities coming from the network, 0 means instantiate everything.0 ms
cl_ClientMaxRemoteEntitiesPendingCreationCountMaximum number of entities that we have sent to the client, but have not had a confirmation back from the client.4294967295

Debug settings

SettingDescriptionDefaultNotes
cl_DebugHackTimeMultiplierScalar value used to simulate clock hacking cheats for validating bank time system and anticheat.1.0Non-release builds
cl_EnableDesyncDebuggingIf enabled, debug logs will contain verbose information on detected state desyncs.TrueNon-release builds
cl_DesyncDebugging_AuditInputsIf true, adds inputs to audit trail.FalseNon-release builds
cl_PredictiveStateHistorySizeControls how many inputs of predictive state should be retained for debugging desyncs.120Non-release builds only

Server settings

The sv CVARs control server behavior.

SettingDescriptionDefaultNotes
sv_mapThe map the server should load.None
sv_portThe port that Multiplayer Gem will bind to for game traffic.33450
sv_portRangeThe range of ports the host will incrementally attempt to bind to when initializing.999
sv_protocolThis flag controls whether we use TCP or UDP for game networking.Udp
sv_DedicatedCPUPercentTarget CPU usage when running as a dedicated server.0Disabled by default.
sv_DedicatedCPUVarianceHow much the CPU can vary from sv_DedicatedCPUPercent.10
sv_DedicatedMaxRateMaximum update rate when running as a dedicated server.30
sv_isDedicatedWhether the host command creates an independent or client hosted server.True
sv_isTransientWhether a dedicated server shuts down if all existing connections disconnect.True
sv_serverSendRateMsMinimum number of milliseconds between each network update.50 ms
sv_versionMismatch_autoDisconnectDetermines if a mismatched connection will automatically terminate. It’s recommended to keep this true; even minor differences between the version of a multiplayer component can cause unexpected behavior.True

Server to client connection settings

SettingDescriptionDefaultNotes
sv_ClientEntityReplicatorPendingRemovalTimeMsHow long to wait prior to removing an entity for the client through a change in the replication window, entity deletes are still immediate.10000 ms
sv_ClientMaxRemoteEntitiesPendingCreationCountMaximum number of entities that we have sent to the client, but have not had a confirmation back from the client.4294967295
sv_ClientMaxRemoteEntitiesPendingCreationCountPostInitMaximum number of entities that we will send to clients after gameplay has begun.4294967295

Replication window settings

SettingDescriptionDefaultNotes
sv_ReplicateServerProxiesEnable sending of ServerProxy entities to clients.True
sv_MaxEntitiesToTrackReplicationThe default max number of entities to track for replication.512
sv_MinEntitiesToReplicateThe default min number of entities to replicate to a client connection.128
sv_MaxEntitiesToReplicateThe default max number of entities to replicate to a client connection.256
sv_PacketsToIntegrateQosThe number of packets to accumulate before updating connection quality of service metrics.1000
sv_BadConnectionThresholdThe loss percentage beyond which we consider our network bad.0.25
sv_ClientReplicationWindowUpdateMsRate for replication window updates.300 ms
sv_ClientAwarenessRadiusThe maximum distance entities can be from the client and still be relevant.500.0

Rewind settings

SettingDescriptionDefaultNotes
sv_RewindVolumeExtrudeDistanceThe amount to increase rewind volume checks to account for fast moving entities.50

Editor server settings

The editorsv settings control how a server will be launched during the “play-in-editor” (CTRL+G) mode.

SettingDescriptionDefaultNotes
editorsv_isDedicatedWhether to init as a server expecting data from an Editor. Do not modify unless you’re sure of what you’re doing.False
editorsv_portThe server port the Editor will connect to when entering play-mode.33450Only valid when editorsv_enabled is true.
editorsv_serveraddrThe address of the server the Editor will connect to when entering play-mode.LocalHostOnly valid when editorsv_enabled is true.
editorsv_processThe file path to your project’s ServerLauncher. If editorsv_enabled and editorsv_launch is true, the Editor will attempt to launch its own server when entering game mode. By default it looks for the ServerLauncher executable inside the same folder where Editor lives; editorsv_process overrides that path.""
editorsv_rhi_overrideIf editorsv_launch is true, the server will use the same render hardware interface (rhi) that the editor is using. For example, if the editor is using DX12, then the new server will be launched using DX12. editorsv_rhi_override can be used to override the rhi.""If you don’t need to see the launched server’s graphics then set editorsv_rhi_override=null, the null renderer.
editorsv_enabledIf true the Editor will attempt to connect to a Multiplayer server upon entering game mode.False
editorsv_clientserverWhether the Editor should act as the server and a client at the same time, without launching a dedicated server process.FalseOnly applies if editorsv_enabled is also true.
editorsv_hiddenIf true the Editor will automatically launch a server upon entering game mode. Set editorsv_hidden to true if you want the launched server to be started as a background process without any visible window.False
editorsv_launchIf true the Editor will automatically launch its own server upon entering game mode.TrueOnly applies if editorsv_enabled is also true. If starting your own editor-server remember to set editorsv_isDedicated to true on the server
editorsv_connectionMessageFontSize0.7

Dual client server settings

The bg settings control behavior on both the client and server.

SettingDescriptionDefaultNotes
bg_RewindDebugDrawIf true enables debug draw of rewind operations.False
bg_replicationWindowImmediateAddRemoveUpdate replication windows immediately on visibility Add/Removes.True
bg_multiplayerDebugDrawEnables debug draw for the Multiplayer Gem.False
bg_replicationWindowImmediateAddRemoveUpdate replication windows immediately on visibility Add/Removes.True
bg_RewindPositionToleranceDon’t sync the NVIDIA PhysX entity if the square of delta position is less than this value.0.001
bg_AssertNetBindOnDeactivationWithoutMarkForRemovalFalse
bg_hierarchyEntityMaxLimit16
bg_DrawArticulatedHitVolumesEnables debug draw of articulated hit volumes.False
bg_DrawDebugHitVolumeLifetimeThe lifetime for hit volume draw-debug shapes.0.0
bg_RewindOrientationToleranceDon’t sync the NVIDIA PhysX entity if the square of delta orientation is less than this value.0.001

Networking settings

The net settings control networking behavior.

AzNetworking layer

SettingDescriptionDefaultNotes
net_maxPacketTrackTimeMsMaximum time to track any particular packet ID before giving up.2000
net_rttIncreaseOnPacketLossScalar amount to increase round trip time estimates by on packet loss.1.2
net_TcpCompressorTCP compressor to use. WARNING: Similar to encryption this needs to be set once and only once before creating the network interface.None
net_TcpUseEncryptionEnable encryption on TCP-based connections.False
net_UseDtlsCookiesEnables DTLS cookie exchange during the connection handshake.False
net_UdpMaxUnackedPacketCountMaximum packets to receive before forcing a heartbeat packet for acking.10
net_UdpFragmentTimeoutMsMilliseconds to retain chunks of incomplete unreliable fragmented packets before timing them out.5000 ms
net_UdpCompressorUDP compressor to use. WARNING: Similar to encryption this needs to be set once and only once before creating the network interface.None
net_MinPacketTimeoutMsMinimum time to wait before timing out an unacked packet.200 ms
net_UdpDefaultTimeoutMsTime in milliseconds before we timeout an idle UDP connection.10 * 1000 ms
net_UdpPacketTimeSliceMsThe number of milliseconds to allow for packet processing.8 ms
net_UdpTimeoutConnectionsShould code hold timeout UDP connections.True
net_UdpUseEncryptionEnable encryption on UDP-based connections.False
net_RttFudgeScalarScalar value to multiply computed RTT by to determine an optimal packet timeout threshold.2.0
net_MaxTimeoutsPerFrameMaximum number of packet timeouts to allow to process in a single frame.1000
net_FragmentedHeaderOverheadA fudge overhead value to take out of fragmented packet payloads.32
net_SslInflationOverheadA SSL fudge overhead value to take out of fragmented packet payloads.32
net_UdpUnackedHeartbeatsThe number of heartbeats to attempt to send to keep a connection alive before giving up.5
net_UdpMaxReadTimeMsThe amount of time to allow the reader thread to read data off registered sockets.10 ms
net_MaxReliablePacketsInWindowThe maximum number of reliable packets to allow to be queued up before triggering a disconnect.16384
net_UdpIgnoreWin10054If true, will ignore 10054 socket errors on windows.True
net_UdpRecvBufferSizeDefault UDP socket receive buffer size.1 * 1024 * 1024
net_UdpSendBufferSizeDefault UDP socket send buffer size.1 * 1024 * 1024
net_validateSerializedTypesCauses an Assert when an attempt at TypeValidatingSerializer serialization results in a type or variable name mismatch.FalseIncreases bandwidth utilization to support mismatch detection.

Multiplayer layer

SettingDescriptionDefaultNotes
net_EntityReplicatorRecordsMaxNumber of allowed outstanding entity records.45Requires Multiplayer Gem
net_DefaultEntityMigrationTimeoutMsTime to wait for a new authority to attach to an entity before we delete the entity.1000 msRequires Multiplayer Gem
net_EntityReplicatorRecordsMaxNumber of allowed outstanding entity records.45Requires Multiplayer Gem
net_DebugEntities_ShowBandwidthDisplay bandwidth information.False
net_DebutAuditTrail_HistorySizeSize of audit history.20
net_DebugEntities_WarnAboveKbps10.f
net_DebugEntities_BelowWarningColorGrey
net_DebugEntities_WarningColorRed
net_DebugEntities_ShowAboveKbps1.f

TLS/DTLS certificate settings

SettingDescriptionDefaultNotes
net_SslCertCiphersThe cipher suite to use when using cert based key exchange.ECDHE-RSA-AES256-GCM-SHA384
net_SslExternalCertificateFileThe filename of the EXTERNAL (server to client) certificate chain in PEM format.""
net_SslExternalContextPasswordThe password required for the EXTERNAL (server to client) private certificate.""
net_SslExternalPrivateKeyFileThe filename of the EXTERNAL (server to client) private key file in PEM format.""
net_SslInternalCertificateFileThe filename of the INTERNAL (server to server only) certificate chain in PEM format.""
net_SslInternalContextPasswordThe password required for the INTERNAL (server to server only) private certificate.""
net_SslInternalPrivateKeyFileThe filename of the INTERNAL (server to server only) private key file in PEM format.""
net_RotateCookieTimerNumber of milliseconds to wait before generating a new DTLS cookie for handshaking.50 ms
net_SslAllowSelfSignedIf enabled, self-signed certs will not cause a validation error if they are otherwise considered trusted.True
net_SslEnablePinningIf enabled, the public certificates on the local and remote endpoints will be compared to ensure they match exactly.True
net_SslValidateExpiryIf enabled, expiration dates on the certificate will be checked for validity.True
net_SslMaxCertDepthThe maximum depth allowed for cert chaining validation.3

Debug settings

SettingDescriptionDefaultNotes
net_DebugCheckNetworkEntityManagerEnables extra debug checks inside the NetworkEntityManager.FalseRequires Multiplayer Gem
sv_versionMismatch_sendManifestToClientDetermines if the server will send all its individual multiplayer component version information to the client when there’s a mismatch. Upon receiving the information, the client will print which components are different to the console. It’s recommended to set to false for release builds. This is to prevent clients having knowledge to any multiplayer component information that should be kept private (component names and version hashes).True

Other useful settings

The following settings can be passed as command line arguments to control server performance.

SettingDescription
rhiAdd -rhi=null to the server launcher args to turn on null renderer to avoid rendering costs.
NullRendererAdd -NullRenderer to the server launcher args to turn off RPI ticking to save on performance when using null renderer.