jame581/godotprompter/dedicated-server
Claude Code and agent skill by jame581/godotprompter
- community
Checking that the SKILL.md file is still in the repository.
Use when building dedicated servers — headless export, server architecture, lobby management, and deployment
Install
npx vskill@latest install jame581/godotprompter/dedicated-serverSKILL.md
The same SKILL.md was published earlier as jame581/godotprompter/dedicated-server.
Dedicated Server in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, C# follows.
Related skills: See multiplayer-basics for ENet setup, RPCs, and authority model. See multiplayer-sync for state synchronization and interpolation.
1. Headless Export
A dedicated server runs without a display, GPU, or audio device. Godot supports this through the --headless flag and a dedicated export preset.
--headless Flag
Pass --headless on the command line to suppress the display and audio drivers at runtime:
--headless is a runtime flag that works on any exported binary. Godot 4 has no separate server platform or server export template: a dedicated-server export uses the regular template, so the binary keeps its rendering code (a smaller binary needs a custom-compiled template). What the export changes is the PCK and a feature tag — see below.
Server Export Preset
In the Godot editor, create a dedicated Linux export preset:
- Open Project → Export.
- Add a Linux preset and name it
Linux Server. - On the Resources tab, set Export Mode to Export as dedicated server. This adds the
dedicated_serverfeature tag — which makes the binary start with the headless display and dummy audio drivers even without--headless— and marksres://as Strip Visuals: visual resources are exported as placeholders (e.g. a texture keeps only its size). Set folders the server needs intact to Keep. - Use the Exclude filter on the same tab to drop client-only files (audio, client-only scenes) from the server PCK entirely.
Feature Tags
Use OS.has_feature() to branch between server and client code at runtime. Define a custom server feature on the export preset's Features tab (Custom (comma-separated) field) or rely on the built-in dedicated_server feature that a dedicated-server export sets automatically:
Note: the export preset configuration (custom features, exclude filter, "Export as dedicated server" mode) is identical regardless of language — see the GDScript section above for preset settings.
Feature tag summary:
| Tag | Set by | Notes | |
|---|---|---|---|
dedicated_server | Dedicated-server export | Most reliable way to detect a server binary | |
(no tag) --headless | CLI flag | Not a feature tag — OS.has_feature("headless") is false; check DisplayServer.get_name() == "headless" | |
Custom server | Your export preset's Custom Features | Useful when sharing a binary between roles |
2. Server Architecture
Game Loop Without Rendering
On a headless server, _process and _physics_process still run normally — but nothing is rendered. Keep all server logic in _physics_process for deterministic, fixed-rate updates.
GDScript
Server-Only Logic Separated from Client
Structure your scenes so server-only nodes are in a dedicated branch and skipped on clients:
Engine.is_editor_hint() + is_server Checks
Use these guards at the top of scripts that must behave differently in the editor, on the server, and on clients:
C#
3. Lobby System
A per-player state dictionary keyed by peer_id is the canonical pattern. Server holds the authoritative dict; clients receive updates via RPC. Implement a --max-players CLI cap and a ready-toggle RPC so all peers can confirm before starting.
See references/lobby-management.md for the full GDScript and C# lobby implementation (player_list dict, max-players cap, ready toggle RPC, broadcast pattern).
4. Match Flow
Drive lobby → countdown → in-game → results with a state machine. Server is authoritative — clients only receive state-change RPCs. Common states: LOBBY, COUNTDOWN, IN_GAME, RESULTS.
See references/match-flow.md for the full state machine with countdown/results timers and GDScript + C# implementations.
5. Server Configuration
Parse CLI flags from OS.get_cmdline_args() for --port, --max-players, --tick-rate, --log-level. Pre-set Engine.physics_ticks_per_second before the first physics frame; reading and writing the others is straightforward match / switch work.
See references/server-config.md for the GDScript and C# argument-parsing helper that reads all four flags safely at startup.
6. Deployment
A Linux VPS with a Dockerfile and systemd service file is the standard production layout. The Dockerfile bundles the exported binary, its PCK, and for C# projects the data_* folder that holds the assemblies and the bundled .NET runtime. systemd handles auto-restart, log rotation via journald, and resource limits.
See references/deployment.md for the Dockerfile, the Linux VPS setup steps, the systemd unit file, and log-rotation configuration.
7. Checklist
- [ ] Headless export preset created and
dedicated_serverfeature tag added - [ ]
RenderingServer.set_render_loop_enabled(false)(and audio bus muted) whenOS.has_feature("dedicated_server")is true - [ ] Server-side autoloads check
multiplayer.is_server()before initializing systems - [ ] CLI args parsed at startup for port, max-players, tick-rate, log-level;
ServerConfigparses them from CLI args before_ready()of other autoloads - [ ] Lobby state lives only on the server; clients receive updates via RPC
- [ ] Match-flow state machine has explicit transitions and a single source of truth (server)
- [ ] Production deployment uses systemd or Docker for auto-restart and log rotation
- [ ] Headless build is exported with Export with Debug off in production presets
- [ ] Export preset is exported as a dedicated server (
dedicated_serverfeature is set automatically) - [ ] Client-only assets (shaders, audio, high-res textures) are excluded from the server PCK
- [ ] Boot script checks
OS.has_feature("dedicated_server")orDisplayServer.get_name() == "headless"to branch server vs client startup - [ ] Server-only nodes use
PROCESS_MODE_DISABLEDon clients; client-only nodes usePROCESS_MODE_DISABLEDon the server - [ ]
Engine.is_editor_hint()guard at the top of_ready()in every script that has side effects - [ ] Config file loading falls back gracefully when
server.cfgdoes not exist - [ ] Environment variables (
SERVER_PORT,SERVER_MAX_PLAYERS,SERVER_TICK_RATE) are applied after config file, before CLI args - [ ]
LobbyManager.player_listsize is checked againstmax_playersbefore accepting a new peer - [ ] Peer is kicked via RPC before closing if the lobby is full
- [ ] Ready states are reset when
MatchStatereturns toLOBBYso players must re-confirm each round - [ ]
MatchManageronly runs_physics_processon the server (SetPhysicsProcess(false)on clients) - [ ] Countdown and results timers are driven by
_physics_processdelta, notTimernodes (avoids scene dependency) - [ ] Dockerfile copies the binary and the
.pckfile (plus thedata_<project>_<platform>_<arch>folder for C#) to the image - [ ] UDP port is opened in the VPS firewall before the first test run
- [ ] systemd service has
Restart=on-failureso the server recovers from crashes automatically - [ ] Logs are routed to the systemd journal and inspectable with
journalctl -u <service> -f
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dedicated-server/SKILL.md
Popularity
- Repository stars
- 354
- Repository forks
- 18
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jame581/godotprompter/dedicated-server)