thedivergentai/gd-agentic-skills

godot-adapt-single-to-multiplayer

Expert patterns for adding multiplayer to single-player games including client-server architecture, authoritative server design, MultiplayerSynchronizer, lag compensation (client prediction, server reconciliation), input buffering, and anti-cheat measures. Use when retrofitting multiplayer, porting to online play, or designing networked gameplay. Trigger keywords: MultiplayerPeer, ENetMultiplayerPeer, SceneMultiplayer, MultiplayerSynchronizer, rpc, rpc_id, multiplayer_authority, client_predicti…

First seen Feb 10, 2026

Installation

$ npx skills add thedivergentai/gd-agentic-skills --skill godot-adapt-single-to-multiplayer

Summary

  • Expert patterns for adding multiplayer to single-player games including client-server architecture, authoritative server design, MultiplayerSynchronizer, lag compensation (client prediction, server reconciliation), input buffering, and anti-cheat measures.
  • Use when retrofitting multiplayer, porting to online play, or designing networked gameplay.
  • Trigger keywords: MultiplayerPeer, ENetMultiplayerPeer, SceneMultiplayer, MultiplayerSynchronizer, rpc, rpc_id, multiplayer_authority, client_prediction, server_reconciliation, lag_compensation, rollback.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedivergentai/gd-agentic-skills · top by installs.

npx skills add thedivergentai/gd-agentic-skills

Browse all from thedivergentai/gd-agentic-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 678
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 13,461 B
  • docs SUMMARY.md 594 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 210 installs

SKILL.md

NEVER Do (Expert Multiplayer Rules)

Security & Authority

  • NEVER trust client-reported state — Clients own their 'Input', NOT their 'Position' or 'Health'. Server must validate every coordinate and health change.
  • NEVER use gettree() groups for authority checks — Use ismultiplayer_authority(). Group registration is non-deterministic in high-latency joins.
  • NEVER allow unrestricted RPC rates — A malicious client can call a 'FireWeapon' RPC 10,000 times per second. Always implement rate-limiting (netrpcrate_limiter.gd).

Movement & Lag

  • NEVER skip Client-Side Prediction — Movement without prediction feels 'heavy' and unresponsive. Predict movement locally, then correct only on server disagreement.
  • NEVER sync peers at 60Hz — Sending entire state every frame will saturate client bandwidth. Use a lower tick-rate (20-30Hz) and interpolate between packets.
  • NEVER snap peer positions — Abrupt position updates cause 'jitter'. Store a buffer of past states and lerp between them with a 100ms delay.

Bandwidth & Sync

  • NEVER sync 'Full Floats' if possible — Quantize Vector3 data (truncating decimals) to save 50%+ bandwidth. Use MultiplayerSynchronizer with delta-sync enabled.
  • NEVER ignore 'Late Joiners' — Players who join mid-game won't see existing environmental changes. Broadcast a full world-state 'Snapshot' on peer connection.
  • NEVER test on 0ms ping — Everything works on localhost. Use a simulator (netlatencysimulator.gd) with 150ms ping to identify sync bugs.

Available Scripts

MANDATORY: Architecture decision tree first, then golden-path scripts. Deep latency workflows → [references/latency-testing.md](references/latency-testing.md).

Authority / transport bridges

[multiplayersync.gd](scripts/multiplayersync.gd)

MANDATORY when adding MultiplayerSynchronizer interpolation for remote peers. Trigger: authority owns transforms; non-authority interpolates.

[rpcbridge.gd](scripts/rpcbridge.gd)

MANDATORY signal→RPC bridge. Trigger: gameplay emits local signals; bridge validates authority and fans out RPCs.

Prediction / lag / lobby

[netpredictionreconciliation.gd](scripts/netpredictionreconciliation.gd)

CharacterBody prediction + input-buffer replay for server reconciliation.

[netsnapshotinterpolation.gd](scripts/netsnapshotinterpolation.gd)

Snapshot interpolation / jitter buffers for remote peers.

[netauthservervalidator.gd](scripts/netauthservervalidator.gd)

Authoritative validation (position, speed, actions).

[netrpcratelimiter.gd](scripts/netrpcratelimiter.gd)

RPC flood / macro protection.

[netinterestmanagement.gd](scripts/netinterestmanagement.gd)

Distance-based visibility to cut bandwidth.

[netdeltacompressionsync.gd](scripts/netdeltacompressionsync.gd)

Quantization + significance checks for delta sync.

[netlagcompensation.gd](scripts/netlagcompensation.gd)

Server-side rewind for hit registration.

[netlobbylatejoinsync.gd](scripts/netlobbylatejoinsync.gd)

Late-joiner world snapshot bootstrap.

Diagnostics

[netlatencysimulator.gd](scripts/netlatencysimulator.gd)

MANDATORY before ship — see [references/latency-testing.md](references/latency-testing.md).

[netdebugoverlaymonitor.gd](scripts/netdebugoverlaymonitor.gd)

RTT / loss / jitter overlay.

[netupnpdiscoverylogic.gd](scripts/netupnpdiscoverylogic.gd)

UPNP port mapping for listen-server / P2P hosts.


Architecture Patterns

Pattern When Script golden path
Authoritative server PvP, economies, cheat risk rpcbridge.gdnetauthservervalidator.gd → prediction/recon
P2P lockstep 2–4 co-op, low cheat risk Deterministic inputs + netupnpdiscovery_logic.gd
Hybrid / host authority Party games 4–8 Host authority + late-join snapshot

Migration golden path (no inline host/join tutorials)

  1. Separate input (client) from simulation (authority).
  2. Set multiplayer_authority per player node; clients send intents only.
  3. MANDATORY multiplayer_sync.gd for property replication / remote interpolation.
  4. MANDATORY rpc_bridge.gd for gameplay events that cross the wire.
  5. Add prediction / lag compensation scripts only for the genres that need them.
  6. Validate with latency-testing reference + netlatencysimulator.gd at ~150 ms RTT.

Expert insights (WHY — keep in body)

  • Client prediction — WHY: without local sim, RTT doubles perceived input lag. Replay buffered inputs after server correction ([netpredictionreconciliation.gd](scripts/netpredictionreconciliation.gd)).
  • Interpolation buffer — WHY: raw sync packets jitter; lerp between snapshots with ~100 ms delay ([netsnapshotinterpolation.gd](scripts/netsnapshotinterpolation.gd)).
  • Hit rewind — WHY: clients fire at past world state; server rewinds RIDs via PhysicsServer3D before raycast ([netlagcompensation.gd](scripts/netlagcompensation.gd)).
  • Input send rate — WHY: 60 Hz input RPCs saturate uplink; batch at 20–30 Hz with significance checks ([netdeltacompressionsync.gd](scripts/netdeltacompressionsync.gd)).

Decision Tree: Which Architecture?

Factor Authoritative Server P2P Lockstep
Player count 8-100+ 2-4
Cheat prevention Critical Not important
Server hosting Available Not available
Gameplay type PvP, competitive Co-op, casual
Lag tolerance Medium (prediction helps) Low (desyncs)
Development complexity High Medium

Advanced Networking Topics

Peer-to-Peer NAT Traversal (Hole Punching)

In P2P architectures, clients often sit behind firewalls. UPNP (Universal Plug and Play) is the first line of defense, allowing the game to request port forwarding from the router automatically using netupnpdiscovery_logic.gd.

For cases where UPNP fails:

  • STUN/TURN: Use a STUN server to discover public IP/port pairings.
  • Relay Servers: If direct connection is impossible, fallback to a relay server (TURN) to bridge the two peers.

Network Profiling & Visualization

Visualizing the packet timeline is critical for debugging jitter. Propose an overlay that graphs:

  • Packet Arrival: A scrolling timeline showing when packets arrive relative to physics frames.
  • Buffer Health: A visualization of the interpolation jitter buffer size.
  • RTT (Round Trip Time): Real-time graph of latency spikes.

Deep recipes (on demand)

Topic Reference / script
Prediction / recon / interpolation [prediction-and-reconciliation.md](references/prediction-and-reconciliation.md)
Authority / anti-cheat / bandwidth [authority-and-security.md](references/authority-and-security.md)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API;
load Related Skills when routing work to a peer domain — do not preload the whole lattice.

Official Documentation

  • High-level multiplayer — RPC modes, authority, and peer lifecycle you must retrofit before any gameplay state leaves the single-player path.
  • Networking — Transport map (ENet / WebSocket / WebRTC) so host/join choices match platform and NAT constraints.
  • MultiplayerSynchronizer — Property replication, delta sync, and visibility filters that replace ad-hoc position RPCs.
  • MultiplayerSpawner — Spawn/despawn replication when late joiners need the same scene graph as the host.
  • SceneMultiplayer — Default MultiplayerAPI implementation: root path, auth callbacks, and RPC routing under SceneTree.
  • ENetMultiplayerPeer — UDP host/client peer used by most LAN and dedicated-server ports of single-player games.
  • MultiplayerAPImultiplayer singleton surface: peer IDs, signals, and rpc / rpcid entry points.
  • MultiplayerPeer — Transfer modes and connection status shared by every concrete peer backend.
  • UPNP — Automatic port mapping for listen-server / P2P hosts behind consumer routers.
  • WebRTC — Browser-friendly P2P path when ENet UDP cannot punch through firewalls alone.
  • Nodesetmultiplayerauthority / ismultiplayer_authority ownership rules for input vs state.
  • PhysicsServer3D — Direct RID transforms for server-side hit rewind without SceneTree side effects.

Related Skills

Prerequisites

Complements

  • godot-multiplayer-networking — Broader RPC, lobby, and ENet tuning once the single-player→online migration shape is fixed.
  • godot-characterbody-2d — Deterministic moveandslide steps reused by client prediction and reconciliation buffers.
  • godot-physics-3d — Body/shape setup that lag-compensation rewind and hit validation query against.
  • godot-raycasting-queries — Server-side ray/shape queries for authoritative shots after state rewind.
  • godot-debugging-profiling — RTT/jitter overlays and remote debug habits that catch sync bugs localhost never shows.
  • godot-export-builds — Headless/dedicated-server export presets and CLI flags for real multi-instance tests.
  • godot-server-architecture — PhysicsServer/RID patterns and headless host scaffolding used by rewind and dedicated peers.

Downstream / consumers

Master

  • godot-master — Library router and mirrored module entry for this Domain Skill.