← Back to Three.js · project planning pack

Skill · Version 1.0.0

Unity state replication

Synchronizes Unity game state while distinguishing lasting facts from one-time events. Coordinates ownership, snapshots and client prediction so late joiners and corrections see a consistent world.

unity-netcode-replication

Agents using this skill

See how it helps

When is it useful?

Use it when late joiners miss important state or local prediction conflicts with server results.

What does it help you do?

  • Separates durable replicated facts from transient network events.
  • Validates RPC senders and handles ownership and spawn lifecycle.
  • Bounds snapshot interpolation and reconciles numbered inputs without repeated effects.

Try asking this

Synchronize an arena door and a predicted attack in Unity. A late joiner must see the already opened door without replaying its old sound, while an attack corrected by the server must not apply damage twice. Test object spawn order, repeated inputs and ownership changes with the installed networking package.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

Replication and Player Responsiveness

Identify installed netcode APIs, topology, network tick rate and the authority for each field/action. Do not assume full rollback prediction exists in a chosen package.

  • Choose persistent state replication for facts a late joiner must reconstruct; use events for transient actions with explicit replay/deduplication semantics.
  • Validate sender and target before applying an RPC. Keep authoritative resource/damage changes separate from speculative local effects.
  • Make network spawn/despawn, ownership changes and callback registration explicit. Initial state and change notifications may follow different lifecycle paths.
  • For snapshots, define timestamp/tick, interpolation delay and stale/out-of-order handling. Presentation smoothing must not overwrite authoritative physics state.
  • If prediction is required and supported, retain numbered pending inputs, acknowledge processed inputs and reconcile from authoritative state. Handle non-reversible effects without replaying rewards, sounds or damage twice.
  • Bound update frequency and payload size; measure actual traffic and interest/visibility behavior at intended actor counts.

Exercise a late join, changing owner, packet loss/reorder, a fast movement correction and a duplicate request. Distinguish expected visual delay from simulation divergence.

Reference: Gabriel Gambetta's prediction/reconciliation explanation plus the installed Unity package documentation. Conceptual examples are not proof of a particular package feature.

Included files 2

  • LICENSE.txt
  • SKILL.md