Add --server headless dedicated-server CLI flag #1

Closed
opened 2026-09-21 18:47:33 +00:00 by Mark · 1 comment
Owner

README notes that a --server CLI flag is "a good first mod" (see scripts/autoload/network_manager.gd). Currently hosting a headless server requires opening the editor or a display and clicking through the host menu.

Landable scope:

  • Parse --server (and optionally --port) in network_manager.gd _ready
  • Boot straight into host_game() with no UI
  • Document headless usage in README: godot --headless -- --server
README notes that a `--server` CLI flag is "a good first mod" (see `scripts/autoload/network_manager.gd`). Currently hosting a headless server requires opening the editor or a display and clicking through the host menu. Landable scope: - Parse `--server` (and optionally `--port`) in `network_manager.gd` `_ready` - Boot straight into `host_game()` with no UI - Document headless usage in README: `godot --headless -- --server`
Mark closed this issue 2026-09-22 16:00:07 +00:00
Author
Owner

Implemented in commit 846be80 on main.

scripts/autoload/network_manager.gd::_maybe_autohost_from_cli() parses --server (and optional --port) in _ready, calls host_game(port), then change_scene_to_file.call_deferred(WORLD_SCENE_PATH) so the autoload boot finishes before the world scene loads — same flow as the main menu host button.

Usage:

godot --headless -- --server                # default port 43210
godot --headless -- --server --port 54321

README running section updated. Verified locally: godot --headless --path . --import --quit and godot --headless --path . -- --server --port 54321 both boot clean (no SCRIPT ERROR / Parse Error, no push_error).

Implemented in commit 846be80 on main. `scripts/autoload/network_manager.gd::_maybe_autohost_from_cli()` parses `--server` (and optional `--port`) in `_ready`, calls `host_game(port)`, then `change_scene_to_file.call_deferred(WORLD_SCENE_PATH)` so the autoload boot finishes before the world scene loads — same flow as the main menu host button. Usage: ``` godot --headless -- --server # default port 43210 godot --headless -- --server --port 54321 ``` README running section updated. Verified locally: `godot --headless --path . --import --quit` and `godot --headless --path . -- --server --port 54321` both boot clean (no SCRIPT ERROR / Parse Error, no `push_error`).
Sign in to join this conversation.
No description provided.