M8 Complete offline match #31

Closed
opened 2026-11-09 05:27:08 +00:00 by claude · 1 comment
Owner

Depends on: M2, M3, M5

Milestone gate: one player and 23 bots through a whole match on a local server, driven by a scripted client.

Acceptance

  • make match runs a full match from lobby to results with no script errors.
  • A seed and command log can reproduce a match.
  • Render captures at each stage are reviewed and described on this issue.
**Depends on:** M2, M3, M5 Milestone gate: one player and 23 bots through a whole match on a local server, driven by a scripted client. **Acceptance** - `make match` runs a full match from lobby to results with no script errors. - A seed and command log can reproduce a match. - Render captures at each stage are reviewed and described on this issue.
claude added this to the v0.4 Match Loop and Bots milestone 2026-11-09 05:27:08 +00:00
claude added the priority/hightype/feature labels 2026-11-09 05:27:08 +00:00
claude added this to the Tidewall v1.0 project 2026-11-09 15:00:07 +00:00
eric referenced this issue from a commit 2026-11-12 10:35:35 +00:00
eric closed this issue 2026-11-12 10:35:35 +00:00
Author
Owner

Done in 1d6a24a.

What changed

  • make match plays one whole match, lobby → countdown → drop → play → results → lobby: one scripted player and 23 bots on a local server (about 25 s). It fails on any script or engine error, a missing phase, no winner, or a replay that differs.
  • CommandLog keeps the seed, the rules and every command the server was given. MatchReplay plays it again with nobody thinking. make match saves the log (build/match/match.tclog, about 0.6 MB), reads it back, replays it and compares the final tick, winners and state hash.
  • ScriptedPlayer plays the human seat. It drops, loots, fights and flees as a bot does, and also cuts driftwood and builds a breakwater and a wall.
  • Bots now draw randomness from their own per-bot generators instead of the simulation's "bots" stream. Before this, a bot thinking changed the simulation's state, so a replay without bots could never match.
  • MatchView and EntityView (client) draw a match from one Simulation. Players, the barge, items and chests are stand-in shapes built in code.
  • make match-captures renders eight stages of the recorded match from its log.

Tested

  • make check: 339 tests pass, self-check and smoke pass (p99 2.3 ms with 24 bots). 17 new tests: command log round trip and malformed files, replay to the end / partway / through lobby and countdown, scripted player harvesting and building, match view.
  • One change came after that full run: log handles widened from 16 to 32 bits. After it I re-ran the parse, the log and replay tests, and make match, all passing.
  • make match on seeds 1 to 8, 2 and 20261112: every match finished with a winner and every replay ended on the recording's hash. Seed 2 (the default): the player lands at 0:13, builds two pieces at 1:03, and is eliminated in 3rd place at 4:47; the match ends at 6:09.

Captures reviewed (seed 2, Forward+ through Lavapipe; software rendering, so nothing here says anything about frame rate or feel)

  1. match_lobby: the whole island from the south-west, sea at 0 m, forest, two rocky summits, huts and a salt works visible. Readable, a little hazy.
  2. match_barge: 24 figures in oilskins standing in rows on the barge's deck under its canvas envelope, the island below.
  3. match_glide: the player under a canvas wing-sail a second after it opens, forest and summits ahead, other gliders' shadows on the ground.
  4. match_landed: the player on grass by a scrub bush four seconds after landing, pines on the ridge.
  5. match_built: the player with the two driftwood pieces they just placed standing behind them.
  6. match_final: three left standing, the player on the rocky summit at 3:07.
  7. match_tide: the island from the lobby's viewpoint just before the end, sea at 18 m: the lowland, its trees and huts are under water and only the middle of the island is left.
  8. match_results: the winner (bot 3) among pines, with the top three placements in the caption.

The captions are test captions in Godot's default font, not the HUD (A9).

What the captures and runs showed, for later issues

  • Figures are a capsule, a box and a hat. The barge is boxes and a sphere. A2 and A5 replace them.
  • A pine's canopy isn't in the camera's collision, so a canopy can fill the shoulder view. Opened as a bug.
  • The sea is one flat plane at sea level: it doesn't show where breakwaters hold water back (A6), and its edge is visible from high up.
  • Matches end early: in 10 runs, between 3:18 and 9:16, when the tide's schedule runs 18 minutes. On seed 2 the last three wandered for three minutes without meeting. Noted on #56 (H3).
  • On 5 of 10 seeds the scripted player never got to harvest: it was eliminated first, or always had something more pressing. make match doesn't require the building step; test_scripted_player does, on seed 2.
Done in 1d6a24a. **What changed** - `make match` plays one whole match, lobby → countdown → drop → play → results → lobby: one scripted player and 23 bots on a local server (about 25 s). It fails on any script or engine error, a missing phase, no winner, or a replay that differs. - `CommandLog` keeps the seed, the rules and every command the server was given. `MatchReplay` plays it again with nobody thinking. `make match` saves the log (`build/match/match.tclog`, about 0.6 MB), reads it back, replays it and compares the final tick, winners and state hash. - `ScriptedPlayer` plays the human seat. It drops, loots, fights and flees as a bot does, and also cuts driftwood and builds a breakwater and a wall. - Bots now draw randomness from their own per-bot generators instead of the simulation's `"bots"` stream. Before this, a bot thinking changed the simulation's state, so a replay without bots could never match. - `MatchView` and `EntityView` (client) draw a match from one `Simulation`. Players, the barge, items and chests are stand-in shapes built in code. - `make match-captures` renders eight stages of the recorded match from its log. **Tested** - `make check`: 339 tests pass, self-check and smoke pass (p99 2.3 ms with 24 bots). 17 new tests: command log round trip and malformed files, replay to the end / partway / through lobby and countdown, scripted player harvesting and building, match view. - One change came after that full run: log handles widened from 16 to 32 bits. After it I re-ran the parse, the log and replay tests, and `make match`, all passing. - `make match` on seeds 1 to 8, 2 and 20261112: every match finished with a winner and every replay ended on the recording's hash. Seed 2 (the default): the player lands at 0:13, builds two pieces at 1:03, and is eliminated in 3rd place at 4:47; the match ends at 6:09. **Captures reviewed** (seed 2, Forward+ through Lavapipe; software rendering, so nothing here says anything about frame rate or feel) 1. `match_lobby`: the whole island from the south-west, sea at 0 m, forest, two rocky summits, huts and a salt works visible. Readable, a little hazy. 2. `match_barge`: 24 figures in oilskins standing in rows on the barge's deck under its canvas envelope, the island below. 3. `match_glide`: the player under a canvas wing-sail a second after it opens, forest and summits ahead, other gliders' shadows on the ground. 4. `match_landed`: the player on grass by a scrub bush four seconds after landing, pines on the ridge. 5. `match_built`: the player with the two driftwood pieces they just placed standing behind them. 6. `match_final`: three left standing, the player on the rocky summit at 3:07. 7. `match_tide`: the island from the lobby's viewpoint just before the end, sea at 18 m: the lowland, its trees and huts are under water and only the middle of the island is left. 8. `match_results`: the winner (bot 3) among pines, with the top three placements in the caption. The captions are test captions in Godot's default font, not the HUD (A9). **What the captures and runs showed, for later issues** - Figures are a capsule, a box and a hat. The barge is boxes and a sphere. A2 and A5 replace them. - A pine's canopy isn't in the camera's collision, so a canopy can fill the shoulder view. Opened as a bug. - The sea is one flat plane at sea level: it doesn't show where breakwaters hold water back (A6), and its edge is visible from high up. - Matches end early: in 10 runs, between 3:18 and 9:16, when the tide's schedule runs 18 minutes. On seed 2 the last three wandered for three minutes without meeting. Noted on #56 (H3). - On 5 of 10 seeds the scripted player never got to harvest: it was eliminated first, or always had something more pressing. `make match` doesn't require the building step; `test_scripted_player` does, on seed 2.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claude/tidewall#31