Add a --server entry point with command-line config for seed, port, and player and bot counts.
Acceptance
make smoke boots the server, runs 1,000 ticks, reports timing statistics and exits cleanly.
Non-zero exit on any script error.
Logs are structured and contain the seed so runs can be reproduced.
**Depends on:** F5
Add a `--server` entry point with command-line config for seed, port, and player and bot counts.
**Acceptance**
- `make smoke` boots the server, runs 1,000 ticks, reports timing statistics and exits cleanly.
- Non-zero exit on any script error.
- Logs are structured and contain the seed so runs can be reproduced.
claude
added this to the v0.1 Foundations milestone 2026-11-09 05:26:04 +00:00
tools/godot.sh -- --server starts a headless dedicated server (src/app/main.gd → HeadlessServer). Options: --seed, --port, --players, --bots, --ticks, --unthrottled, --log-every. Unknown or malformed arguments are errors (exit 2), so a typo can't run the wrong match.
ServerLoop (RefCounted, no scene tree) adds players and bots, collects commands, steps the sim and times every tick. It runs at the real 30 Hz with the 5-tick catch-up cap, or back to back with --unthrottled.
Logs are JSON lines (start, progress, stats, stop, config_error), and every line carries the seed. With no --seed, the server picks one and logs it.
ErrorCounter (a Godot Logger) counts engine and script errors, so the server exits 1 after any of them.
WanderBot is a placeholder in src/bots/ that walks seeded headings, so the smoke run carries 24 players' worth of load until the v0.4 bots land.
--port is validated and logged, but nothing listens until v0.5. The start line says so ("listening": false).
Testing
make smoke (now part of make check): 1,000 ticks with 24 bots. Tick time on this host was min 140 µs, p95 147 µs, max 189 µs, none over the 12 ms budget. It reruns the same seed and checks the state hash matches, checks that a deliberate --fault=script-error exits 1, and checks that a bad command line exits 2.
SMOKE_REALTIME=1 SMOKE_TICKS=90 tools/smoke.sh took about 3 s, which confirms real-time pacing.
13 new unit tests in test/server/ cover config parsing and ranges, timing stats and percentiles, bot movement and seed reproducibility. make check passes: 51 tests and 8 self-check fixtures.
Follow-up: SIGTERM kills the process with exit 143 and no stop line, because Godot doesn't hand the signal to scripts. Graceful shutdown belongs in hardening, and I've opened an issue for it.
Done in d9d4c04.
**What changed**
- `tools/godot.sh -- --server` starts a headless dedicated server (`src/app/main.gd` → `HeadlessServer`). Options: `--seed`, `--port`, `--players`, `--bots`, `--ticks`, `--unthrottled`, `--log-every`. Unknown or malformed arguments are errors (exit 2), so a typo can't run the wrong match.
- `ServerLoop` (RefCounted, no scene tree) adds players and bots, collects commands, steps the sim and times every tick. It runs at the real 30 Hz with the 5-tick catch-up cap, or back to back with `--unthrottled`.
- Logs are JSON lines (`start`, `progress`, `stats`, `stop`, `config_error`), and every line carries the seed. With no `--seed`, the server picks one and logs it.
- `ErrorCounter` (a Godot `Logger`) counts engine and script errors, so the server exits 1 after any of them.
- `WanderBot` is a placeholder in `src/bots/` that walks seeded headings, so the smoke run carries 24 players' worth of load until the v0.4 bots land.
- `--port` is validated and logged, but nothing listens until v0.5. The start line says so (`"listening": false`).
**Testing**
- `make smoke` (now part of `make check`): 1,000 ticks with 24 bots. Tick time on this host was min 140 µs, p95 147 µs, max 189 µs, none over the 12 ms budget. It reruns the same seed and checks the state hash matches, checks that a deliberate `--fault=script-error` exits 1, and checks that a bad command line exits 2.
- `SMOKE_REALTIME=1 SMOKE_TICKS=90 tools/smoke.sh` took about 3 s, which confirms real-time pacing.
- 13 new unit tests in `test/server/` cover config parsing and ranges, timing stats and percentiles, bot movement and seed reproducibility. `make check` passes: 51 tests and 8 self-check fixtures.
**Follow-up:** SIGTERM kills the process with exit 143 and no `stop` line, because Godot doesn't hand the signal to scripts. Graceful shutdown belongs in hardening, and I've opened an issue for it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Depends on: F5
Add a
--serverentry point with command-line config for seed, port, and player and bot counts.Acceptance
make smokeboots the server, runs 1,000 ticks, reports timing statistics and exits cleanly.Done in
d9d4c04.What changed
tools/godot.sh -- --serverstarts a headless dedicated server (src/app/main.gd→HeadlessServer). Options:--seed,--port,--players,--bots,--ticks,--unthrottled,--log-every. Unknown or malformed arguments are errors (exit 2), so a typo can't run the wrong match.ServerLoop(RefCounted, no scene tree) adds players and bots, collects commands, steps the sim and times every tick. It runs at the real 30 Hz with the 5-tick catch-up cap, or back to back with--unthrottled.start,progress,stats,stop,config_error), and every line carries the seed. With no--seed, the server picks one and logs it.ErrorCounter(a GodotLogger) counts engine and script errors, so the server exits 1 after any of them.WanderBotis a placeholder insrc/bots/that walks seeded headings, so the smoke run carries 24 players' worth of load until the v0.4 bots land.--portis validated and logged, but nothing listens until v0.5. The start line says so ("listening": false).Testing
make smoke(now part ofmake check): 1,000 ticks with 24 bots. Tick time on this host was min 140 µs, p95 147 µs, max 189 µs, none over the 12 ms budget. It reruns the same seed and checks the state hash matches, checks that a deliberate--fault=script-errorexits 1, and checks that a bad command line exits 2.SMOKE_REALTIME=1 SMOKE_TICKS=90 tools/smoke.shtook about 3 s, which confirms real-time pacing.test/server/cover config parsing and ranges, timing stats and percentiles, bot movement and seed reproducibility.make checkpasses: 51 tests and 8 self-check fixtures.Follow-up: SIGTERM kills the process with exit 143 and no
stopline, because Godot doesn't hand the signal to scripts. Graceful shutdown belongs in hardening, and I've opened an issue for it.