Skip to content

Settings reference

Every setting you can give a multiplayer session is a public field on one of a few classes. This page lists them all: name, type, default and the line of the declaration. It does not repeat how the pieces fit. For that, read Seats, joining and waiting and Security notes.

The Multiplayer add-on compiles on Unity 6000.0 and 6000.6. Two players were tested on 6000.0 (an editor host and a development player); not yet on 6000.6, over Relay or with IL2CPP.
  • You want to know what a field does before you change it.
  • A player is refused or dropped and you suspect a limit.
  • You write the code that fills HostSettings or ClientSettings yourself.

The defaults are made for honest players. Change what your game needs and leave the rest.

You make a HostSettings or a ClientSettings object, fill it, and give it to MultiplayerSession.StartHost or MultiplayerSession.StartClient. Both classes derive from SessionSettings. With Netcode for GameObjects you can instead fill the Netcode Session component and call its StartHost() or StartClient(); the component builds the settings objects for you.

With a transport of your own, call settings.UseTransport(transport) after you set everything else. It returns false, and changes nothing, when the transport is null, its role does not match the settings (a host needs IsServer true, a client false), or its packets are smaller than 256 bytes plus the header. Otherwise it lowers SliceBytes to fit, raises BytesPerFrame to at least one slice, and stores the transport. See Bring your own transport.

Example, not compiled. The member names come from the declarations below.

var host = new HostSettings
{
MaxPlayers = 3,
Password = "a long phrase",
JoinActors = JoinActorRule.ListedOnly,
};
host.PlayableActors.Add("aldric"); // an actor ID of your database
host.Presentation.CalendarHold = RemoteDialogueHold.Limited;

Both sides share these. sources: Runtime/Session/SessionSettings.cs.

Field Type Default What it does Line
SliceBytes int 16 * 1024 Message bytes per slice on the wire. UseTransport lowers it to fit the transport. 119
Window int 16 Slices sent and not yet acknowledged, per connection. 122
BytesPerFrame int 64 * 1024 Bytes handed to the transport per connection and frame. 125
KeepAliveSeconds double 2 Seconds without anything sent before a keep-alive goes out. 128
TimeoutSeconds double 15 Seconds without anything received before the connection counts as lost. 131
SceneActorIds List<string> null The scene actor IDs the content hash uses. Null: the scene actors registered when the session starts. 134
Clock Func<double> null Source of real seconds for keep-alives, timeouts and rate limits. Null: a stopwatch. 137
AssetTable AssetTable null The asset table. Both machines must use the same one. Null: assets travel by type and name, and every Signal is heard on the host only. 181

SessionSettings also has a read-only Transport, set by UseTransport or by the NGO adapter, and the constant PacketHeaderBytes. The session does not start without a transport.

sources: Runtime/Session/SessionSettings.cs. Types are as declared. A default of 0 or false means the field has no initializer.

Field Type Default What it does Line
JoinActors JoinActorRule JoinActorRule.Free Which character a new player may ask for (JoinActorRule). 224
PlayableActors List<string> empty The character IDs a new player may choose. Empty: every character the JoinActors rule lets through. 231
AllowJoinWithoutActor bool false On: a new player may join with no character and wait in a seat of their own. 248
UnseatedRejoinSeconds double 10 Seconds a seat without a character is kept after its player left. 0: removed at once. 254
UnseatedTimeoutSeconds double 0 Seconds a connected seat may wait without a character before it is removed. 0: no limit. 260
MaxPlayers int 7 The most remote players at once. 7 makes 8 with the host’s own player. 263
Password string empty text The password a client must give. Empty: none. 266
Accepting bool true False: refuse new players. Rejoins with a key still work. 338
Field Type Default What it does Line
Scene string empty text The game scene the clients load. Empty: the host’s own. 269
FollowActiveScene bool true True: the clients are told the name of the scene that is active after the host’s world is reset by a scene loaded alone. 501
Dedicated bool false Nobody plays on the host. The session refuses to start while this machine has a player. Takes one remote player more than MaxPlayers. 494
HostPlaysFair bool true The host’s own menus and texts read the world as the host’s player would on a client. 408
Field Type Default What it does Line
Policy SeatPolicy empty A SeatPolicy that decides per seat. Never null. 390
AllowClientTriggers bool false False: a client’s IM.Trigger is refused. 396
AllowClientSpeed bool false False: only the host sets the clock’s speed and pauses. 402
Presentation PresentationSettings empty What the host shows on the players’ machines (PresentationSettings). 510
Field Type Default What it does Line
MaxQueueBytes long 16777216 (16 MB) Bytes that may wait to be sent per client before it is dropped. 275
AckTimeoutSeconds double 15 Seconds a client may leave sent slices unacknowledged before it is dropped. 281
JoinCooldownSeconds double 2 Seconds at least between two joins served to one client. 287
MaxAcksPerFrame int 8 Acknowledgement packets a client may send in one host frame. 316
PartRecords int 2048 Records at most in one message of a join or a frame’s changes. A larger one goes in parts. 356
EncodeMsPerFrame double 4 Milliseconds of the host’s frame that encoding and compressing waiting parts may take, over all clients. 363
MinPartRecords int 128 Records at least in one part. 370
MaxQueuedFrames int 600 Frames of changes waiting to be encoded for one client. Past it the client is served a fresh join. 0: no limit. 376
MaxQueuedRecords int 400000 Records of changes waiting to be encoded for one client. 0: no limit. 379
HeirSeconds double 1 Seconds at least between two looks at the heirs of role holders. 0: every frame. 344
RunSeconds double 1 Seconds at least between two looks at the odds, objective and description of running schemes clients know. 0: every frame. 350
HeirsPerFrame int 512 Role holders whose heirs one frame looks at. 0: all at once. 382
RunsPerFrame int 64 Running schemes whose odds and texts one frame looks at. 0: all at once. 385
Field Type Default What it does Line
HelloSeconds double 10 Seconds a new connection has to send its hello before it is closed. 290
MaxPendingConnections int 16 Connections that may wait for their hello at once. 298
MaxPendingPerAddress int 4 Connections of one address that may wait for their hello at once. 305
FirstDataSeconds double 3 Seconds a new connection may stay silent before it is closed. 0: only HelloSeconds counts. 313
Field Type Default What it does Line
MessagesPerSecond double 30 Messages per second a client may send. More are dropped and counted. 319
MessageBurst double 60 Messages a client may send at once above the rate. 322
CommandsPerSecond double 5 Commands (start a scheme, trigger, speed, language) per second and seat. 411
CommandBurst double 10 Commands a seat may send at once above the rate. 414
KeysPerSecond double 20 Key reports per second and seat. 417
KeyBurst double 40 Key reports a seat may send at once above the rate. 420
QueriesPerSecond double 10 Queries (availability, opinion, odds, line) per second and seat. 423
QueryBurst double 20 Queries a seat may send at once above the rate. 426
CustomPerSecond double 20 Your own messages per second and seat. 429
CustomBurst double 40 Your own messages a seat may send at once above the rate. 432
DialogueAnswersPerSecond double 10 A player’s answers about dialogue windows per second and seat. 435
DialogueAnswerBurst double 20 Dialogue answers a seat may send at once above the rate. 438
LanguagesPerSecond double 0.5 Language changes per second and seat. 504
LanguageBurst double 3 Language changes a seat may send at once above the rate. 507
MaxDrops int 200 Offences counted for a client before it is disconnected (with DisconnectOffenders). 332
OffencesForgivenPerMinute double 20 Offences forgiven per minute. 335
DisconnectOffenders bool true True: a client whose offences pass MaxDrops is disconnected. False: they are only dropped and counted. 444
Field Type Default What it does Line
HellosPerKeyPerMinute int 10 Hellos one player key may send per minute. More are refused. 447
HellosPerAddressPerMinute int 30 Hellos one address may send per minute, when the transport knows addresses. More are refused. 450
PasswordFailuresPerAddress int 5 Wrong passwords one address may give within a minute. One more and the address is refused. 458
PasswordBlockSeconds double 60 The first block of an address after too many wrong passwords. Doubled for each block in a row. 461
PasswordBlockMaxSeconds double 600 The longest block of an address. 464
PasswordFailuresPerMinute int 30 Wrong passwords from all addresses together within a minute. One more and every new try waits. 471
PasswordPauseSeconds double 10 How long new password tries wait once PasswordFailuresPerMinute is passed. 474
PasswordTrickleSeconds double 2 During a pause, about one try per this many seconds still goes through. 0: none. 483
Value What it means
Free The default. A living character nobody plays (only a listed one when PlayableActors lists any). Schemes already running in which another player takes part stay hidden from the newcomer for good; the newcomer’s character answers those dialogues as an NPC.
ListedOnly As Free, but only the characters PlayableActors lists. Nobody while it is empty.
AnyFree Any character nobody plays, dead or alive. Nothing is withheld, so the player sees every scheme that character takes part in. The least safe choice.

A player who returns with a seat key always gets their own seat back, whatever this says. sources: SessionSettings.cs (the enum and its comments).

sources: Runtime/Session/SessionSettings.cs.

Field Type Default What it does Line
WantedActorId string empty text The character this player wants (a new player). Ignored for a rejoin with a key. Empty: join without one. 694
Password string empty text The host’s password. 697
IdentityToken string empty text Your game’s proof of who this player is, for the host’s SeatPolicy.Identify. At most 512 characters. 706
Language string empty text This player’s language. 709
ReportableKeys List<UnityEngine.KeyCode> empty Keys this machine also reports when the host asks, beyond those an On Key Press node of the database waits for. 717
AllowedScenes List<string> empty The scenes the host may make this machine load. Empty: any scene of the build. 724
Field Type Default What it does Line
PlayerKey byte[] null The key of a seat this player had (a rejoin). Null for a new player. 726
RejoinSession string empty text With RejoinSeat: the host session that gave PlayerKey, for a rejoin by proof. SeatKeyStore.Apply fills it. 735
RejoinSeat int 0 The seat of a rejoin by proof. 738
KeptSessions List<string> empty The host sessions of that host this machine keeps a key for. SeatKeyStore.Apply fills it. 745
Field Type Default What it does Line
LoadScene SceneLoader null Your function that loads the scene the host names. Null: the scene is loaded already. 748
ReturnToMenu Action<SessionEndInfo> null Called once when the session ends after this machine became a client, so the game can go back to its menu. 757
LoadSeconds double 120 Seconds LoadScene may take before the session gives up. 0: no limit. 763
JoinSeconds double 120 Seconds this machine waits for the host’s world before the session gives up. 0: no limit. 770
Field Type Default What it does Line
MaxDesyncs int 3 Desyncs allowed within DesyncWindowSeconds. One more ends the session with ProtocolError. 776
DesyncWindowSeconds double 30 The window of MaxDesyncs, in seconds. 779
RejoinDelaySeconds double 0.5 Seconds this machine waits before it asks for a fresh join after a desync. Doubled for each recent desync. 782
AnswerTimeoutSeconds double 10 Seconds a request to the host (a scheme start, a query) may wait for its answer. 785
AvailabilitySeconds double 1 Seconds at least between two availability questions about one target. 788
QueriesPerSecond double 8 Queries this machine sends per second at most. Keep it at or below the host’s QueriesPerSecond. 795
QueryBurst double 16 Queries this machine may send at once above QueriesPerSecond. 798

What the host shows on the players’ machines. It is a field of HostSettings, so you reach it as hostSettings.Presentation. sources: Runtime/Presentation/PresentationHost.cs.

Field Type Default What it does Line
HoldCapSeconds float 120 Seconds a window’s player may hold its time limit (covered or hidden windows), in all, per window. 40
UnreportedGraceSeconds float 10 Without a “choices shown” report, the time limit starts this long after the estimated writing time. 43
CalendarHold RemoteDialogueHold RemoteDialogueHold.Limited How a remote dialogue holds the days (RemoteDialogueHold). 46
CalendarHoldSeconds float 30 The longest a remote dialogue holds the days with Limited. 49
ChoiceLookSeconds float 1 Seconds between two looks at the tooltips and odds of open remote windows. 52
AbsentAtLoad AbsentAtLoad AbsentAtLoad.WaitForPlayer What a dialogue a host load brings back does for a player who is away (AbsentAtLoad). 58
AwaitAbsentSeconds float 0 Seconds a waiting player may stay away, counted from the load. 0: no limit. 65
RemoteDialogueHold What it means
Never The world goes on while a remote player reads.
Limited At most CalendarHoldSeconds per dialogue, then the world goes on. The default.
UntilAnswered Until the dialogue is answered, as for this machine’s player. One player can hold the world.
AbsentAtLoad What it means
WaitForPlayer The default. The dialogue waits for that player, whose seat is kept, and shows when they rejoin. Only that run waits; the days go on.
AnswerAsNpc The dialogue is answered at once as the character’s NPC would answer it.

HoldCapSeconds is the README’s “120 seconds in all” for a limited dialogue. See Saving in multiplayer for what AbsentAtLoad does after a load.

SeatPolicy is a class you derive from. Set HostSettings.Policy to your instance. Each method runs on the host, on the main thread, and a policy that throws refuses the player. sources: Runtime/Session/SessionSettings.cs, lines 518 to 604.

Method Default answer
virtual bool AllowAccomplices(int seat, Actor conspirator, IReadOnlyList<Actor> accomplices) True only for an empty list: no accomplices from a player’s machine at all.
virtual bool AllowSpeed(int seat, HostSettings settings) settings.AllowClientSpeed.
virtual bool AllowTrigger(int seat, Actor player, Scheme run, string triggerName) True only when the player’s character is the run’s Conspirator. Asked only when AllowClientTriggers is on and the graph waits for that name.
virtual bool AllowStart(int seat, Actor conspirator, Scheme scheme, Actor target) False for a scheme the player’s lists do not show (Show in lists is Never, or its conditions are not met for conspirator and target), true otherwise. The host reads the conditions as that player’s own view has the world. Asked before the requirements.
virtual bool AllowJoin(JoinRequest request) True for a rejoin; for a new player, the answer of JoinActors and PlayableActors (request.ActorAllowed).
virtual string Identify(JoinRequest request) An empty text: not identified.

Whatever a policy answers, a client never names a character another human plays as an accomplice and never acts for a character it does not play. A JoinRequest carries ActorId, Rejoin, Claim, Seat, Address, Language, TransportIdentity, IdentityToken, Identity, SeatIdentity, ActorAllowed, ActorRefusal and a settable Refusal (the words the player sees). IdentityToken is unchecked; do not trust it until your own code has.

Settings of the NGO adapter. You pass them to NetcodeSession.StartHost(manager, settings, options) or NetcodeSession.StartClient(manager, settings, options). Both calls take the options as an optional last argument. The adapter compiles only when NGO is installed. Set the transport’s address and port first (UnityTransport.SetConnectionData), as the XML comment of NetcodeSession.StartHost says. sources: Netcode/NetcodeTransport.cs, Netcode/NetcodeWire.cs, Netcode/NetcodeSession.cs.

Field Type Default What it does Line
MaxPacketBytes int 32768 (32 * 1024) The largest packet, 1 KB to 256 KB. The session’s slice size is lowered to fit. 20
StartNetworkManager bool true True: the adapter starts the NetworkManager and shuts it down when the session ends. False: your game started it already. 27
ServerOnly bool false A host without a local NGO client (StartServer instead of StartHost). 30
GameApproval Action<ConnectionApprovalRequest, ConnectionApprovalResponse> null Your own approval rule, called after the Intrigues checks passed. 40
PlayerObjects NetcodePlayerObjects NetcodePlayerObjects.AsTheGameSets Whether NGO creates player objects for the clients the session lets in (NetcodePlayerObjects). 43
PendingClientSeconds int 5 A host the adapter starts lowers NGO’s ClientConnectionBufferTimeout to this many seconds when it is larger. 0: leave it. 49
NetcodePlayerObjects What it means
AsTheGameSets NGO’s default (a player object when the NetworkManager has a Player Prefab), then your approval rule may change it.
Never No player object. Intrigues needs none.
Always Always. Your approval rule cannot turn it off.

Intrigues / Multiplayer / Netcode Session is the class NetcodeSessionStarter. Its fields show in the inspector under the names Unity makes from the field names (startOnPlay becomes Start On Play). sources: Netcode/NetcodeSessionStarter.cs.

Field Default Notes
networkManager empty Empty: NetworkManager.Singleton. (line 49)
address 127.0.0.1 The host’s address a client connects to. (53)
port 7777 Host listens and client connects here. (57)
listenAddress empty Empty: every IPv4 interface. Use 127.0.0.1 for this machine only. (61)
startOnPlay None None, Host or Client. (65)
readCommandLine true Reads -intriguesHost, -intriguesClient, -intriguesAddress, -intriguesPort, -intriguesActor, -intriguesPassword. (69)
keepAcrossScenes true Keeps the object and the NetworkManager when a scene loads. (73)
maxPlayers 7 Host. (78)
hostPassword empty Host. (82)
scene empty Host. Empty: the host’s active scene. (86)
serverOnly false Host. NGO starts a server, not a host. (90)
wantedActorId empty Client. (95)
password empty Client. (99)
language empty Client. Empty: the game’s current language. (103)
clientScene LoadHostScene Client. The other value is AlreadyLoaded. (107)
rejoinWithLastKey true Client. A later Start Client to the same host and port rejoins with the key that host gave. (111)
allowedScenes empty Client. Empty: any scene of the build. (115)
sliceBytes 16384 Wire. (120)
window 16 Wire. (124)
bytesPerFrame 65536 Wire. (128)
maxPacketBytes 32768 Wire. 1 KB to 256 KB. (132)
assetTable none The same asset on the host and every client. (137)
playerObjects AsTheGameSets See NetcodePlayerObjects. (141)

The component’s StartHost() and StartClient() return a bool. It keeps the seat keys it was given in a SeatKeyStore you reach as Keys.

  • The README says host and players must run the same add-on version, “protocol 14”. The code declares protocol version 15 (Protocol.Version, Runtime/Protocol/Messages.cs line 251). Trust the code.
  • The README says a Unity 6 run has not happened. The add-on note at the top of this page is the wording this site uses, and it comes from one place only.