thedivergentai/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_prediction, server_reconciliation, lag_compensation, rollback.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-adapt-single-to-multiplayer
Expert guidance for retrofitting multiplayer into single-player games.
get_tree() groups for authority checks — Use is_multiplayer_authority(). Group registration is non-deterministic in high-latency joins.net_rpc_rate_limiter.gd).MultiplayerSynchronizer with delta-sync enabled.net_latency_simulator.gd) with 150ms ping to identify sync bugs.> MANDATORY: Architecture decision tree first, then golden-path scripts. Deep latency workflows → references/latency-testing.md.
MANDATORY when adding MultiplayerSynchronizer interpolation for remote peers. Trigger: authority owns transforms; non-authority interpolates.
MANDATORY signal→RPC bridge. Trigger: gameplay emits local signals; bridge validates authority and fans out RPCs.
CharacterBody prediction + input-buffer replay for server reconciliation.
Snapshot interpolation / jitter buffers for remote peers.
Authoritative validation (position, speed, actions).
RPC flood / macro protection.
Distance-based visibility to cut bandwidth.
Quantization + significance checks for delta sync.
Server-side rewind for hit registration.
Late-joiner world snapshot bootstrap.
MANDATORY before ship — see references/latency-testing.md.
RTT / loss / jitter overlay.
UPNP port mapping for listen-server / P2P hosts.
| Pattern | When | Script golden path |
|---------|------|--------------------|
| Authoritative server | PvP, economies, cheat risk | rpc_bridge.gd → net_auth_server_validator.gd → prediction/recon |
| P2P lockstep | 2–4 co-op, low cheat risk | Deterministic inputs + net_upnp_discovery_logic.gd |
| Hybrid / host authority | Party games 4–8 | Host authority + late-join snapshot |
multiplayer_authority per player node; clients send intents only.multiplayer_sync.gd for property replication / remote interpolation.rpc_bridge.gd for gameplay events that cross the wire.net_latency_simulator.gd at ~150 ms RTT.PhysicsServer3D before raycast (net_lag_compensation.gd).| 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 |
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 net_upnp_discovery_logic.gd.
For cases where UPNP fails:
Visualizing the packet timeline is critical for debugging jitter. Propose an overlay that graphs:
| Topic | Reference / script |
|-------|-------------------|
| Prediction / recon / interpolation | prediction-and-reconciliation.md |
| Authority / anti-cheat / bandwidth | authority-and-security.md |
> 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.
multiplayer singleton surface: peer IDs, signals, and rpc / rpc_id entry points.set_multiplayer_authority / is_multiplayer_authority ownership rules for input vs state.rpc_bridge.gd can wrap without coupling gameplay to transport.Take thedivergentai/godot-adapt-single-to-multiplayer from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.