thedivergentai/godot-server-architecture
Expert blueprint for dedicated / headless multiplayer hosts: ENet/DTLS, authority validation, safe packet decode, matchmaker handoff, and health telemetry. Use when building authoritative servers, --headless hosts, or hardening host networking. Keywords: dedicated server, headless, ENet, DTLS, authority, safe_packet_decoder, multiplayer host, WebSocketMultiplayerPeer.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-server-architecture
Authoritative multiplayer host patterns — headless boot, ENet/DTLS, packet safety, kicks, and telemetry.
> RID SceneTree-bypass rendering/physics swarms belong in godot-performance-optimization (and physics_server_direct.gd / rid_performance_server.gd only when the host sim truly needs server RIDs). Lobby/RPC gameplay APIs: godot-multiplayer-networking.
| Use this skill for | Use godot-multiplayer-networking for |
| :--- | :--- |
| --headless / dedicated export boot | Lobby UI, matchmaking UX, friend invites |
| ENet/DTLS host peer + safe decode | RPC signatures, @rpc gameplay handlers |
| Authority validation on privileged ops | MultiplayerSynchronizer / scene replication |
| Kick, health telemetry, matchmaker handoff | Client prediction, lag compensation |
Do NOT Load lobby/RPC tutorial scripts from multiplayer-networking when only booting a host — follow Host Golden Path here first.
--headless / dedicated_server feature).get_var.Detect/initialize dedicated server logic for --headless / dedicated_server.
Headless runtime manager companion patterns.
High-performance ENet UDP hosts with bandwidth/client limits.
DTLS + X509 hardening for ENet UDP.
Forbid object decoding on untrusted packets (RCE guard).
Manual multiplayer.poll() when auto-poll is disabled.
Isolated MultiplayerAPI instances (client+server in one process).
get_remote_sender_id() gates for authoritative requests.
HTML5-compatible WebSocketMultiplayerPeer hosts.
Graceful peer termination with reason propagation.
Load-balancer / matchmaker handoff to game hosts.
Headless telemetry for monitoring stacks.
Optional host-side RID sim — only when node physics cannot hold tick budget: > ~200 active bodies per tick, or headless host CPU > 70% on physics step with nodes. Criteria: profile first; if SceneTree bodies dominate, prefer godot-performance-optimization. Do NOT Load RID scripts for ≤64 entity lobbies.
TRANSFER_MODE_RELIABLE for continuous streams — Prefer unreliable for high-rate transforms.get_var(true) on untrusted packets — Object decode = RCE. MANDATORY safe_packet_decoder.connected_to_server / peer ready.UNRELIABLE packets arrive in order.SceneTree.multiplayer_poll false without manual poll().free_rid on server-created RIDs if the host uses Physics/RenderingServer pools.Large worlds: MultiplayerSynchronizer.public_visibility = false + visibility filters (AABB / grid) so the host does not sync the entire world to every peer.
# Hook on synchronizer — filter peers by grid cell / AABB (no full tutorial)
func _visibility_filter(for_peer: int, node: Node) -> bool:
return _interest_grid.is_visible_to_peer(for_peer, node.global_position)
# Assign: synchronizer.set_visibility_filter(_visibility_filter)
Watch host FPS, static memory (RID leaks), and orphan counts via server_health_exporter.gd.
> LLM-ignorance rule: if a general agent would not know it before reading, it lives here or in scripts/ — never delete, only move.
| Topic | Reference |
|-------|-----------|
| RID canvas/physics cookbook | rendering-physics-server-cookbook.md |
> Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.
canvas_item_* / instance_* / free_rid for procedural draw and mesh swarms without MeshInstance nodes.body_create, space binding, and direct-state queries for headless authoritative simulation.*_create() needs a matching free_rid to avoid leaks.peer.host.--headless and CLI flags used by headless init/managers.get_var(false) / object-decoding rules that block RCE on untrusted packets.dtls_server_setup with X509/TLSOptions.@rpc annotations, and safe Variant decoding patterns used across server scripts.Take thedivergentai/godot-server-architecture 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.