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>
Bump application/config/version, the install commands in PLAY.md and
SERVER.md, and the README status for the v1.0.0 release (R5, #64).
The README's limitations drop the effects item A7 already shipped and
link the Later issues for keg-throwing bots and list servers in the menu.
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>
From the lobby's view a pale square showed round the island: the terrain
grid's edge. The floor inside is 12.4 m down, but the shader's depth curve
only reached about 90% deep there, its view-space depth estimate read 7 to
11 m from the air, and the floor showed through at up to 4% opacity.
The shader now takes the larger of the true vertical depth (from the
world-space ray) and the old estimate, which shallows at a grazing angle
still use; normalises the curve so water WaterView.OPEN_DEPTH (9 m, three
quarters of the sea floor's depth) deep is fully SEA_DEEP; and makes fully
deep water opaque. Re-rendered match_lobby in Forward+ and Compatibility
(no square), and sea_tide_0/3, sea_shore_calm, water_shore, poi_dock and
client_basin (shallows still read as shallow).
Closes#85
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MatchView.setup() syncs with the camera at the origin, which is under the sea
once it has risen, and nothing re-checked the murk when the camera was then
placed. Captures of the late match (match_tide, match_final, match_results)
came out as flat teal, and in the game every camera cut showed one frame of
the wrong murk, since ClientSession syncs before moving the camera.
_focus(), which every camera placement calls, now applies the weather again
for the camera's new position. Test: a view under a risen sea, moved with no
sync, follows the camera in and out of the murk.
Closes#84
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EffectsView (src/client/effects/) draws muzzle flashes at the held
weapon's muzzle, tracer ribbons to each pellet's impact (and streaks
behind projectiles in flight), hit bursts on players, chips and dust by
material or ground, keg blasts with fireball, debris, smoke and a light,
build dust, collapse clouds for broken pieces, splashes and surge spray.
Particles are simulated on the CPU in packed arrays and drawn by two
MultiMeshes (blended and added) through a small billboard shader that
reads each particle's size from custom data (the stock billboard modes
drop the instance scale) and converts Palette's sRGB colours. Pools are
allocated once at the preset's budget (256/512/1024 particles, 64
tracers, 4 lights): three draw calls whatever happens.
The HUD gains a reticle, four ticks round it when your shot strikes a
player (HitFeedback), and a rust flash at the screen's edge when hurt.
Tests: test_effects_view (12), including a 24-shooter stress scene that
stays inside each budget and never adds nodes. Captures: make
effects-captures (fight, blast, work, stress), checked by eye, and the
blast in the Compatibility renderer.
Closes#47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fire with a powder keg held now throws one (Explosives.throw): lobbed along
the look direction, it drops down anything it strikes, rests where it lands,
falls again if its support goes, and blows when its fuse runs out (3 s).
The blast (Explosives.blast) reaches blast_radius, measured to the nearest
point of each body, piece or prop:
- terrain, pieces, props and fixed solids shield what is behind them;
players are hit if their body middle or head is in sight;
- damage falls off linearly to BLAST_EDGE_FACTOR at the edge, times tier;
- players take damage armor first, credited to the thrower, who takes
BLAST_SELF_FACTOR of their own;
- pieces and props take structure_damage, so kegs can breach breakwaters.
Everything reached is worked out before any damage is applied.
Line of sight uses a per-blast Sight: the nearby solids once, a cheap box
pre-check per ray, and a coarse terrain check skipped above the highest
ground in reach. Four kegs blowing on one tick inside a 5x5x3 stone fort
take about 5 ms, under the 12 ms tick budget (tested).
Kegs in flight and lying lit are drawn with the item models (EntityView);
capture scenario items_kegs. A blast emits "explosion" for A7's effects and
an impact the sound director already plays as keg_blast.
The launcher and bots that throw are follow-up #83.
Closes#22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs/PLAY.md is now the player guide: install from the tarball or .deb,
starting a match, controls, how a match goes, settings files and
troubleshooting, ahead of the graphics and tested-configuration sections.
- docs/SERVER.md: quick start, every option, ports, being found, logs,
Docker and systemd, memory, and what was checked.
- CONTRIBUTING.md (engine setup, rules, commits, licence of contributions)
and CREDITS.md.
- README: status and known limitations as they are.
- GDD controls table matched to the real defaults (B, Tab, G, 1 to 6).
Running the documented commands from an unpacked release found two bugs,
fixed here:
- `tidewall --connect=HOST` ignored the option unless it came after `--`.
ClientConfig.game_args() now takes the game's own options from the
engine's arguments when there is no `--`; tested.
- A headless run with no mode printed a line and never exited; it quits now.
The renderer option is given as the pair the capture tests use
(`--rendering-method gl_compatibility --rendering-driver opengl3`) in the
docs, the tarball README and the man page. The Join menu only searching the
LAN is documented and filed as #82.
Closes#62
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>
PropView.clear_view() hides every pine whose drawn shape crosses the line
from the camera to the followed player's chest or head, or holds the
camera, and shows it again once the line is clear. Candidates come from the
trunks in the ground's solid index around the line. MatchView.follow()
applies it; look_from() (framing, overview) shows everything again.
Test: a player against the most crowded pine on seed 2, at 16 yaws, hides
exactly the blocking pines and brings them all back afterwards. Captures
canopy and canopy_before (tools/capture.sh canopy ...).
Closes#75
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Harvest.swing traces the swing as a shot is traced (Weapons.trace, lag
compensated). A player reached before terrain, a solid, a prop's grown
box or a built piece takes the boathook's damage through
Weapons.damage_player, so armor, the kill feed and stats count it. A level
swing meets the head and takes the headshot multiplier, as a shot does.
- Unarmed bots go for an opponent in view within BOT_BRAWL_METRES (6 m) and
swing within BOT_SWING_METRES; inside a hut they swing back without
walking in.
- Tests: harvest +5 (hit, armor first, out of reach, wall between, player in
front of a tree), bot brain +2 (closes in and lands hits; leaves a distant
opponent alone).
- test_world_replication: an unarmed bot now meets the scripted player early
on seed 2, so the test gives it full armor on landing so it lives to build;
all assertions unchanged.
Closes#73
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PoiMesher dresses every point of interest from its parts: lapped tarred
weatherboards, plank boards, stone in a running bond with lichen, tiled
roofs with a ridge cap, salt-white trim on paint, crusted salt pans, and a
tarred frame round the lighthouse's glowing glass. One mesh per POI.
- Huts get a shuttered window in each side wall (non-solid parts, no rng).
- Build pieces show their state: building in quarter steps, worn (a third of
health gone) and battered (two thirds gone, strips knocked out).
StructureView rebuilds a piece's mesh only when its state changes.
- VesselModels builds the barge (lofted hull, curved rails, mooring lines,
gored envelope) and the sea chests in code; the primitive stand-ins are gone.
- Terrain: tussocks, wind-dried patches, shingle on sand, lichen on rock.
- test_world_art (9) fails on any primitive stand-in mesh or placeholder
resource under src/ or assets/, and covers POI bounds and determinism,
windows, the lamp surface, wear and build stages, view rebuilds and the
vessel models.
- make poi-captures and make build-captures (state card, vessels).
Closes#45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Weather.at(tide, tick) derives the weather from the tide's schedule
alone, so every client sees the same sky with nothing new on the wire:
the storm builds from calm at the first tide to a gale at sudden death,
and the light runs from mid-afternoon to dusk at the time limit.
WeatherView applies it each sync to the sky, sun, fog, ambient light,
the sea's roughness and rain around the camera (CPUParticles3D, for
both renderers). Under water the view closes into SEA_MURK, the rain
stops and the surface is a rippled ceiling seen from below.
The sea shader darkens open water and adds chop and whitecaps with the
storm, and keeps a breathing foam band at the waterline with a fainter
line beyond. In the Compatibility renderer, whose depth texture the
shader can't read (the sea came out all foam), water depth comes from
a texture of the terrain's heights instead. Sea colours move into
Palette; the rain and wind beds follow the weather.
Tests: test_weather (7). make check passes (611 tests). Captures:
make sea-captures (every tide phase, calm beach, the last land in the
gale, under water, and three in the Compatibility renderer).
Closes#46
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 island as a hand-drawn nautical chart: paper land with ink contours
every 5 m (heavier every 25 m) and a coastline, the sea in the sea's
ink, place names drawn from the seed, the barge's route, and the
player's mark. The land the coming tide will flood is hatched, and land
the sea has already taken is washed with the sea, so the forecast isn't
told by colour alone.
- Flood.forecast(level, structures): a copy of the flood spread to a
level as update() would, with today's breakwaters. Changes nothing.
- ChartMap: FULL (opened and closed with the new "map" binding, M) and
MINI (240 m around the player, top left, during the drop and play).
The paper is drawn once per world (about 270 ms) and shared; the
forecast overlay is redrawn at most once a second, and only when the
forecast level, the flood or the pieces changed.
- PlaceNames: names from original coastal words and a word for each
kind of place, the same for every player of a match.
- make chart-captures renders the chart before and after the first tide.
Solo matches have no teammates; ChartMap draws `mates` when duos (M7)
give it some.
Closes#51
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
The HUD (src/client/hud) is drawn in the paper-and-ink motifs of the style
guide:
- top centre: the tide post, the most prominent thing on screen. It is a
notched post with the sea filled in, the next level's rust notch and the
player's own height. Beside it are the phase, the time to the rise, both
levels and how far the player stands above or below the next line;
- top right: how many are standing, and the kill feed in words;
- bottom left: health and armour, each with a number, a word, quarter notches
and its own hatching. Low health adds LOW;
- bottom centre: the boathook and five slots, with names on two lines, rounds
and reserve or counts, and tier pips;
- bottom right: materials, and the build line ("NOT ENOUGH" when short).
Snapshots only carry nearby players, so the server now sends FEED (NetFeed,
reliable) when anyone is placed and at each phase change. It carries who is
standing, the match size and the newest 16 entries with names. Bots get crew
names (CrewNames). HudState works out what to show from the client, or from a
server's match for captures and tests, so the drawing never reaches into
either.
The project now stretches canvas items from a 1280x720 base, so the HUD scales
to any screen. make hud-captures renders it at 1280x720 and 3840x2160. The
parser fuzzer covers FEED.
Closes#49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/STYLE.md sets Tidewall's look: a drowned coast printed by hand. It has the
palette, shape language, character proportions, shading, UI motifs, audio
palette and a do-not-do list.
- Palette (src/client/style/palette.gd) is the one table of client colours.
Every colour that was scattered over the views now names its entry, with
values unchanged. test_palette fails on a colour literal anywhere else in
src/client or src/app, and on a palette colour the guide doesn't list.
- Look sets up the sky, the salt-faded grading (saturation 0.86, contrast
1.05), the sun and the print pass, for the match view and the capture scenes.
- folk_print.gdshader is one full-screen quad multiplied over the frame. It
draws ink lines at depth jumps and creases (fading with distance, scaled with
screen height), diagonal hatching cut into real shadow, and faint paper
grain. Ground under the sea gets none.
- make style-captures renders a hamlet and a dock with and without the pass.
Closes#41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
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>
When a match's results begin, Match starts the next match's Simulation on a
WorkerThreadPool task (its seed is fixed by then) and collects it when the
lobby opens. The same task plans the island's tide levels
(Simulation.plan_tide) and runs a prepare_next hook, which ServerLoop uses
to build the bots' NavGrid and BotWorld for the island. All of these read
only the new simulation, so the results are the ones the main thread would
have made: tests compare the state hash, terrain, solids, props, tide
levels and navigation with fresh ones, and the ten-matches test still
matches its references. A Match freed while its task runs waits for it.
Measured: a 24-bot server paced in real time through the results, lobby,
countdown and 3 s of the next drop has a worst tick of 5.4 ms; it was 1.8 s.
In the 24-client soak at 2% loss, moving the island alone left a 0.82 s tick
(the bots' navigation) and moving that too left 74 ms at the next match's
start (planning the tide), which this also moves. The soak hasn't been run
again since that last step.
Closes#79
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>
Built pieces, props' health, opened chests and the tide's schedule now reach
clients as WORLD messages on the reliable channel, and each player is told
what they carry as OWN messages.
- NetWorld: the WORLD and OWN wire formats, and world_hash(), a digest of
everything replicated this way.
- WorldSender: one message after each tick in which something changed, the
same for everyone, and the whole state for someone joining or a new match.
StructureSet and PropSet keep the change lists it reads.
- ClientWorld: applies them to the client's world, so pieces and broken props
are solid for prediction. A piece's health follows from its building and
damage, so building costs nothing on the wire.
- Placing ahead of the server: a provisional piece goes up with the command
and is replaced by the server's, or taken back once a snapshot shows the
server had its chance. Snapshots carry the newest WORLD number for that.
- Protocol version 3.
A test plays a whole scripted match on a real island with a ClientGame
attached and compares the two worlds' hashes throughout.
Closes#36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A network client draws other players in the past and its commands take time
to arrive, so by the time the server fires a shot the target has moved on:
8 ticks at a 50 ms round trip, 12 at 200 ms.
Each PlayerCommand now carries view_lag: how far back its player was seeing
everyone else, in quarter ticks. The simulation keeps where every player's
body has been for the last 15 ticks (HitHistory), and a hitscan shot is
traced against other players where they were at the moment the shooter saw,
and against the world as it is now. Projectiles aren't rewound.
The client claims only when it was looking and where it aimed; the server
works out the hit from its own record. The moment is never more than
Tuning.LAG_COMPENSATION_MAX_TICKS back, never in the future, and never
earlier than a moment the same player has already claimed.
Commands are 15 bytes, so the command log's version is 2. The lag is in the
log, and replays judge every shot as the match did.
Measured in test/net/test_lag_compensation_link.gd over a simulated link:
a client firing at a walking target as drawn on its own screen hits 41 of
41 shots at 50, 100 and 200 ms round trips, 0 of 41 with the lag ignored,
and 0 of 41 at 500 ms, past the cap.
Closes#35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client's side of a networked match, in src/net/:
- ClientGame takes the server's notices and snapshots, generates the island
from the seed and answers with commands. It works on packets, so it runs
over a NetClient or a test's simulated link.
- ClientClock decides which tick the next command is for, from the server's
echo of the newest command tick it has received, holding three commands
waiting at the server.
- ClientPrediction runs each command on a copy of the client's own player
with the server's movement code, and compares every snapshot with what it
predicted. A difference is replayed from the server's state and eased in.
- SnapshotInterpolator draws everyone else four ticks in the past, between
snapshots, on a clock steered gently by arrivals.
Snapshots now carry the client's own block: exact position and velocity,
the water around the player, stamina and state flags, so a prediction can
match the server to the bit. The command echo is now the newest tick
received rather than taken. Protocol version 2.
Snapshots go out every second tick. The interval was three ticks, which is
10 a second, not the 20 the documents claimed; 15 a second is the nearest
even spacing and what interpolation is tuned for.
Drop.ride() holds the barge ride for the server and the client alike, and
NetGame's joining, input and snapshot steps can be called without a socket.
Measured in test/net/test_prediction_link.gd over a simulated link with
100 ms each way, 20 ms jitter and 2% loss: no corrections to own movement
in about 1,400 snapshots per client, and the other player drawn 0.4 mm on
average from where a perfect link would draw them.
Closes#34
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>
ENet over UDP, used directly through ENetConnection, with a handshake before a
connection counts as a player.
- NetProtocol: HELLO, WELCOME and REJECT layouts, the protocol version, name
cleaning, the reasons a connection ends and a sentence for the player about
each. Decoders return nothing for malformed input and never raise an error.
- NetServer: listens, takes each guest through the handshake, and reports
joined, left and refused. It refuses a different protocol version, a full
server, a malformed HELLO and a guest that stays silent, each with its own
reason. Handles are never reused; duplicate names get a number.
- NetClient: connects, introduces itself, and ends up joined or closed with a
reason. Leaving says goodbye so the server knows at once; a client that
vanishes is dropped by ENet's timeout.
- Tests run a real server and clients over loopback UDP, with bare ENet peers
sending malformed and random packets.
The headless server doesn't listen yet; N2 connects this to the match.
Closes#32
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>
NavGrid is the map bots plan on: a point per 2 m terrain sample, solid on cliffs and
where solids stand between step and head height, and costlier where the water is
deeper than wading. Path search uses Godot's AStarGrid2D. The grid syncs every tick:
new solids (walls, pieces) block points at once, removed ones are found by a rolling
scan, and points turn wet as the tide and flood reach them. Each change is stamped
with its tick.
NavBot follows a path with ordinary PlayerCommands: it steers at waypoints, sprints
on long dry stretches, jumps when stalled, and marks a point blocked after repeated
stalls. Every half second it checks its remaining path against the change stamps and
plans again if water or a wall now crosses it. One path is planned per server tick
across all bots.
The server builds the grid while the lobby waits and its bots now roam between
random reachable places, replacing the placeholder wander bot.
Tests: 150 of 150 random reachable targets reached on 50 islands in the sweep; the
test runs 2 per island and needs 95%. New walls and rising water both cause a new
path around them; a broken wall opens the grid again; with no dry way round, the bot
swims. 23 roaming bots on an island: p99 tick 1.6 ms against the 12 ms budget.
Closes#27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The simulation now names what ended each player: weapon, fall, drown or tide, from
the cause of the blow that took the last health. Hits carry the weapon's item code.
Match keeps a kill feed (eliminator, cause, weapon, tick), per-player stats (damage
dealt and taken between opponents, eliminations, never teammates), and a summary()
with place, eliminations, damage and survival time. Players who fall on the same
tick share the better place and are marked tied. When the last players fall
together, the tie-break raises one team to first and the rest share the next place.
Eliminated players spectate: first whoever knocked them out, then a living
teammate, then the next living player in join order. When a target falls or
leaves, the view follows its eliminator or moves on, on the same step. Spectators
can cycle forwards and back. In results everyone watches the winner.
The headless server logs every placement and the match summary.
Closes#26
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>
Match (src/sim/match.gd) runs a server's matches back to back: lobby,
countdown, drop, play and results, then a fresh island and the lobby again.
It is stepped once per server tick and has no scene-tree or clock dependency.
- MatchRules holds max and min players, team size, the lobby, countdown and
results timers (defaults in Tuning.MATCH_*) and whether bots fill empty
places.
- Participants are server-chosen handles. Joining during a match waits for
the next; leaving during the drop or play places the leaver as eliminated.
- Placements, winners (last team standing) and events for phase changes,
joins, leaves, places, match start and end.
- Match 0 uses the server's seed; later matches derive their seed from it and
their index. The next match's Simulation is built when the lobby opens.
- ServerLoop now drives a Match (immediate rules by default, so the smoke
match is unchanged: same state hash), rebuilds bots each match, and counts
server ticks across matches. The headless server logs match events.
Tests: test_match (13) covers every transition, leaving in each phase, an
empty lobby, an empty match, teams, late joiners, and ten consecutive matches
that each start identical to a freshly built simulation. A ServerLoop test
checks the server goes back to the lobby and starts the next match.
Closes#24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeded loot at every point of interest's loot markers, rolled once per match
from the "loot" stream by LootSet.plan() and placed by Simulation.place_loot().
- Each marker holds a sea chest (chance by location) or floor loot (rolls on
the location's weapon/consumable/ammo/nothing weights). Weapons roll a tier
from the location's tier weights and come with their ammunition; chests
hold a weapon (best of two tier rolls), a consumable and spare ammunition.
- Interact opens the nearest closed chest in reach unless a pickup is nearer,
and spills its contents as pickups.
- Washed-up crate props hold one roll of the crate table and spill it when
broken by any means.
- If the rolls leave fewer POI weapons than LOOT_MIN_POI_WEAPONS (one per
player in a full lobby), extra weapon rolls top up floor spots.
- Chest and crate state is part of state_hash(). ServerLoop places loot.
Tests: test_loot (12), including a statistics run of 1,000 loot seeds over
four generated islands that checks tier shares against the tables, that
shrines beat hamlets, and that every match has a weapon per player at POIs
and 1.25 per player counting crates.
Closes#23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eight slot weapons: the six from the design plus the rivet repeater (fast,
short-range automatic) and the harpoon gun (slow heavy bolt, 2.5x damage to
built pieces). Four quality tiers, Rusted to Captain's, scale damage and reload
time. The line thrower now yanks the shooter towards where its line lands,
through a data field (pull_speed) any weapon can use.
Four consumables: sailcloth bandage (heals to 75), brine tonic, cork vest and
the new tar patch. Fire with one held starts using it if it would help; it
takes effect after its use time. Changing slot, dropping, sprinting, swimming
or elimination interrupts it and uses nothing up. All checks run on the server.
A data-validation test covers every weapon, tier, consumable and ammunition
type, including unknown stat keys, name format and that every ammo type is
used. The GDD's weapons section lists the roster.
Closes#21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Weapons fire from the server's own copy of the shooter's eye and look, at the
weapon's fire rate, from the loaded magazine. An empty trigger pull or the
reload button starts a reload of the weapon's reload time from carried
ammunition; switching slots cancels it. Each shot is one or more pellets
scattered evenly inside a spread cone from the "weapons" stream. Spread is the
hip spread (smaller when aiming), plus bloom that builds in sustained fire,
plus a moving or airborne penalty.
Hitscan pellets trace at once in 16 m segments; projectile weapons (the
whaler's longgun and line thrower) spawn entities that fly under gravity and
trace each tick. A trace stops at the first of terrain, a solid (built pieces
and props take the damage) or another player's body. Players lose armor first,
then health; the top of the body takes the weapon's headshot multiplier; and
damage falls off linearly from range_full to range_max. Stats come from
ItemDef, so adding a weapon is a Tuning entry only.
Closes#20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five slots plus the always-carried boathook (selection 0), ammunition carried
apart from the slots, and items lying in the world as pickup entities. All
changes are made by the server from commands: interact picks up the nearest
pickup in reach, drop (new BUTTON_DROP) leaves the held stack at the feet, and
both act once per press. A full inventory swaps the held item. Consumables and
thrown weapons stack; ammunition stops at its cap and leaves the rest on the
ground. An eliminated player drops everything on a ring around where they fell,
and the simulation now emits an "eliminated" event when health reaches 0.
Item definitions are ItemDef resources built by ItemCatalog from the tables in
Tuning (WEAPONS, ITEMS and the new AMMO), so a new item is a data change only.
Closes#19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pieces build up health, take damage from the boathook and the tide, and
collapse when nothing connects them to the ground.
- Build-up: a piece starts at 10% of its material's health and gains
the rest evenly over build_seconds. Damage taken while building stays.
- Damage: Simulation.damage_piece, and boathook swings now hit pieces
nearer than any prop for HARVEST_DAMAGE, with no material back.
- Tide: once a second, pieces with their base under the sea lose
TIDE_STRUCTURE_DPS; breakwaters wear per metre of head and fail past
BREAKWATER_MAX_HEAD.
- Integrity: grounded means touching terrain or a fixed solid (not a
prop). On removal, a breadth-first search from the former neighbours
stops at the first grounded piece, so only structures that really
lost support are walked in full; loose components collapse together.
Simulation.ground_changed rechecks grounding after terrain changes.
- Wall skirts now reach at most one level (2 m), so upper walls aren't
grounded through a skirt; terrain checks merge boxes sharing a bottom.
- 12 tests: build-up per material, damage during building, material
strength, fresh pieces breaking, cascades, a second support, boathook
bringing down a wall and its floor, tide wear and breakwater failure,
tide-triggered collapse, terrain-triggered collapse, fixed solids as
ground, and a 564-piece fort (one removal 57 us, worst search 416 us,
full cascade of 479 pieces 4.7 ms).
Closes#17
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server-authoritative grid building with wall, floor, ramp, roof and
breakwater pieces in driftwood, stone and salvage iron, plus a client
placement ghost.
- StructureSet: pieces in grid slots (floor, two wall edges, cell
volume), their collision boxes in SimGround, and touching-neighbour
links kept up to date for B3. Ramps are stairs of 0.4 m steps; walls
over lower ground get a skirt down to the terrain; roofs are a low
stepped pyramid. Pieces are part of the state hash.
- Building: target() snaps look and position to a slot, and check()
validates any slot as if a hostile client chose it: state, range,
occupancy, trapping a player, cost and support. Fire in build mode
places at most 10 pieces a second; players in a low step are lifted.
- Levels are half a cell (2 m) apart, so ground pieces sit within a
metre of the builder's feet instead of being half buried.
- Client: StructureView draws pieces from their boxes in plank, course
or panel strips; ramps draw as a sloped deck. BuildGhost shows sea
green or rust red from the same target() and check().
- Tests: 15 sim tests (targeting, every rejection, overlap, support,
stairs climbable, skirts, determinism, 24 builders at 10 pieces a
second within the tick budget) and 5 client tests (ghost states,
ghost agrees with the server, view sync, mesh orientation).
- Capture scenarios build_fort and build_fort_side.
Closes#16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Boathook swings harvest props. The client only presses fire with the
boathook selected; the server casts the swing from its own copy of the
player's eye and look, so range and swing rate are enforced by
construction. Each hit damages the prop and gives its material
(driftwood, stone or salvage iron), capped per material.
- Materials: material codes and add/spend helpers; carried stock lives
on SimEntity.materials and is part of the state hash.
- Harvest: swing interval from the boathook's fire rate, reach from its
range plus slack, nearest prop along the ray, blocked by terrain or
other solids. Emits harvest and prop_destroyed events.
- Simulation: per-tick events list, a shared action cooldown, and fire
with selection 0 outside build mode swings.
- Tuning: HARVEST_DAMAGE, HARVEST_REACH_SLACK, HARVEST_AIM_SLACK.
- 12 tests: yields per kind, rate limit, reach, blocking, nearest prop,
caps, destruction clearing collision, state gating and determinism on
a real island.
Closes#15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Simulation.start_drop() plans a seeded straight route across the island at
BARGE_ALTITUDE, through a point near the middle pulled onto land, and puts
every player aboard. Riders move with the barge; jump leaps off with some of
its speed. Freefall steers and tops out at FREEFALL_MAX_SPEED; jump opens
the wing-sail, which also opens by itself WING_AUTO_DEPLOY_HEIGHT above the
ground or water. Gliding sinks slowly and steers at GLIDE_SPEED, and the
sail folds just above the ground or sea so landing does no damage. Anyone
aboard at the end of the route is thrown off. Drop state is hashed.
Every server match now starts with the drop. Bots leap at a time fixed by
their player ID. The carrier's name and look are open in #72.
Closes#14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The simulation has a global sea level (Simulation.sea_level, changed with
set_sea_level and read every tick, so the tide can move it mid-match).
Walkers wade more slowly in water over WADE_DEPTH; in water SWIM_DEPTH deep
they swim: floating head-out, sprint-swimming, diving with crouch, kicking
out with jump, and standing again in the shallows. Falling into deep water
does no fall damage. Water tracks breath, stamina and drowning in whole
ticks: swimming spends stamina, an exhausted swimmer slips under, and with
no breath left the tide phase's drown damage lands once a second. All of
it, plus the sea level, is in the state hash.
WaterView draws the sea surface at the simulation's level with a
procedural shader: depth-tinted colour, foam at the waterline, ripples.
Closes#13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PropSet places about 3,000 pines, scrub, boulders, wrecks and crates per
island from the seed, by elevation band with grove noise, clear of points
of interest. Each prop is one collision box in SimGround with health from
Tuning.PROP_KINDS; destroying it removes the box at once
(SimGround.remove_solid). Prop health is part of the state hash.
PropView draws them as one MultiMesh per kind per 128 m square (about 150
instanced draws), with per-kind visibility ranges, procedural flat-shaded
meshes fitted to the collision boxes, and cheap sync of felled props.
Closes#12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PoiSet.generate(island) places 10 to 16 points of interest per island from
the seed's "poi" stream: hilltop shrines, lighthouses, docks, salt works,
quarries and fishing hamlets, at least 85 m apart. Each kind has a siting
rule (height band, flatness, coast or summit) that loosens step by step
until its minimum is placed. Piers are sited so their deck clears the
ground all the way out to water 1.5 m deep.
Poi assembles each from modular parts in a local frame turned in quarter
turns, so every solid stays an axis-aligned box: walls with a door and
lintel, plinths, steps down to the ground, roofs, a stair to a loft. Each
POI carries loot spawn markers, exposed through PoiSet.loot_markers(),
and walking routes from open ground into its interiors.
- Simulation adds every POI solid to its ground and never spawns players
inside one.
- SimGround indexes solids in 8 m cells, so collision queries only test
nearby boxes. Smoke p95 tick is 0.47 ms with about 300 solids.
- Movement tests the body where it will stand after stepping up, so
stairs with treads narrower than the body can be climbed. The
traversal test found the lighthouse stair impassable without it.
- PoiView draws parts as one MultiMesh per look, in the seafaring
palette. Capture scenarios poi_<kind> frame each kind.
- Summit stone is darker so it no longer reads as snow.
Tests: 30 seeds get every kind within its limits, 10 to 16 in total,
spaced and sited; placement is deterministic; loot markers stand on
floors and are not inside solids; a player walks every route of every
POI on 4 seeds through doors, up steps and the lighthouse stair; stairs
with 0.45 m treads are climbed and a step doesn't carry the body into a
wall; the solid index matches a full scan on 500 queries.
Closes#11
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>
Simulation (src/sim/):
- SimGround holds the terrain heightfield (bilinear heights, normals)
and axis-aligned box solids, with support, body-overlap, point and
ray queries. The island generator and building will fill it.
- Movement steps a player per tick: walk, sprint (forward only),
crouch (lower body, slower, no jump), jump with exact constant-gravity
integration, air control, step-up onto ledges up to STEP_HEIGHT,
ground snapping on downhill walks, slopes over MAX_SLOPE_DEGREES that
block walking and jumping uphill and make players slide (speed capped),
ceiling bumps, sliding along walls, and fall damage from impact speed.
- Gravity now applies on ticks with no command. on_ground and crouching
are part of the state hash. New movement numbers are in Tuning.
- Fixed the strafe direction: right is forward x up in Godot's frame,
(-cos yaw, 0, sin yaw). Documented the look convention.
Client (src/client/):
- CameraRig places an over-the-shoulder camera with an eased
aim-down-sights blend (closer, narrower FOV), casting against the same
SimGround: pivot to shoulder, shoulder back, then a straight line from
the pivot, with a final clearance pull-in so the near plane never
enters geometry.
- InputSettings: mouse sensitivity, aim sensitivity scale and invert-Y,
clamped and saved to user://settings.cfg. PlayerCamera applies both.
Tests: 46 new across movement, ground queries, camera and settings,
including a 24,480-view scripted camera sweep through five arenas (wall,
corridor, low roof, corner, steep bank) that checks the eye and every
near-plane corner stay out of geometry with a clear line to the pivot.
The hash test now flips a high stick bit, because a 1/127 nudge to an
airborne player moves them less than the hash's millimetre.
Capture scenarios camera, camera_wall and camera_aim.
Closes#8
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>