CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/multiplayer-state-machine-coverage

Build a coverage matrix for a networked-game state machine that exercises connect / authority-handoff / disconnect / reconnect / host-migration paths across Unity Netcode for GameObjects, Unreal Engine replication, and Mirror Networking. Workflow: enumerate the engine's connection states + ownership states + replicated-property update rules, cross them against latency / loss / out-of-order packet injection, encode each combination as a test fixture, and emit a go / no-go gate. Use before submitting a multiplayer title to platform cert - Microsoft's cert guide lists 'Multiplayer does not work as expected' as one of the most common Hold reasons, and Xbox XR-067 (MPSD session state) is failed by uncovered state-machine paths.

74

Quality

93%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

engine-states.mdreferences/

Networked engine state and ownership tables - reference

Per-engine connection-state and authority-state enumerations for multiplayer-state-machine-coverage Steps 1-2. The matrix is fixed by each framework - you cannot add or remove states, only choose which to cover.

Connection states

Unity Netcode for GameObjects (per the v2.11 manual):

StateTriggerObservability
DisconnectedInitial / after disconnectNetworkManager.IsConnectedClient == false
ConnectingNetworkManager.StartClient() invokedBetween request and approval
Connected (Approved)Server accepts clientOnClientConnectedCallback
Connected (Pending Spawn)Approved but player object not yet spawnedWait for OnNetworkSpawn
Connected (Spawned)NetworkObject.IsSpawned == trueGameplay-ready
DisconnectingShutdown() / link lossOnClientDisconnectCallback fires next
HostSame process is both server + clientNetworkManager.IsHost

Unreal Engine replication (per the Networking Overview):

StateTriggerObservability
NM_StandaloneSingle-playerWorld->GetNetMode()
NM_DedicatedServer"Separate machine with no local players"IsRunningDedicatedServer()
NM_ListenServer"Host machine where the server operator also plays locally"IsRunningListenServer()
NM_ClientConnected as remote clientWorld->IsClient()
LoginAGameModeBase::PreLoginLoginPostLoginOverride PostLogin
Travel (seamless / hard)ServerTravel to new mapPlayerController->bIsClientReplicationPausedForFrame
LogoutLogout() callbackOverride on GameModeBase

Mirror Networking (per the Mirror docs on NetworkBehaviour):

StateTriggerObservability
OnStartServer"called on server when a game object spawns on the server"NetworkBehaviour override
OnStartClient"called on clients when the game object spawns on the client"NetworkBehaviour override
OnStartLocalPlayerLocal player only, after OnStartClientNetworkBehaviour override
OnStartAuthority / OnStopAuthority"Called when ownership changes"NetworkBehaviour override
OnStopServer / OnStopClient"Cleanup when objects are destroyed"NetworkBehaviour override

Ownership / authority states

EngineAuthority states
Unity NGOOwnerClientId (per NetworkObject); IsOwner, IsServer, IsHost flags
UnrealROLE_Authority (server), ROLE_AutonomousProxy (owning client), ROLE_SimulatedProxy (other clients), ROLE_None
MirrorisServer, isClient, isLocalPlayer, isOwned per Mirror NetworkBehaviour docs - isOwned "Returns true on the client if this client has authority over this game object"

SKILL.md

tile.json