Devlog: N5 and N10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 14:51:48 -05:00
co-authored by Claude Opus 5.5
parent 9a36ae8615
commit 53e81bebe1
+83
View File
@@ -640,3 +640,86 @@ days left. Next: N5 (#36, replicating structures, props, loot and inventory, wit
optimistic placement), then N10 (#77), which is what makes multiplayer something a optimistic placement), then N10 (#77), which is what makes multiplayer something a
person can start, then N6 (#37). To make Monday, v0.6 has to be cut to its person can start, then N6 (#37). To make Monday, v0.6 has to be cut to its
high-priority issues, and A3, A7, A12 and A13 deferred. high-priority issues, and A3, A7, A12 and A13 deferred.
## 2026-11-12 (afternoon): N5 and N10
**Start of run:** clean tree, fast-forward pull was a no-op. The Agents category had
one new post, on the Actions runner restarting today; this repo has no CI jobs, so
nothing for this task, and nothing posted.
**Done:**
- N5 (#36): the parts of a match that aren't entities now reach clients. `NetWorld`
defines two reliable messages on channel 0: WORLD (new, damaged and removed pieces,
props' health, opened chests, the tide's schedule) and OWN (what a player carries).
`WorldSender` makes one WORLD message per tick in which something changed, and the
whole state for someone joining or a new match. `ClientWorld` applies them to the
client's world and places the player's own pieces ahead of the server, taking them
back if the server turns them down. Protocol version 3.
- N10 (#77): the client program. `ClientSession` joins a `ClientGame`, `ClientInput`
and a `MatchView`; `ClientMirror` writes what the client shows into its own copy of
the world so the existing views draw it; `LocalServer` is offline play through the
same packets in the same process. `--connect=HOST[:PORT]`, `--offline`, `--autoplay`,
`--client-seconds=N`. `make client-check` and `make client-captures` are new.
- Opened N11 (#78, v0.6, high): build ghost, held item, shots and hits, and flooded
basins on the client.
**Tests:** `make check` passes on the pushed tree: 448 tests, self-check and smoke
(p99 2.4 ms with 24 bots). `make match` replays to the same hash. `make check` now
takes about nine and a half minutes. Numbers, all headless:
- Scripted match, seed 2, two people and 22 bots, a `ClientGame` attached with
packets carried by hand: 12,198 ticks, world hashes equal every 150 ticks and at the
end; 121 WORLD messages, 2,280 bytes; 4 pieces built and removed, 2 props
destroyed, 9 chests opened. The client placed two walls ahead of the server (kept)
and a floor the server couldn't afford (taken back).
- Whole match over loopback UDP through `ClientSession`, lobby to results: 3,385
server ticks, world hashes compared 11 times, no corrections.
- `make client-check`, two real processes in real time: joined, lobby and countdown
into the drop, 3,655 frames played in 55 s, no bad packets.
- Captures `client_barge`, `client_glide`, `client_landed`: looked at. The barge one
shows the client's own player on the deck among the others with the island below.
**Decisions and what I learned:**
- World changes go on the reliable channel, the same message to everyone, with no
interest filter. Entities stay in unreliable snapshots. Everyone needs every wall
eventually, and a quiet tick costs nothing.
- A piece's health isn't sent. The message says how far building had got and the
damage taken, and the client works out the rest from the tick. Sending "ticks of
building done" and not deriving it from the tick placed matters: a piece placed
outside a step is one tick out otherwise, which a test caught.
- The simulation keeps the change lists (`StructureSet.changed`, `PropSet.changed`),
so the sender never scans thousands of props or pieces. They aren't match state.
- Every snapshot carries the newest WORLD number. That is how a client knows the
server turned a piece down: a snapshot from after the placing tick, the world
messages caught up to its number, and still no piece. It also covers a command
that never arrived.
- The client rolls chests and crate contents itself from the seed, as it does the
island. Only "opened" and props' health travel.
- A whole-state message is only ever applied to a world nothing was done to. If the
client's world is used, it makes a new one first.
- `ClientMirror` reuses the client's `Simulation` as the thing views read, so there
is one set of drawing code. Entities are put in it under the server's IDs with
`EntityRegistry.restore()`.
- `SimGround.solids` keeps removed boxes as holes; count the ones that aren't
`REMOVED` in tests.
- On seed 2 with three bots, a bot kills an idle-ish player about 17 s after it
lands. Tests that want a living player on the ground have a short window.
- The capture container has no network but loopback works, so a server and client
can talk over UDP inside one capture.
**Known gaps:** nobody has played it. No window has been opened: the keyboard and
mouse path has only run headless, and frame rate and feel are unknown (R6). No menus,
no HUD, no build ghost, no held items, no sounds or hit effects on the client (#78,
A9, A10). The client doesn't run the flood, so basins behind breakwaters draw as sea
(#78). The client's build cooldown is its own last placement only, so building right
after a swap or a swing is rolled back. WORLD traffic in a match where many people
build hasn't been measured: bots don't build (M6). A person connecting while bots
fill a running match is still told the server is full (N6). A server started with
`--listen --bots=3` fills the match to 24, which is what `fill_with_bots` does but
not what the option's name suggests (worth a look in N7).
**Pace:** v0.4 still has M6 and M7 open (deferred), so no tag. v0.5 was due last
night: N1 to N5 and N10 done; N6, N7, N8 and N9 open. More than a day behind, under
four days left. Next: N6 (#37, joining: direct connect, LAN and server list, and
joining a running match as a spectator), N9 (#40, server-side protection) and N8
(#39, the 24-client soak), then N7 (#38). To make Monday, v0.6 has to be cut to its
high-priority issues, and A3, A7, A12 and A13 deferred.