The game now opens on a main menu when it has a window: practice
against bots (count and skill), join a server (by address, or from a
LAN search list), settings, and quit. In a match, Escape brings up a
pause menu (the match goes on) with settings and leave; when a match
the player was in ends, a results screen shows their place,
eliminations and the last of the feed.
- KeyBindings: every action rebindable to a key or mouse button.
bind() refuses an input another action uses and names it; Escape is
reserved. ClientInput reads keys through the bindings.
- GameSettings: bindings, mouse, graphics (quality preset and the
print pass), audio (master, music and effects buses), display
(window mode, vsync, frame cap), name, last server and practice
choices, saved in user://settings.cfg. Missing, unreadable or
corrupt files and bad values fall back to defaults, value by value;
hand-edited key clashes are repaired on load.
- Menus (src/ui): paper-and-ink panels, brass focus edge, keyboard
navigable; a drawn sea-and-tide-post backdrop, or an ink wash over
a match. AppShell runs menus and the session.
- LocalServer takes a bot difficulty.
- make menu-captures renders every screen.
Closes#50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- packaging/server/tidewall-server: a wrapper that turns SIGTERM and SIGINT
into a clean stop through the server's new --stop-file, since the engine
can't catch signals. The server tells everyone it shut down, logs its
statistics and exits 0; the wrapper kills it only after 15 s.
- --config=PATH reads options from a file (packaging/server/server.cfg);
options after it on the command line win.
- --health-port answers GET /health with JSON (phase, players, tick, uptime)
on loopback by default. HealthServer is non-blocking and bounded.
- packaging/docker: a debian:13 image that checks the engine against
tools/engine.sha512, imports the game at build time, runs as an unprivileged
user, and works with a read-only root and a small /tmp. compose.yaml is
project and container tidewall-server, read-only, no capabilities.
- packaging/systemd: a hardened unit with a dynamic user.
- make server-package-check: compose up, healthy, non-root, read-only, a real
headless client joins over UDP into the drop, then SIGTERM stops it cleanly.
This also covers H7 (graceful shutdown on SIGTERM).
Closes#38Closes#70
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make soak runs a real server and 24 headless clients in three processes for
two whole matches in real time. Each client reaches the server through its own
UdpRelay, which adds 60 ms, +/-20 ms jitter and 2% loss each way, so ENet runs
unchanged over a bad link. SoakPlayer drives each client from what a client
knows: it drops, glides, heads for high ground, harvests and tries to build.
tools/soak_report.gd checks world hashes against the server's, errors,
unreadable packets, every client playing every match with its connection
intact, memory between matches, and the p99 tick with the network's share.
make soak-selfcheck proves a drifted client world is caught.
Server changes: --matches=N, --world-hash-every=N, tick timing that includes
after_tick, and memory in match and progress lines.
What the soak found and fixed:
- Snapshot building for 24 clients took the p99 tick to 13.8 ms, over the
12 ms budget, against a 2.8 ms simulation. Encoded records are now shared
between clients for the tick, unchanged records skip the field diff, and
clients are spread over the snapshot interval by handle. p99 is 7.3 ms.
- ENet peers had a timeout limit of 0, which gives up on a peer as soon as any
reliable message has waited the minimum timeout. Now ENet's default, 32.
Not fixed: one or two clients still lose their connection about 15 s into the
second match's drop in each run (see the issue), so the soak still fails and
N8 stays open.
Refs #39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A hostile test client crafts INPUT packets byte by byte and sends them
through NetGame.take_input() into a real match: extreme axes, the same
tick claimed repeatedly, the whole lead window at once, past, far-future
and maximum ticks, fire toggled every tick with slot swaps, builds aimed
anywhere with junk kinds and materials and no materials, and
pickup/drop/select tricks. Speed stays within sprint speed per tick,
shots within the weapon's rate, pieces within build reach and paid for,
and every item is conserved.
- Fix: a command tick beyond the simulation's lead window no longer moves
NetGame's dedupe marker, so one bogus far-future tick can't lock out a
player's real commands.
- Connections are rate-limited per address (32 per 10 s, 8 handshakes in
progress) with a new REASON_BUSY and a message for it.
- ParserFuzz mutates real messages from a bot match and random bytes and
feeds them to every network decoder, the snapshot receiver and the list
server. 20,000 per make check; make fuzz runs 1,000,000 (about 40 s):
no errors, 2.9 KB of memory growth.
- ARCHITECTURE.md: "Trusting nothing from clients".
Closes#40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- LAN discovery: a listening server answers QUERY packets on its game port
plus one (ServerBeacon, off with --no-lan). ServerBrowser scans eight game
ports from 24650 by broadcast.
- A self-hostable list server: --list-server [--port=N] (ListServer,
default UDP 24660). Game servers register with --list=HOST[:PORT] and
--name=NAME; they are listed under their source address only after
echoing a CHALLENGE token. Entries expire after 45 s, 8 per address,
256 in all; every source is rate-limited (SourceLimiter).
- NetDiscovery messages: every QUERY is padded to 512 bytes and no answer
is bigger, so neither service amplifies spoofed requests.
- tidewall --browse [--list=...] [--lan-target=IP] [--lan-port=N] prints
the servers found as JSON until menus (A10) show them.
- People who connect mid-match or during results watch a living player
(Match.watch) and take places ahead of bots in the next lobby, instead
of being told the server is full. Bots fill only the places left when
the match starts.
- Tests: codec round trips, size limits and a 40,000-message fuzz; list
server with fake servers (challenge, stolen and wrong tokens, renewal,
expiry, caps, flood); LAN scan over loopback; watchers over UDP; lobby
backfill. make discovery-check runs it all as real processes.
Closes#37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client program now turns a connection into a match someone can play.
- ClientSession: a ClientGame, the keyboard and mouse as commands
(ClientInput), and a MatchView of the client's own copy of the world.
- ClientMirror writes what the client is showing into that world every
frame: other players from the recent past, its own player where it was
predicted, items, the barge, the clock and the sea. The existing views
draw it unchanged.
- LocalServer: offline play is the same ServerLoop and NetGame in the same
process, with packets handed across in memory, so there is one path.
- main.gd: --connect=HOST[:PORT] joins a server, otherwise an offline
match; --autoplay and --client-seconds=N for scripts and checks.
- The camera aboard the barge follows the player's own place on the deck.
Tests drive a scripted client through a whole match on a real server over
loopback UDP, lobby to results, and through an offline match. `make
client-check` does it with two real processes, and `make client-captures`
renders what the client sees.
Closes#77
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NetSnapshot defines the game traffic after the handshake: delta snapshots of
quantized entity records, the client's input packet and a reliable match
notice. SnapshotSender builds each client's snapshot against the newest one
it acknowledged, tells it only about entities near the player it is watching,
and keeps every snapshot under 1,200 bytes, nearest first, with a staleness
bonus so nothing starves. SnapshotReceiver rebuilds the picture, ignores old
and repeated snapshots and asks for a fresh start if it is ever sent a delta
on something it doesn't hold.
NetGame joins the transport to the match: people who connect become
participants, their inputs go through ServerLoop.submit() once per tick, and
snapshots go out 20 times a second. `--server --listen` makes the headless
server take network players and wait in the lobby for the first of them.
Measured by test on a 24-player match start with every player a client, a
tenth of packets lost and late acknowledgements: 2.4 KB/s mean and 2.5 KB/s
for the worst client, packet headers included, against a 40 KB/s limit.
Closes#33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`make match` plays one whole match from the lobby to the results and back to the
lobby: one scripted player and 23 bots on a local server, with no script errors.
- CommandLog records the seed, the rules and every command the server is given.
MatchReplay plays a log again with nobody thinking and ends on the same state
hash; `make match` saves the log, reads it back and checks that.
- ServerLoop.submit() is now the one way commands reach the simulation, so a
recording server sees them all.
- ScriptedPlayer plays a human seat: it drops, loots, fights and flees as a bot
does, and also cuts driftwood and builds a breakwater and a wall.
- Bots draw randomness from their own per-bot generators, not the simulation's
streams. A bot thinking no longer changes the simulation's state, which a
replay without bots needs.
- MatchView and EntityView draw a match from one Simulation: terrain, sea,
points of interest, props, pieces, players, the barge, items and chests, with
stand-in shapes for the art pass to replace.
- `make match-captures` renders eight stages of the recorded match.
Closes#31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BotBrain plays a match with the commands a player sends: it picks a landing
marker near the barge's route, loots points of interest (following their own
walking routes into huts, lofts and piers), fights opponents it can see,
bandages itself, and gets to ground the coming tide will leave dry. BotWorld
is the map every bot shares: loot markers, routes, and each tide phase's safe
ground, which is the dry land joined to the island's highest walkable ground.
Three difficulties (Tuning.BOT_DIFFICULTIES) set reaction time, sight range
and aim error. The server mixes them unless --bot-difficulty says otherwise.
NavGrid labels connected regions when it is built, so a goal that is cut off
is turned down without a search of the whole island (about 70 ms each).
make bot-matches plays 20 bot-only matches and checks winners, drownings and
difficulty. Seeds 101 to 120: 20 of 20 with a winner, 7 of 460 deaths were
drownings (1.5%), easy bots placed worst (13.7 against 11.8 and 12.0) and
hard bots took the most eliminations (186 against 137 and 132).
Closes#28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TerrainView draws the island as 16 x 16 chunks of 64 m, each at one of
four detail levels (2, 4, 8 and 16 m spacing) chosen by distance to the
camera. TerrainChunkBuilder builds chunk geometry on WorkerThreadPool
threads; the main thread only uploads finished meshes, within a 2 ms
per-frame budget, nearest chunks first.
- Seams: every chunk hangs skirts deeper than twice the most any level
strays from the full-resolution edge, so neighbours at any two levels
meet without a crack. Normals come from the full-resolution heightfield
at every level, and back faces light like the ground above them.
- Splat material: a procedural shader blends sand, marsh, grass and rock
with weights from the island's bands, averaged over 4 m so borders
blend. Steep ground turns to rock and summits weather pale.
- Collision stays SimGround's heightfield, with no renderer involved.
- Capture scenarios terrain, terrain_lod (tinted by level) and
terrain_cracks (magenta sky). tools/crack_check.gd counts sky pixels
seen through the ground; make terrain-capture requires cracks in a
skirtless control and none in the real terrain.
Tests: chunk vertices sit on the heightfield; skirts cover every pairing
of levels on sampled shared edges; detail falls with distance; flying
across the island at 30 m/s for 2,037 frames streams 661 chunk rebuilds
with the worst main-thread frame at 0.8 to 1.4 ms (headless, CPU only);
24 players over 900 ticks on two generated islands never sink into the
ground, and a player sprints up towards a summit unharmed.
make terrain-capture: control 437 crack pixels, terrain 0.
Closes#10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Island.generate(seed) builds a 513 x 513 heightfield (2 m spacing, the whole
1,024 m world) from the match seed's "worldgen" stream: a warped coastline,
a coastal shelf and interior dome, two to four summits joined by ridges,
rolling and rocky detail, and flattened marsh in wet lowland. Land is scaled
so the tallest summit lands between ISLAND_PEAK_MIN and ISLAND_PEAK_MAX,
under the last tide. Each sample gets an elevation band (sea, beach, marsh,
forest, highland, summit) for terrain materials.
- Simulation generates the island unless a test supplies its own ground,
and spawns players on dry land until the drop arrives.
- The headless server logs world_hash in its start line.
- Island.heightmap_hash() is SHA-256 over millimetre heights and bands.
- tools/island_map.gd draws a top-down map with tide contours.
- New island constants in tuning.gd; GDD gains an island section.
Tests: a 100-seed sweep checks generation time (slowest 617 ms against
5 s), land area, at least two distinct high points, walkable land, bands,
and that no more than 3% of dry land is cut off at sea levels 0 and 8 m
(worst seen 0.87%). A separate server process given only the seed must
log the same heightmap hash.
Closes#9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/capture.sh <scene-or-scenario> <out.png> renders the real client
in a throwaway tidewall-capture-* Docker container (debian:13, Xvfb,
Mesa software rendering), with no network, no host display, GPU or
audio, and removes the container afterwards. The tidewall-capture image
rebuilds only when its recipe changes.
Forward+ through Lavapipe is the default, matching the game;
CAPTURE_RENDERER=compatibility uses OpenGL through llvmpipe. The script
fails if Godot silently falls back to another renderer, and fails on a
blank frame, judged by ImageStats (luminance variance and colour count).
make capture-test renders the shore test scene with both renderers and
proves an empty scene is rejected. ImageStats has unit tests in
make check. CLAUDE.md now requires a capture for visual issues, and
requires that it be opened and looked at.
Closes#7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`tools/godot.sh -- --server` runs a headless dedicated server with
--seed, --port, --players, --bots, --ticks, --unthrottled and
--log-every. ServerLoop drives the simulation and times every tick
without a scene tree, so tests run it directly. A placeholder WanderBot
gives smoke runs realistic load until the v0.4 bots land.
Logs are JSON lines that all carry the seed. An ErrorCounter logger
makes any engine or script error exit 1; a bad command line exits 2.
`make smoke` (now part of `make check`) runs 1,000 ticks with 24 bots,
prints min/mean/p50/p95/p99/max tick time against the 12 ms budget,
reruns to confirm the state hash reproduces, and proves a deliberate
script error and a bad config both exit non-zero.
Closes#6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the Godot 4.7.2 project, src/ module layout, LFS rules, licences, CLAUDE.md
and the devlog. tools/godot.sh runs the repo-local engine, headless by default, and
keeps engine data inside the repo. The engine version and SHA-512 sums are recorded
in tools/. make check verifies the engine, checks binaries and parses every script.
Closes#1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>