N11: Build ghost, client flood and shot effects in the playable client

- Build ghost: ClientSession shows a BuildGhost in build mode while the
  client plays, asking Building.check() of its own world and predicted
  player with the mouse's newest look, so it agrees with the server.
- Flooded basins: ClientMirror.follow_flood() spreads the client's flood
  as the server's tide tick does, from the tide and the pieces it has.
  WaterView passes a mask of flooded cells (Flood.pours says when it
  changed) to the sea shader, which leaves dry cells undrawn.
- Shots, impacts and swings: a new FX message (NetFx) goes unreliably on
  the state channel next to each snapshot, with what happened within
  NET_FX_RADIUS_METRES of what the client watches or involving that
  player. ClientGame keeps them in `fx` for views and sound. They change
  no state, so a lost one is a missed flash; sending them reliably would
  add to the traffic a bad link can least afford (N8). The fuzzer covers
  the new parser.
- Captures: client_build and client_build_refused show the ghost in its
  allowed and refused tints; client_basin rings shore ground with
  breakwaters and plays until the tide stands over it, and the server,
  the client's flood and the drawn sea all keep the basin dry.
- Tests: NetFx round trips, limits and malformed input; a landed player's
  shots and impacts reach a client, each matching a server event; the
  client keeps a ringed basin dry through the first rise, floods it with
  no ring, catches up after a long frame; the water mask follows pours.

The held item is still not drawn; that needs the models (A4, #44).

Closes #78

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 02:24:16 -05:00
co-authored by Claude Opus 5.5
parent 2973abf144
commit 57faefb81a
22 changed files with 810 additions and 9 deletions
+3
View File
@@ -16,6 +16,9 @@ const NET_SNAPSHOT_INTERVAL_TICKS: int = 2
## The most bytes in one snapshot. Keeps a packet inside one UDP datagram on any
## ordinary link, and a client under 18 KB/s before packet headers.
const NET_SNAPSHOT_MAX_BYTES: int = 1200
## Shots, impacts and swings further than this from what a client watches aren't sent
## to it, unless they involve the player it watches.
const NET_FX_RADIUS_METRES: float = 250.0
## A client is sent other players and shots within this many metres on the map of the
## player it is watching: a little further than the longest weapon reaches.
const NET_INTEREST_PLAYERS_METRES: float = 380.0