A short, skippable tutorial on an island of your own: leave the barge, glide
down, walk and jump, cut materials with the boathook, place a wall, aim and
fire, and get above the line the tide will reach after its next rise.
- MatchRules.tutorial(): one player, no bots, last_team_wins off (alone is
not a win, only the tide or a fall ends it) and starting_kit (a dock
carbine with a full magazine and 60 cartridges, Tuning.TUTORIAL_KIT).
Both rules go in command logs; older logs read with the defaults.
- Tutorial watches the client's own view (predicted player, world copy,
FX) and moves on when each step is done. Instructions name the player's
own key bindings. TutorialCard shows it under the minimap.
- TutorialPilot plays it through ClientInput for --tutorial --autoplay,
the tests and make tutorial-check (12 seeds, all finish).
- First launch offers it (welcome screen, remembered in settings); it is
always on the main menu; Leave in the pause menu skips it. Finishing is
saved. --tutorial on the command line.
- make tutorial-captures; PLAY.md, the man page, ARCHITECTURE.md and
CLAUDE.md updated.
Closes#52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two-player teams, enforced by the simulation:
- Match puts every player on a team (SimEntity.team); Weapons.damage_player
refuses damage between teammates from every weapon, the boathook and blasts.
- A player whose health runs out with a teammate standing goes down instead of
out: 60 health to bleed (one point every half second), crawling at 1 m/s, no
firing, building, looting or items. Hits still take it; drowning too.
- A standing teammate within 2 m holding interact for 6 s revives them with 30
health. Letting go or moving away starts it over.
- Downed players are out when their health runs out again or when no teammate
is left standing, credited to whoever downed them. A team falls together and
shares its place; the tie-break puts standing ahead of downed.
- Downs and revives go through Match events and the kill feed ("X knocked Y
down"); the HUD says what to do while down.
Wire: FLAG_DOWNED in the player record and the own block (flags now u16),
so prediction crawls too. Protocol version 5.
Bots: never target a teammate, land with their teammate, regroup when they
stray past 30 m, crawl toward a standing teammate when down, go to revive a
downed teammate within 60 m when not in a fight, and turn from a downed target
to its standing teammate when it's in view.
Options: --team-size=2 on the server, --duos offline, and Solo/Duos under
Crew in the Practice menu. The figure has a downed crawl pose.
Tests: test_duos (downing, crawl, revive, interrupted revive, bleed-out,
finishing, team out, falling together, no friendly damage including kegs,
drowning while down, hash, match placement and tie-break), bots as teammates,
the downed flag on the wire, the feed, server and menu options. make
duo-matches plays 10 bot duos matches.
Closes#30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bots now gather materials with the boathook and build with the same build
command and Building.check a player's client goes through:
- Gathering: an armed bot with nothing more pressing gathers from props
nearby (12 m while looting, 24 m once there's nothing left to loot) up to
60 of a material, or 120 in the last three tide phases. Not within 10 s of
seeing an opponent or being hit, and not when hurt.
- Cover: a wall toward a shooter who catches it reloading, from ambush or
worn down to 60, then waits behind it to reload or heal.
- Wall and heal: a badly hurt bot that would break off walls itself off and
heals where it stands instead, if it can afford a wall.
- Ramps: a staircase of ramps, each from the top of the last, up to an
opponent on a cliff or a steep rise (at most 5 a fight).
- Breakwaters: late in the match, a bot the tide would catch before it
reached dry ground, or one at the last stand, rings its cell with four
breakwaters and stays inside while they hold.
Measured with the new `make bot-builds` (tools/bot_builds.gd): every other
bot builds and the rest are a control group. Over 40 matches, seeds 501 to
540: builders built in 53% of the fights they began with materials for a
wall (12% of all fights; most fights are in the landing, before anyone has
gathered), lost 58% of the fights they built in against 67% of the rest,
and placed 12.1 on average against the control's 12.8. Overall fight losses
(65.8% / 65.7%) and wins (20 / 20) came out level; docs/BALANCE.md has the
numbers and the earlier batches that led to the careful gathering. Worst
p99 tick 3.4 ms of the 12 ms budget.
Closes#29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The R5 gate's soak failed its client leak check: match 0 was decided
during the drop (23 eliminations as the clients landed) and never
reached play, which is the only phase soak_clients sampled memory in,
so each client process had one sample instead of two. Hashes, tick
timing and server memory all passed.
A match that never reaches play is now sampled at its results, and the
memory line says which phase it was taken in. The rule is a static
function, SoakClients.samples_memory_in, covered by a new test. A
results sample can sit a little above a play sample, so a run that
samples match 0 at its results is slightly lenient on growth from it.
Closes#86
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs/ASSET_PROVENANCE.md traces each of the 162 files under assets/ to
the script that generates it, or to its hand-written original (the app
icon's SVG). It's written by tools/provenance.gd, and the new
test_asset_provenance fails on a file with no rule, a rule naming a
generator that doesn't exist, or a stale document. The release package
and the .deb now ship it next to PROVENANCE.md (make dist-check and
make deb-check pass).
- Searched code, data, assets, docs and packaging for commercial game
names, characters, item and place names: none. The only matches are the
genre wording ("battle royale") and, in the DEVLOG, an open-source engine
another task uses. Item and place names are Tidewall's own (dock carbine,
fowling piece, tern chapel...).
- Licence notices: the Godot engine's licence and its third-party notices
(ENGINE-LICENSES.txt, generated from the engine) already ship in the
tarball and the .deb's copyright; there are no other libraries, addons or
fonts. CREDITS.md links the new trace.
- Name check for "Tidewall" noted on R7 (#66).
Closes#63
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rendered all 82 capture scenarios and the HUD at 3840x2160, and viewed
every one against a checklist covering menus, the lobby, the drop, every
biome, points of interest, building, players and items, combat, the HUD,
the chart, each tide phase, the gale, under water and results
(docs/VISUAL_QA.md). Two defects were filed and fixed: H15 (#84) and H16
(#85).
- make qa-captures (tools/qa_captures.sh) renders the whole set one
container at a time, waiting when the host is short of memory, and
tools/contact_sheet.gd lays them out four to a sheet for a first look.
- No placeholder art or text remains: ARCHITECTURE.md no longer calls the
figures, barge and items stand-ins. The plain shapes in the camera*
scenarios are test cards under test/, which isn't exported.
Closes#59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make stability (tools/stability.sh, StabilityReport) runs one dedicated
server for 50 bot matches back to back, unthrottled, sampling its resident
memory, and fails on a crash, hang, engine or script error, a match with
no winner, or memory that grows after the first five matches.
The first run had no crash, hang or error, but showed two leaks:
- ServerLoop kept every tick's duration in an array (8 bytes a tick,
about 21 MB a day at 30 Hz) and copied and sorted all of it for every
progress line. TickTimes keeps exact statistics in fixed memory: a
one-microsecond histogram up to 65 ms, plus the rare slower ticks.
- Resident memory grew about 28 MB a match (905 MB after 42 matches):
glibc gives each thread its own malloc arena, and every next island is
built on a worker thread. The server launchers (packaging/server,
packaging/dist, so also the .deb, Docker image and systemd unit) and
tools/godot.sh for --server now set MALLOC_ARENA_MAX=1 unless already
set. Tick times were unchanged (p50 501 vs 507 us, p99 1635 vs 1625).
After: 50 matches (seed 4242) in 756 s, all with a winner, exit 0, no
errors; static memory +1.6 KiB and resident +145 KiB a match, flat at
204 MB from match 26 on. No match crashed, so there is no crash seed to
turn into a regression test.
Tests: TickTimes against a sorted list, its fixed memory, the launchers'
setting, and StabilityReport. make check, dist-check and
server-package-check pass.
Closes#57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make balance (tools/balance.sh, tools/balance.gd, BalanceReport) plays 200
bot-only matches in four processes under nice and reports match length,
players standing over time, causes of death, eliminations by weapon and by
difficulty, judged against the new BALANCE_* targets in Tuning and the
GDD's Balance section.
Before: median match 5.0 min, 3.4 of 24 standing at 2 min, the boathook
41% of eliminations. After, over seeds 1001-1200: median 13.1 min (p10 9.2,
p90 14.6), top weapon the rivet repeater at 31.7%. Passes.
Changes, each traced from single-match runs (docs/BALANCE.md):
- Fix: bots leapt from the barge on a timer and landed hundreds of metres
short of their spot; they now leap when it's in gliding reach or the
barge starts drawing away from it.
- Bots spread their landings, only brawl whoever hit them, pick out new
opponents within 30 m, roam locally and hold ground, run from a gun when
unarmed, and (normal and hard) break off when badly hurt.
- Aim error widened; rivet repeater damage 17 to 15.
- Tide: lower early levels, longer holds; every match ends within 17.75 min.
Tests: BalanceReport, the new bot behaviours, the tide length. Tests that
leaned on old bot luck now pin or set up what they check. make match moves
to seed 29, where the scripted player still builds.
Closes#56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- make deb (tools/deb.sh) builds tidewall_<version>-1_amd64.deb with
dpkg-deb: launchers in /usr/games, the game in /usr/lib/tidewall, a
validated desktop entry, hicolor icons, man pages, a DEP-5 copyright,
the engine's licences and md5sums. No maintainer scripts. Depends on
libc6 (>= 2.28), from the binary's GLIBC symbol versions.
- make deb-check (tools/deb_check.sh) checks it in a throwaway debian:13
container: apt install with no recommends, desktop-file-validate,
icons, man pages and licences, tidewall on a user's PATH, the server
and the game headless as a user, lintian, and a purge that leaves
nothing behind.
- The tarball gains a tidewall launcher (any directory, through a
symlink), install-desktop-entry.sh (per-user menu entry, --remove),
tidewall.png and ENGINE-LICENSES.txt (Godot's MIT text and bundled
notices, which R1 lacked). make dist-check covers the launcher and the
menu entry.
- Application icon: a hand-written SVG in palette colours, rendered to
16-512 px by make app-icon, and set as the window icon.
test_app_icon checks the renders, the colours and the setting.
- Fix: looping ambience played into the Dummy audio driver could be
reported as resources in use at exit. Directors play nothing without
real audio output (SoundBank.has_output()) and stop their voices on
exit.
Tests: make check (648), make dist-check, make deb-check all pass.
Closes#61
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/SECURITY_REVIEW.md lists the scope, nine findings and what was done.
- High, fixed: a peer that connects and stops answering kept its ENet slot
for up to 15 s after being turned away, so one address could fill every
slot. Flood refusals now disconnect at once (reason in the disconnect
data, which NetClient now honours for REASON_BUSY), peers told to leave
get 1 s to acknowledge, and when slots run short the longest-waiting
silent guest makes room.
- Medium, mitigated: ENet holds half-open slots for spoofed CONNECTs that
the script never sees. The host now has 512 slots (NetServer.peer_slots).
- Medium, fixed: SourceLimiter, handshakes per source and the list
server's per-address cap count an IPv6 /64 as one source.
- Low, fixed: CommandLog refuses a header with non-numeric fields instead
of raising errors.
- tools/godot.sh unsets DISPLAY and WAYLAND_DISPLAY so the engine's error
alerts can never reach the host desktop.
- A test fixture's 10.0.0.9 is now the documentation address 192.0.2.9.
Tests: 4 new handshake tests with real non-acknowledging ENet peers,
test_source_limiter (3), a CommandLog type test. make check, make fuzz,
make client-check, make discovery-check and make soak-selfcheck pass.
Closes#58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Presets now tune shadows, cascades, render scale and anti-aliasing:
Low (no shadows, 75%, FXAA), Medium (200 m, 2 cascades, FXAA), High
(400 m, 4 cascades, MSAA 2x). GameSettings.apply_to_viewport sets the
viewport; MatchView.apply_settings sets the sun's cascades. No preset
changes how far props or pieces are drawn, so a lower one never shows a
player through cover; a test guards it.
When Vulkan can't start, Godot falls back to OpenGL (fallback_to_opengl3)
and RendererCheck has the main menu say so. tools/capture.sh gains
CAPTURE_RENDERER=no_vulkan, which hides the Vulkan driver and expects the
fallback. New scenarios quality_low/medium/high draw a match moment with
each preset, reviewed in both renderers.
docs/PLAY.md lists the presets, renderers, Wayland and hybrid-GPU notes,
and the tested configurations, marking each as software-rendered only or
not tested.
Closes#55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make dist (tools/dist.sh) checks the official export templates against
tools/engine.sha512, installs only the Linux x86_64 ones into the
repo-local engine data, exports the "Linux" preset, checks the binary is
the verified release template, and packs
build/dist/tidewall-<version>-linux-x86_64.tar.gz with a .sha256:
tidewall.x86_64, tidewall.pck, a tidewall-server launcher that runs the
same game headless with clean SIGTERM handling, an example server.cfg,
README, VERSION, licences and asset provenance.
BuildInfo gives the version (application/config/version, now 0.9.0) and
the commit (build_commit.txt written by make dist, or .git in a
checkout). The main menu shows "Version 0.9.0 (commit)" and the server's
start log line carries version and commit.
make dist-check (tools/dist_check.sh) unpacks the package outside the
repo with HOME and XDG dirs in a temp dir and runs smoke against it
(new SMOKE_DIST mode), a whole bot match, and the exported game joining
the exported server over loopback.
A release template crashes on a call on null (exit 139) and ignores
invalid calls, so in package mode smoke's fault check expects only a
non-zero exit.
Closes#60
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make bench (tools/bench.sh, tools/bench_report.gd) measures the server's
p50/p99/max tick with 24 bots on three seeds over a whole match, and the
client's draw calls, primitives, objects, nodes and memory at six moments
of a match rendered in the capture container. It fails on anything over
the budgets now recorded in docs/ARCHITECTURE.md: p99 tick 12 ms, 2,000
draw calls and 2,000,000 primitives per frame (all passes), 1 GiB video
and 512 MiB static memory. Every capture now reports its frame's render
counts in a "render" field.
The first run put the barge, with 24 figures together, at 2,197 draw
calls. Each figure part had one surface per colour (about 43 per figure,
drawn again for shadows). FigureRig now merges a part's surfaces into one
per finish (coat, gilt, plain) and carries the Palette colours as vertex
colours, with shared materials. The barge is down to 1,207 draw calls,
with the same triangles and the same look.
Frame rates on a real GPU are not measured here; that stays with R6.
Closes#54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The islander is built in headless Blender (tools/models/figure.py,
`make figure`, `make art`) as twelve rigid parts with their origins at
their joints: an oilskin coat, a sou'wester, sea boots, a bedding roll
and the canvas wing-sail. Debian's Blender can't write glTF, so the
figure is jointed rather than skinned.
FigureRig hangs the parts on pivots, paints them from Palette with the
coat in the player's own oilskin, and plays FigurePoses' hand-written
key poses through one AnimationTree: idle, walk and run by speed,
crouch and creep, air, skydive, glide, swim and aboard; long, short and
carried holds; reload and use layers; fire, boathook swing, keg throw
and building as one-shots; and a flinch when health drops. The chest
takes a third of the pitch and the held item all of it.
Figures animate from replicated state only: positions, look, health,
the held item and the FLAG_ bits (reloading and using now reach
mirrored players), with actions from FX. Every boathook swing is now a
sim "swing" event, sent as a SHOT with no item, so misses are seen and
heard; the new FX kind PLACE shows pieces placed. Protocol version 4.
Tests: test_figure_rig (15), plus swing and PLACE cases in test_harvest
and test_net_fx. make check passes (604 tests); make client-check
passes. Captures: figure_states, figure_actions, figure_close
(make figure-captures), client_glide and client_landed.
Closes#42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/models/items.py builds every item in headless Blender from
primitives: the boathook, the eight weapons and powder keg, four
consumables and five kinds of ammo, each with its own outline. It
writes an OBJ per item (the Debian Blender's glTF exporter needs numpy),
a JSON with the grip and the left hand's support point, and a 128 px
Cycles icon rendered on the CPU. Materials are named after Palette
colours, and TRIM2_/TRIM3_ surfaces are the tier treatment: rope
whipping from tier 2, brass bands from tier 3; tier 0 is faded.
ItemModels paints the models from Palette by tier. EntityView puts the
held item's grip in each figure's right hand, turned with the player's
pitch and put away aboard, falling, gliding or swimming, and draws
items lying in the world with their models, one MultiMesh per model
and tier. The hotbar shows each slot's icon.
make models rebuilds them; make item-captures renders the items held,
over the shoulder, on the ground and by tier.
Closes#44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every sound is made by scripts in tools/audio/ and committed as a WAV in
assets/audio/ with a manifest of hashes and levels:
- dsp.gd: seeded noise, wavetable oscillators, filters, envelopes and
struck modes. recipes.gd: 50 effects (footsteps on five surfaces,
a report per weapon, impacts, carpentry building and breaking, the
tide's bell, foghorn, surge and lighthouse, player, ambience, menus).
- score.gd: an original eight-bar tune and chords in D Dorian, 6/8,
rendered as four looping layers (drone, frame drum, concertina,
fiddle).
- loudness.gd and check.gd: per-category loudness targets, a -1 dBFS
peak ceiling and the mix order (the tide loudest). make audio and
make audio-check.
In the client, SoundDirector turns FX records, footsteps, building,
the tide and the player's own hurts into sounds, placed on 3D voices
at the event so gunfire and footsteps come from their direction.
MusicDirector fades the score's layers with the tide on an
AudioStreamSynchronized, full in menus. MenuSounds knocks for buttons.
Closes#48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a client's world hash differs from the server's, the soak report
now names the part that differs (tide, props, pieces or loot), the
client's ClientWorld tick, and each piece whose entry differs on the
two sides, so the next transient mismatch can be traced.
- NetWorld.world_detail(): part hashes and a piece list. world_hash()
is unchanged: the same bytes, hashed in four parts.
- The server's world_hash log lines and the soak clients' hash lines
carry the detail.
A full soak with this (24 clients, 2 matches) compared 3,743 hashes
with 0 differing, so the mismatch didn't come back to trace yet.
Refs #80
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The soak's client memory growth (17 to 20 MB, about five islands, in some
processes) came from SoakPlayer keeping a strong reference to the last world it
played on. It let go only when its client next asked it for a command on the
new world, so finished islands stayed alive across a match change. It now keeps
only the island's seed.
LiveCount counts live Simulations and SimGrounds, which are made on worker
threads too, so it is thread-safe. The soak clients log the counts, and the
soak report fails if, a minute into a match, any island is alive that isn't a
client's world or one being made. That makes a leak name itself instead of
showing up as bytes.
Refs #39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each client process now also logs the engine's object count and how many
distinct worlds and prediction grounds its clients reach, at the start of
each match's play and again a minute later (memory_late). This is for
finding the client memory growth the soak still reports (#39); the
checks are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The soak's drops under loss came from stalls: the server's island (#79) and
each client process making islands on its main thread fed ENet second-long
round-trip samples, its retransmission timer grew, and two losses of one
reliable message in the busy drop that followed reached the 15 s timeout.
- ClientGame.build_in_background makes a new match's island on a
WorkerThreadPool task and holds the packets that arrive meanwhile, then
takes them in order. The networked client and the soak's clients use it;
the soak's own one-island-a-frame holding is gone.
- NetServer.close(grace_msec) sends the shutdown notice reliably and
services the socket while clients acknowledge it. The headless server
waits up to 2 s. A notice sent once was lost under 2% loss, and that
client timed out instead of hearing the server stop.
- Tests: background island holding and ordering, freeing mid-build, a
graceful shutdown reaching four clients behind 50% loss (it fails with
the old one-shot notice), and the scripted UDP match and client capture
wait for the client's island the way a real 20 s lobby would.
The soak at 2% loss and +/-20 ms now keeps all 24 clients for both matches,
with 0 of 3,758 world hashes differing and every client told of the stop.
It still fails on client memory growth between matches in two of three
processes (17 and 20 MB), which is not yet explained, so #39 stays open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/smoke.sh now starts the server through packaging/server/tidewall-server,
sends the wrapper SIGTERM once the server has started, and checks it writes its
stats and stop lines and exits 0, as H7 asked. make check runs it.
Refs #70
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 bot-matches` failed on its default seeds because its difficulty checks
(easy places worst, hard takes the most eliminations) are noisier than the
differences they look for over 20 matches.
Measured on three 20-seed batches (seeds 1-20, 21-40, 101-120): easy bots won
0, 4 and 2 matches against an even share of 6.7, and took the fewest
eliminations every time. Mean place doesn't separate the levels, and hard is
not reliably ahead of normal by any whole-match measure.
The batch now checks that easy bots win less than an even share and take the
fewest eliminations, and skips the difficulty checks under 20 matches, where
they mean nothing. Hard against easy stays covered by the duel test.
Closes#76
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>
The tide now runs every match, from the drop on, and water flows along the
terrain instead of standing everywhere under one level.
- Tide (src/sim/tide.gd): Tuning.TIDE_PHASES as a schedule of holds and
rises. Level, forecast (each hold announces its level), stage, drowning
rate, surge timing and the time limit are pure functions of the tick.
- SafeGround (src/sim/safe_ground.gd): safe ground from elevation on an 8 m
grid, and per-island planned levels. A phase's level is lowered, when it
must be, to just under the top of the largest piece of land still dry when
the phase begins; every phase still rises at least TIDE_MIN_RISE_METRES and
the last keeps its table level.
- Flood (src/sim/flood.gd): a 4 m grid aligned with building cells. Water
reaches cells from the world's edge through ground under the sea and edges
no breakwater stack seals. Cut-off ground stays dry until overtopped or
breached, then fills at BREACH_FLOW_METRES_PER_SECOND. Incremental: only
the edges where water stopped are re-tested, once a second.
- Players, drowning and structure wear use the local water. Breakwaters wear
by head and fail past BREAKWATER_MAX_HEAD; a breach floods what's behind.
- Storm surges: each phase's `surge` damage hits pieces near the water when
its rise begins.
- Sudden death after the last rise, then a time limit. Match breaks ties
(most health, highest feet, earliest join) at the limit and when the last
players fall together, so every match ends with a winner.
Tests: test_tide (18) covers the schedule and forecasts, planned levels,
overtopping, a sealed ring, breach and fill rate, spill-over, pressure wear
and head failure, dry pieces, surges, drowning under the real tide, sudden
death, the time limit and simultaneous eliminations. test_island's 100-seed
sweep now checks that every phase leaves safe ground reachable on foot from
the whole main landmass within the phase's time (closest margin 14 s).
A full rise with 24 bots measured p99 1.5 ms, max 1.9 ms per tick.
Closes#25
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>
Godot generates a .uid file beside each script so references survive renames. They belong in version control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an in-repo test runner that discovers test/**/test_*.gd and runs under --headless.
It uses Godot's Logger API, so engine and script errors during a test fail that test.
make test runs the suite, and make test-selfcheck runs deliberately failing fixtures
to prove each kind of failure is detected.
Closes#4
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>