Skip to content
Skills Library
Programming · Building & coding

multiplayer-netcode

/multiplayer-netcode

Build multiplayer with an authoritative server, client prediction, reconciliation, and lag compensation. Use when adding networking to a game or fixing rubber-banding and desync.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build multiplayer with an authoritative server, client prediction, reconciliation, and lag compensation. Use when adding networking to a game or fixing rubber-banding and desync.

Original author description

Build multiplayer with an authoritative server, client prediction, reconciliation, and lag compensation. Use when adding networking to a game or fixing rubber-banding and desync.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 68 lines, 445 words
SKILL.md preview
---
name: multiplayer-netcode
description: Build multiplayer with an authoritative server, client prediction, reconciliation, and lag compensation. Use when adding networking to a game or fixing rubber-banding and desync.
---

# Multiplayer netcode

Physics: photons take ~70ms across an ocean, so everyone plays in the
past. Netcode is the art of hiding that: the server owns truth, clients
predict their own actions, and disagreements reconcile smoothly instead
of teleporting.

## Method

1. **Make the server authoritative.** Clients send *inputs*
   (see game-input-handling's serializable-actions rule), the
   server simulates and broadcasts state: clients render, never
   decide. Client-authoritative positions are speedhacks waiting
   to be written; validate inputs server-side too (rate, ranges:
   see input-validation) because the client is untrusted by
   definition.
2. **Predict locally, reconcile on correction.** The client
   applies its own inputs immediately (zero-latency feel), tags
   each with a sequence number, and keeps a history. When the
   server's state for tick N arrives: if it differs from the
   client's stored prediction at N, rewind to server state and
   replay inputs N+1..now. Done right, corrections are invisible;
   visible rubber-banding means prediction and server simulation
   have drifted (determinism bugs: see game-loop-architecture,
   procedural-generation's determinism rules).
3. **Interpolate everyone else.** Remote entities render
   100-200ms in the past, interpolating between two known
   snapshots: smooth motion at the cost of delay, with
   extrapolation only as a brief packet-loss fallback (it
   overshoots). This buffer is why "my screen" and "their
   screen" differ, which lag compensation exists to arbitrate.
4. **Compensate lag for instant-hit actions.** The server keeps
   position history; when a shot arrives, it rewinds targets to
   what *that shooter saw* (their interpolation time) and
   adjudicates there: shooters get fair hits, victims sometimes
   die behind walls: a tunable fairness trade (cap the rewind
   window). Projectiles with travel time skip compensation;
   design around it where possible.
5. **Send deltas on snapshots, engineer for loss.** Server
   broadcasts at fixed tick (20-60Hz) with delta compression
   against last-acked state and interest management (send only
   what each client can perceive: bandwidth and
   wallhack-resistance together; see least-privilege's spirit).
   UDP-style transport with your own reliability *only* where
   needed (events reliable, state unreliable-latest-wins);
   simulate loss/jitter/latency in dev constantly (see
   chaos-testing): netcode that only met localhost is untested.
6. **Instrument desync detection from day one.** Periodic state
   checksums between server and clients; on mismatch, log the
   first diverging tick and field. Desyncs found at release are
   archaeology; found in CI (replay-based determinism tests:
   fixed input script must produce identical checksums) they
   are diffs (see golden-master).

## Boundaries

- Genre picks the architecture: lockstep-determinism suits RTS
  (tiny bandwidth, needs perfect determinism), rollback suits
  fighting games, snapshot-prediction suits shooters/action;
  do not transplant one genre's netcode into another blindly.
- Matchmaking, sessions, NAT traversal, and anti-cheat are
  adjacent systems (see backend categories, api-security);
  this skill is the simulation loop's networking.
- Physics-heavy interactions (vehicles, ragdolls) resist
  prediction; either simplify their networked behavior or
  accept server-only simulation with interpolation.

Versions

RepositoryScoreLicence
This page · Amey-Thakur/AI-SKILLS90MIT
j4flmao/agent-skills100MIT

Database snapshot: 13.11.2026 · package version ce1ed844f3c3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100multiplayer-networking
    Netcode reference patterns: a model comparison, a common mistakes catalog (rubber-banding, desync, bandwidth), delta encoding and quantization, reconciliation smoothing, a Unity library comparison, NAT traversal, and Godot MultiplayerSynchronizer, prediction, interpolation, and…
  • 95game-engine-multiplayer-netcode
    Use this skill when the user says 'engine netcode architecture', 'replication system design', 'netcode in custom engine', 'snapshot interpolation engine', 'rollback engine integration'. Engine-level netcode architecture: transport, replication model, prediction/interpolation,…
  • 100authoritative-server
    Use this skill when the user says 'authoritative server', 'server tick loop', 'server reconciliation', 'lag compensation', 'dedicated server', 'input authority'. Designs authoritative game servers: tick loop, world state and snapshots, input authority, reconciliation/rollback,…
  • 100game-multiplayer
    Designs netcode: whether to go online at all, topology (P2P with relay, listen or dedicated server), sync model (prediction, rollback, lockstep), stacks for Godot, Unity, Unreal and web, lobbies, anti-cheat, network testing and hosting cost. Use for "add multiplayer", "online…
  • 100multiplayer-sync
    Use when synchronizing multiplayer state — MultiplayerSynchronizer, interpolation, prediction, and lag compensation
  • 100gamedev-multiplayer
    Use when adding multiplayer or netcode to a game — client-server vs P2P, server authority and anti-cheat, state replication vs RPCs, prediction and reconciliation, lag compensation, plus Godot 4 / Unity NGO / Unreal wiring. NOT single-player gameplay (that is `godot`, `unity`,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.