Loading...
Loading...
Export and build a Godot 4.x project for distribution: install export templates, define export presets (Windows/macOS/Linux/Web/Android), run headless command-line exports for CI, and handle web (HTML5) COOP/COEP and dedicated-server/headless builds. Use when exporting a Godot game, configuring export_presets.cfg, building for web/desktop/mobile, or automating builds from the command line.
npx skill4agent add gamedev-skills/awesome-gamedev-agent-skills godot-exportsteam-publishitch-publishgodot-multiplayer.tpzexport_presets.cfg--export-release "<preset name>" <output path>res://user://# Preset name must match exactly what's in Project > Export (quote it).
# Run from the project directory (where project.godot lives).
godot --headless --export-release "Windows Desktop" build/windows/game.exe
godot --headless --export-release "Linux/X11" build/linux/game.x86_64
godot --headless --export-release "Web" build/web/index.html
# Debug build (includes debug symbols / remote debug):
godot --headless --export-debug "Windows Desktop" build/windows/game_debug.exe
# Export only the data pack (no executable):
godot --headless --export-pack "Linux/X11" build/game.pck# No window/GPU — for a server build or automated runs.
godot --headless --path . res://server_main.tscn
# Quit after N main-loop iterations (frames, NOT seconds) — handy for a headless smoke test:
godot --headless --path . --quit-after 600func _ready() -> void:
if OS.has_feature("dedicated_server") or DisplayServer.get_name() == "headless":
_start_server_only() # skip rendering/UI on a headless server
if OS.has_feature("web"):
_apply_web_tweaks()
# Custom feature tags (added per preset) are also queryable:
# if OS.has_feature("demo"): limit_content()# res:// is READ-ONLY in exported games. Always write to user://.
func save_path() -> String:
return "user://savegame.tres" # resolves to the OS app-data dir
func _ready() -> void:
print(OS.get_user_data_dir()) # where user:// actually lives--export-release "Windows""Windows Desktop"Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corpSharedArrayBufferfile://res://user://.json.txt*.jsonINTERNET--export-debug--export-releaseexport_presets.cfgreferences/presets-and-cli.mdgodot-multiplayersteam-publishitch-publishprototype-fastgame-jam