<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fmultiplayer-ready</id>
	<title>Unity.Multiplayer/articles/multiplayer-ready - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fmultiplayer-ready"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/multiplayer-ready&amp;action=history"/>
	<updated>2026-12-05T08:35:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/multiplayer-ready&amp;diff=931&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/multiplayer-ready&amp;diff=931&amp;oldid=prev"/>
		<updated>2026-11-29T20:37:07Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Multiplayer-ready: the standard for every MindAttic Unity game =&lt;br /&gt;
&lt;br /&gt;
Every MindAttic Unity game is built so that co-op or PvP can be added later &amp;lt;strong&amp;gt;without re-architecting&amp;lt;/strong&amp;gt;, even when it ships single-player first. That does not mean every game is networked from day one. It means the game&amp;#039;s code already has the shape networking needs, so adding it is a matter of plugging in this kit rather than rewriting the game.&lt;br /&gt;
&lt;br /&gt;
This page is the standard: eight rules, a checklist to review a game against, the law text a game cites from its BIBLE, how each rule maps onto the kit when the game does go online, and Unity.Cursory as the example of what happens when a game is ported after the fact.&lt;br /&gt;
&lt;br /&gt;
== The rules ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Every player intent is a command ===&lt;br /&gt;
&lt;br /&gt;
Anything a player does that changes the game (move, attack, play a card, pick an option, pause a shared game) is a &amp;lt;strong&amp;gt;command&amp;lt;/strong&amp;gt;: a small, serializable value that carries the &amp;lt;strong&amp;gt;player id (seat)&amp;lt;/strong&amp;gt; of whoever issued it. Every command goes through &amp;lt;strong&amp;gt;one command pipeline&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;ISession.Submit&amp;lt;/code&amp;gt;, rule 7) that validates it and hands it to the authority. Input code never changes game state directly; it builds a command and submits it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;public readonly struct MoveCommand : IGameCommand&lt;br /&gt;
{&lt;br /&gt;
    public MoveCommand(PlayerId player, Direction direction) { Player = player; Direction = direction; }&lt;br /&gt;
    public PlayerId Player { get; }&lt;br /&gt;
    public Direction Direction { get; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// input code: never touches state&lt;br /&gt;
session.Submit(new MoveCommand(session.LocalPlayer, Direction.Left));&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A command holds plain data only: numbers, enums, strings, ids. Never a &amp;lt;code&amp;gt;GameObject&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Transform&amp;lt;/code&amp;gt;, component or other object reference, which cannot cross a wire.&lt;br /&gt;
&lt;br /&gt;
=== 2. One authority owns game state, apart from presentation ===&lt;br /&gt;
&lt;br /&gt;
One object (the &amp;lt;strong&amp;gt;authority&amp;lt;/strong&amp;gt;: a &amp;lt;code&amp;gt;GameState&amp;lt;/code&amp;gt; plus the rules that change it) owns the game state. Only the authority writes it, and only in response to commands and ticks. &amp;lt;strong&amp;gt;Presentation&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;MonoBehaviour&amp;lt;/code&amp;gt;s, views, UI, audio, VFX, the camera) only &amp;lt;strong&amp;gt;reads&amp;lt;/strong&amp;gt; state and listens to &amp;lt;strong&amp;gt;events&amp;lt;/strong&amp;gt; the authority raises (&amp;lt;code&amp;gt;PieceMoved&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PlayerScored&amp;lt;/code&amp;gt;). A view never writes state, and the authority never references a view.&lt;br /&gt;
&lt;br /&gt;
The cleanest form is the one this kit itself uses: the rules live in an engine-free assembly (&amp;lt;code&amp;gt;noEngineReferences&amp;lt;/code&amp;gt;) tested by plain &amp;lt;code&amp;gt;dotnet test&amp;lt;/code&amp;gt;, and the Unity assembly holds presentation and wiring.&lt;br /&gt;
&lt;br /&gt;
=== 3. No global &amp;quot;the player&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;Player.Instance&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GameManager.Player&amp;lt;/code&amp;gt;, static &amp;lt;code&amp;gt;LocalPlayer&amp;lt;/code&amp;gt; or single &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; field. Everything that belongs to a player (position, health, hand, score, settings, camera target) is &amp;lt;strong&amp;gt;keyed by player id&amp;lt;/strong&amp;gt;: a dictionary, an array indexed by seat, or a field on a per-player record. Which player this machine controls is answered by &amp;lt;strong&amp;gt;one seam&amp;lt;/strong&amp;gt;, &amp;lt;code&amp;gt;ISession.LocalPlayer&amp;lt;/code&amp;gt;, and only presentation and input ask it. Rules never do: to the rules, every player is just an id.&lt;br /&gt;
&lt;br /&gt;
=== 4. Rules are deterministic ===&lt;br /&gt;
&lt;br /&gt;
Given the same starting state and the same commands in the same order, the rules produce the same state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Seeded RNG.&amp;lt;/strong&amp;gt; Randomness comes from a seeded generator that is part of the game state (&amp;lt;code&amp;gt;System.Random(seed)&amp;lt;/code&amp;gt; or a small PCG/xorshift you own), never &amp;lt;code&amp;gt;UnityEngine.Random&amp;lt;/code&amp;gt; in rules.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Fixed tick.&amp;lt;/strong&amp;gt; Rules advance in fixed steps (&amp;lt;code&amp;gt;Step(tick)&amp;lt;/code&amp;gt; at a fixed rate, 30 Hz by default), never by &amp;lt;code&amp;gt;Time.deltaTime&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Time.time&amp;lt;/code&amp;gt; or frame count. Presentation may interpolate between ticks; rules do not see frames.&lt;br /&gt;
* &amp;lt;strong&amp;gt;No hidden inputs.&amp;lt;/strong&amp;gt; Rules read no wall clock, no &amp;lt;code&amp;gt;Input&amp;lt;/code&amp;gt;, no &amp;lt;code&amp;gt;Physics&amp;lt;/code&amp;gt; queries on the presentation scene, and do not iterate an unordered collection where the order changes the result.&lt;br /&gt;
&lt;br /&gt;
Engine physics (Physics2D / PhysX) is not deterministic across machines. A game whose rules need it runs it on the authority only and replicates the results (that is fine under this kit, see rule 2), but it gives up replays from commands alone, so prefer simple rule-owned motion where the design allows.&lt;br /&gt;
&lt;br /&gt;
=== 5. Stable entity ids ===&lt;br /&gt;
&lt;br /&gt;
Every thing the rules track (units, pieces, pickups, doors, projectiles that matter) has a &amp;lt;strong&amp;gt;stable id&amp;lt;/strong&amp;gt; assigned by the authority: an int counter or a string key from level data (&amp;lt;code&amp;gt;crate:0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;door:north&amp;lt;/code&amp;gt;). Commands and events refer to entities by id, never by object reference, list index or &amp;lt;code&amp;gt;GetInstanceID()&amp;lt;/code&amp;gt;. Presentation maps ids to &amp;lt;code&amp;gt;GameObject&amp;lt;/code&amp;gt;s in one lookup.&lt;br /&gt;
&lt;br /&gt;
=== 6. State and commands serialize ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;GameState&amp;lt;/code&amp;gt; and every command can be written to bytes or JSON and read back equal. That gives a game, before any networking: &amp;lt;strong&amp;gt;save games&amp;lt;/strong&amp;gt; (a state snapshot), &amp;lt;strong&amp;gt;replays&amp;lt;/strong&amp;gt; (a seed plus the command log), &amp;lt;strong&amp;gt;bug reports&amp;lt;/strong&amp;gt; that reproduce, and &amp;lt;strong&amp;gt;tests&amp;lt;/strong&amp;gt; that start from a recorded position. Keep state as plain data (records, arrays, ids), with no engine types in it beyond simple values you can convert (&amp;lt;code&amp;gt;Vector2&amp;lt;/code&amp;gt; → two floats).&lt;br /&gt;
&lt;br /&gt;
=== 7. An &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt; seam with a &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
All of the above meet in one interface the game owns. Game code (input, presentation, the game&amp;#039;s start-up) talks to &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt;, never to the authority directly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;public interface ISession&lt;br /&gt;
{&lt;br /&gt;
    PlayerId LocalPlayer { get; }                  // the one seam for &amp;quot;who am I&amp;quot; (rule 3)&lt;br /&gt;
    IReadOnlyList&amp;amp;lt;PlayerId&amp;gt; Players { get; }&lt;br /&gt;
    IGameStateView State { get; }                  // read-only view for presentation (rule 2)&lt;br /&gt;
    event Action&amp;amp;lt;IGameEvent&amp;gt; EventRaised;          // what presentation listens to&lt;br /&gt;
    void Submit(IGameCommand command);             // the one command pipeline (rule 1)&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The single-player game ships with &amp;lt;strong&amp;gt;&amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt;&amp;lt;/strong&amp;gt;: it owns the authority in process, applies each submitted command on the next tick, and raises events straight to presentation. Hot-seat or split-screen co-op is the same &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; with more than one local player id. When the game goes online, a &amp;lt;code&amp;gt;NetGameSession : ISession&amp;lt;/code&amp;gt; built on this kit&amp;#039;s &amp;lt;code&amp;gt;NetSession&amp;lt;/code&amp;gt; replaces it (see [[#From ready to networked|From ready to networked]]), and input, presentation and rules do not change.&lt;br /&gt;
&lt;br /&gt;
=== 8. A test plays commands from two player ids ===&lt;br /&gt;
&lt;br /&gt;
The game has at least one test that creates a &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; with &amp;lt;strong&amp;gt;two players&amp;lt;/strong&amp;gt;, submits commands as each, steps the ticks, and asserts on the state: both players acted, neither one&amp;#039;s command touched the other&amp;#039;s things, and a command from the wrong player is refused. With rules 4 and 6 in place this is a plain, fast &amp;lt;code&amp;gt;dotnet test&amp;lt;/code&amp;gt; or EditMode test, and it is the proof that the game really is per-player and not secretly single-player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;[Test]&lt;br /&gt;
public void TwoPlayersMoveIndependently()&lt;br /&gt;
{&lt;br /&gt;
    var session = LocalSession.Create(seed: 7, players: 2);&lt;br /&gt;
    var ann = session.Players[0];&lt;br /&gt;
    var bob = session.Players[1];&lt;br /&gt;
&lt;br /&gt;
    session.Submit(new MoveCommand(ann, Direction.Left));&lt;br /&gt;
    session.Submit(new MoveCommand(bob, Direction.Up));&lt;br /&gt;
    session.Step(ticks: 1);&lt;br /&gt;
&lt;br /&gt;
    Assert.That(session.State.PositionOf(ann), Is.EqualTo(new Cell(-1, 0)));&lt;br /&gt;
    Assert.That(session.State.PositionOf(bob), Is.EqualTo(new Cell(0, 1)));&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checklist ==&lt;br /&gt;
&lt;br /&gt;
Review a game against this before each release, and when adding any new mechanic.&lt;br /&gt;
&lt;br /&gt;
* [ ] Every player action is a serializable command type that carries a player id.&lt;br /&gt;
* [ ] Every command goes through &amp;lt;code&amp;gt;ISession.Submit&amp;lt;/code&amp;gt;; no input code writes game state.&lt;br /&gt;
* [ ] Commands hold only plain data and ids: no &amp;lt;code&amp;gt;GameObject&amp;lt;/code&amp;gt;, component or object references.&lt;br /&gt;
* [ ] One authority writes game state; presentation only reads state and handles events.&lt;br /&gt;
* [ ] The authority references no view, &amp;lt;code&amp;gt;MonoBehaviour&amp;lt;/code&amp;gt;, scene object or UI.&lt;br /&gt;
* [ ] No static or singleton &amp;quot;the player&amp;quot;; per-player data is keyed by player id.&lt;br /&gt;
* [ ] &amp;lt;code&amp;gt;ISession.LocalPlayer&amp;lt;/code&amp;gt; is the only place that answers &amp;quot;which player is this machine&amp;quot;, and rules never call it.&lt;br /&gt;
* [ ] Rules use a seeded RNG held in the state; no &amp;lt;code&amp;gt;UnityEngine.Random&amp;lt;/code&amp;gt; in rules.&lt;br /&gt;
* [ ] Rules advance on a fixed tick; no &amp;lt;code&amp;gt;Time.deltaTime&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Time.time&amp;lt;/code&amp;gt; or frame count in rules.&lt;br /&gt;
* [ ] Every tracked entity has a stable id from the authority; commands and events use ids.&lt;br /&gt;
* [ ] &amp;lt;code&amp;gt;GameState&amp;lt;/code&amp;gt; and every command round-trip through serialization equal.&lt;br /&gt;
* [ ] The game runs on a &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; behind &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt;.&lt;br /&gt;
* [ ] A test plays commands from two player ids and asserts per-player results, including a refused wrong-player command.&lt;br /&gt;
* [ ] (Strongly preferred) Rules live in an engine-free assembly tested by &amp;lt;code&amp;gt;dotnet test&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The law games cite ==&lt;br /&gt;
&lt;br /&gt;
Each MindAttic Unity game copies this law into its BIBLE&amp;#039;s Laws section, numbered in its own scheme, and links back here, so the rules have one home ([[Unity.Multiplayer/BIBLE|UM-LAW-4]]):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
=== XX-LAW-n — Multiplayer-ready &amp;lt;span id=&amp;quot;XX-LAW-n&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This game is built so co-op or PvP can be added without re-architecting, per Unity.Multiplayer&amp;#039;s [https://mindattic.github.io/Unity.Multiplayer/articles/multiplayer-ready.html Multiplayer-ready standard]: every player intent is a serializable command stamped with a player id and submitted through &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt;; one authority owns game state and presentation only reads state and events; there is no global &amp;quot;the player&amp;quot;, only player ids and &amp;lt;code&amp;gt;ISession.LocalPlayer&amp;lt;/code&amp;gt;; rules are deterministic (seeded RNG, fixed tick, no &amp;lt;code&amp;gt;UnityEngine.Random&amp;lt;/code&amp;gt; or frame time); entities have stable ids; state and commands serialize; the game runs on a &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; behind &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt;; and a test plays commands from two player ids. A change that breaks any of these is a bug.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== From ready to networked ==&lt;br /&gt;
&lt;br /&gt;
When the game goes online, each rule maps onto a piece of this kit. Nothing in the rules or presentation moves; the work is writing &amp;lt;code&amp;gt;NetGameSession&amp;lt;/code&amp;gt; and the networked objects that carry commands and state.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Rule&lt;br /&gt;
! In a multiplayer-ready game&lt;br /&gt;
! With Unity.Multiplayer&lt;br /&gt;
|-&lt;br /&gt;
| 1. Commands&lt;br /&gt;
| &amp;lt;code&amp;gt;ISession.Submit(command)&amp;lt;/code&amp;gt; stamped with a player id&lt;br /&gt;
| A [[Unity.Multiplayer/articles/attributes|&amp;lt;code&amp;gt;NetEntity&amp;lt;/code&amp;gt;]] with a &amp;lt;code&amp;gt;[ToServer]&amp;lt;/code&amp;gt; method per command (or one taking the serialized command). The generator builds the RPC; the server&amp;#039;s handler receives the caller as &amp;lt;code&amp;gt;NetSender&amp;lt;/code&amp;gt; and stamps the command with the sender&amp;#039;s seat, never a seat the client claims. &amp;lt;code&amp;gt;RateLimit&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RequireOwnership&amp;lt;/code&amp;gt; are the first line of validation.&lt;br /&gt;
|-&lt;br /&gt;
| 2. One authority&lt;br /&gt;
| The authority inside &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt;&lt;br /&gt;
| The server owns state ([[Unity.Multiplayer/BIBLE|UM-LAW-1]]). The same authority runs only when &amp;lt;code&amp;gt;session.IsServer&amp;lt;/code&amp;gt; (see Cursory&amp;#039;s &amp;lt;code&amp;gt;LevelServer&amp;lt;/code&amp;gt;, the template&amp;#039;s &amp;lt;code&amp;gt;Arena.Serve&amp;lt;/code&amp;gt;); clients get results through &amp;lt;code&amp;gt;[Synced]&amp;lt;/code&amp;gt; fields and &amp;lt;code&amp;gt;[ToClients]&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;[ToOwner]&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;[ToClient]&amp;lt;/code&amp;gt; events, which &amp;lt;code&amp;gt;NetGameSession&amp;lt;/code&amp;gt; turns back into &amp;lt;code&amp;gt;IGameEvent&amp;lt;/code&amp;gt;s.&lt;br /&gt;
|-&lt;br /&gt;
| 3. Per player id&lt;br /&gt;
| &amp;lt;code&amp;gt;PlayerId&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ISession.LocalPlayer&amp;lt;/code&amp;gt;&lt;br /&gt;
| The player id is the seat: &amp;lt;code&amp;gt;NetSender.SeatIndex&amp;lt;/code&amp;gt; on the server, kept across reconnects ([[Unity.Multiplayer/articles/reconnect-seats|Reconnect and seats]]). [[Unity.Multiplayer/articles/players|&amp;lt;code&amp;gt;NetRoster&amp;lt;/code&amp;gt;]] has one &amp;lt;code&amp;gt;NetPlayer&amp;lt;/code&amp;gt; per seat with name, colour and &amp;lt;code&amp;gt;IsLocal&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;NetGameSession.LocalPlayer&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;session.Roster.Local&amp;lt;/code&amp;gt;&amp;#039;s seat.&lt;br /&gt;
|-&lt;br /&gt;
| 4. Deterministic&lt;br /&gt;
| Seeded RNG, fixed tick&lt;br /&gt;
| The authority steps on the session&amp;#039;s &amp;lt;code&amp;gt;ITickClock&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;NetSession.Clock&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Ticked&amp;lt;/code&amp;gt;, 30 Hz by default; &amp;lt;code&amp;gt;ManualTickClock&amp;lt;/code&amp;gt; in tests). The seed goes into the state, so a reconnecting client or a replay agrees.&lt;br /&gt;
|-&lt;br /&gt;
| 5. Stable ids&lt;br /&gt;
| Authority-assigned ids&lt;br /&gt;
| [[Unity.Multiplayer/articles/objects|&amp;lt;code&amp;gt;NetKey&amp;lt;/code&amp;gt;]] carries the id on the spawned object; &amp;lt;code&amp;gt;NetSession.Objects.Spawn(prefab, id)&amp;lt;/code&amp;gt; on the server and &amp;lt;code&amp;gt;Objects.TryGet(id, out ...)&amp;lt;/code&amp;gt; on every peer, late joiners included.&lt;br /&gt;
|-&lt;br /&gt;
| 6. Serialization&lt;br /&gt;
| Snapshots and command logs&lt;br /&gt;
| The serialized command is what a &amp;lt;code&amp;gt;[ToServer]&amp;lt;/code&amp;gt; call sends; a state snapshot is what a late joiner or a reconnecting seat is sent (&amp;lt;code&amp;gt;[ToClient]&amp;lt;/code&amp;gt; to that client id), and what a test starts from.&lt;br /&gt;
|-&lt;br /&gt;
| 7. &amp;lt;code&amp;gt;ISession&amp;lt;/code&amp;gt; seam&lt;br /&gt;
| &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;NetGameSession : ISession&amp;lt;/code&amp;gt; wraps &amp;lt;code&amp;gt;NetSession&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; calls the &amp;lt;code&amp;gt;[ToServer]&amp;lt;/code&amp;gt; method, &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; reads the synced view, &amp;lt;code&amp;gt;EventRaised&amp;lt;/code&amp;gt; fires from the client RPCs. Start-up picks &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NetGameSession&amp;lt;/code&amp;gt;; [[Unity.Multiplayer/articles/front-end|&amp;lt;code&amp;gt;NetFrontEnd&amp;lt;/code&amp;gt;]] gives the menus that start it.&lt;br /&gt;
|-&lt;br /&gt;
| 8. Two-player test&lt;br /&gt;
| &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; with two player ids&lt;br /&gt;
| The same scenario over the network in a [[Unity.Multiplayer/articles/testing|&amp;lt;code&amp;gt;NetSessionTest&amp;lt;/code&amp;gt;]] (&amp;lt;code&amp;gt;Topology.Host&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;clients: 1&amp;lt;/code&amp;gt;, or a dedicated server with two clients), and [[Unity.Multiplayer/articles/bots|&amp;lt;code&amp;gt;NetBotTest&amp;lt;/code&amp;gt;]] for bots playing it end to end. Keep the &amp;lt;code&amp;gt;LocalSession&amp;lt;/code&amp;gt; test too: it is the fast one.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Unity.Multiplayer/articles/getting-started|New Game wizard&amp;#039;s]] template is laid out this way already: &amp;lt;code&amp;gt;Player&amp;lt;/code&amp;gt; sends &amp;lt;code&amp;gt;[ToServer] Move&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Arena&amp;lt;/code&amp;gt; holds the server&amp;#039;s rules, crates are keyed by &amp;lt;code&amp;gt;NetKey&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;GameTests&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;NetSessionTest&amp;lt;/code&amp;gt;. A multiplayer-ready game that later adopts the kit ends up with the same shape.&lt;br /&gt;
&lt;br /&gt;
== The counter-example: Unity.Cursory ==&lt;br /&gt;
&lt;br /&gt;
[[Unity.Multiplayer/articles/case-study-cursory|Unity.Cursory]] is the kit&amp;#039;s first real game, and it works. But it was &amp;lt;strong&amp;gt;ported after the fact&amp;lt;/strong&amp;gt;: the original Cursory was a Blazor Server game whose state, rules and room logic grew together in one &amp;lt;code&amp;gt;GameState&amp;lt;/code&amp;gt;, and none of this standard existed when it was written. The port shows what each missing rule cost:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;No separate authority to lift (rule 2).&amp;lt;/strong&amp;gt; The engine-free Core (levels, goals, circuits, votes, rope geometry) had to be carved out of the original&amp;#039;s &amp;lt;code&amp;gt;GameState.cs&amp;lt;/code&amp;gt; as its own ticket before any networking work could start, and some features (switch tiles, doors, shape attachments) were dropped rather than ported.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Room-wide settings instead of per-player ones (rule 3).&amp;lt;/strong&amp;gt; Cursor collision and the segmented tether were room-wide booleans; the port had to make them each player&amp;#039;s own &amp;lt;code&amp;gt;[Synced]&amp;lt;/code&amp;gt; setting on &amp;lt;code&amp;gt;CursorAvatar&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;strong&amp;gt;No local-player seam (rule 3).&amp;lt;/strong&amp;gt; Presentation and bots find their cursor through static lookups on the networked class (&amp;lt;code&amp;gt;CursorAvatar.Local(session)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ForClient&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;All&amp;lt;/code&amp;gt;) rather than a game-owned session seam, so &amp;quot;which player am I&amp;quot; is tied to the network object.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Engine physics in the rules (rule 4).&amp;lt;/strong&amp;gt; The simulation runs on Physics2D on the server. It is authoritative and correct, but not deterministic, so Cursory has no command replays and its physics tests drive real Physics2D in PlayMode rather than replaying commands in &amp;lt;code&amp;gt;dotnet test&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Levels as code (rules 5 and 6).&amp;lt;/strong&amp;gt; Levels were seed methods; the port turned them into level assets with ids so bodies could be keyed and reset by id.&lt;br /&gt;
&lt;br /&gt;
A game that follows this standard from the start gets all of that for free: its authority is already separate, its players are already ids, and going online is &amp;lt;code&amp;gt;NetGameSession&amp;lt;/code&amp;gt; plus the networked objects in the table above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/multiplayer-ready.md Unity.Multiplayer/docs/articles/multiplayer-ready.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>