Commit Graph
75 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 e8414fde9a A7: Visual effects, hit marker and hurt flash
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>
2026-11-14 11:45:19 -05:00
claudeandClaude Opus 5.5 8af068c625 Devlog: R3 and B8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:05:33 -05:00
claudeandClaude Opus 5.5 238e8e4463 B8: Thrown powder kegs with line-of-sight blasts
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>
2026-11-14 09:04:54 -05:00
claudeandClaude Opus 5.5 36d474695a R3: Player, server and contributor documentation
- 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>
2026-11-14 08:30:16 -05:00
claudeandClaude Opus 5.5 df367d691a Devlog: H3 and H4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:16:07 -05:00
claudeandClaude Opus 5.5 38812120df H3: Balance pass from 200 bot matches (make balance)
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>
2026-11-14 06:28:15 -05:00
claudeandClaude Opus 5.5 ffb68a1e89 Devlog: H5 and R2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 03:12:52 -05:00
claudeandClaude Opus 5.5 9b5064d7a8 H5: Security review, and fixes for connection-slot exhaustion
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>
2026-11-14 02:36:36 -05:00
claudeandClaude Opus 5.5 e3c0d2814c Devlog: pace and next run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 00:11:37 -05:00
claudeandClaude Opus 5.5 4ea7caf3df Devlog: H1, R1 and H2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 00:11:13 -05:00
claudeandClaude Opus 5.5 54c255e912 H2: Graphics presets, OpenGL fallback notice, tested configurations
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>
2026-11-14 00:11:13 -05:00
claudeandClaude Opus 5.5 4439d9a84f R1: Linux export pipeline (make dist, make dist-check)
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>
2026-11-13 23:51:36 -05:00
claudeandClaude Opus 5.5 9ce0865c9b H1: make bench, render budgets, and a third of the figure draw calls
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>
2026-11-13 23:30:16 -05:00
claudeandClaude Opus 5.5 0e6e12cbc8 Devlog: H11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:25:26 -05:00
claudeandClaude Opus 5.5 dff83fbe11 Devlog: A5 and H9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:10:48 -05:00
claudeandClaude Opus 5.5 923876ed1f A5: World art for points of interest, build pieces, vessels and terrain
- 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>
2026-11-13 20:39:24 -05:00
claudeandClaude Opus 5.5 fdd4c992c3 Devlog: pace and next run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:06:03 -05:00
claudeandClaude Opus 5.5 b8791e5ce2 Devlog: A6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:05:43 -05:00
claudeandClaude Opus 5.5 a4e81479bb A6: Sea, sky and weather
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>
2026-11-13 18:05:42 -05:00
claudeandClaude Opus 5.5 a282ca8e40 Devlog: A2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:35:54 -05:00
claudeandClaude Opus 5.5 07738330b5 A2: Player figure and animation
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>
2026-11-13 17:35:53 -05:00
claudeandClaude Opus 5.5 da0c65f3ce Devlog: A8 and A4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:47:19 -05:00
claudeandClaude Opus 5.5 0991f27700 A4: Item models and icons
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>
2026-11-13 14:46:41 -05:00
claudeandClaude Opus 5.5 2545337204 A8: Synthesized sound effects and an adaptive score
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>
2026-11-13 14:28:34 -05:00
claudeandClaude Opus 5.5 b3c59d66ac Devlog: A10, A11 and H13 diagnostics
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:47:21 -05:00
claudeandClaude Opus 5.5 c504551b28 A10: Menus and settings
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>
2026-11-13 11:30:09 -05:00
claudeandClaude Opus 5.5 98d86eb2da Devlog: A1, A9 and N8; v0.5 closed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:41:16 -05:00
claudeandClaude Opus 5.5 d7c8ed7e6e A1: Style guide, palette and the woodcut print pass
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>
2026-11-13 08:57:11 -05:00
claudeandClaude Opus 5.5 7cbb19023f Devlog: H12, N8 and N11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 02:24:16 -05:00
claudeandClaude Opus 5.5 3a76371760 Devlog: N7 and N8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:23:35 -05:00
claudeandClaude Opus 5.5 05c7568ec1 N8: 24-client network soak, and the server fixes it found
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>
2026-11-12 21:56:01 -05:00
claudeandClaude Opus 5.5 65b1fe015c Devlog: N6 and N9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:50:49 -05:00
claudeandClaude Opus 5.5 9e653f213c N9: Server-side cheat and abuse protection
- 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>
2026-11-12 17:49:54 -05:00
claudeandClaude Opus 5.5 f795ee3fa5 N6: Joining games: direct connect, LAN and server list
- 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>
2026-11-12 17:33:32 -05:00
claudeandClaude Opus 5.5 53e81bebe1 Devlog: N5 and N10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:51:48 -05:00
claudeandClaude Opus 5.5 9a36ae8615 N10: Playable network client
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>
2026-11-12 14:50:52 -05:00
claudeandClaude Opus 5.5 6b21e9d4f1 N5: Replicate building, world damage, tide and loot
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>
2026-11-12 14:27:58 -05:00
claudeandClaude Opus 5.5 63ef7b1968 Devlog: N3 and N4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:46:10 -05:00
claudeandClaude Opus 5.5 5e1704e224 N4: Lag-compensated hit validation
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>
2026-11-12 11:45:23 -05:00
claudeandClaude Opus 5.5 4111a285f0 N3: Client prediction, reconciliation and interpolation
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>
2026-11-12 11:30:00 -05:00
claudeandClaude Opus 5.5 b4548d91f5 Devlog: M9 and N2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:26:58 -05:00
claudeandClaude Opus 5.5 e535c1f39c N2: Snapshot replication and interest management
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>
2026-11-12 08:26:02 -05:00
claudeandClaude Opus 5.5 d1736035b0 Devlog: M8 and N1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:51:15 -05:00
claudeandClaude Opus 5.5 98a1a05dc8 N1: Transport and connection handshake
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>
2026-11-12 05:51:12 -05:00
claudeandClaude Opus 5.5 1d6a24ab64 M8: Complete offline match
`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>
2026-11-12 05:35:32 -05:00
claudeandClaude Opus 5.5 8cf164d562 Devlog: M5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 02:43:05 -05:00
claudeandClaude Opus 5.5 4db605c33d M5: Bot looting, combat and tide awareness
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>
2026-11-12 02:42:10 -05:00
claudeandClaude Opus 5.5 793caf2b12 Devlog: M3 and M4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:39:08 -05:00
claudeandClaude Opus 5.5 cc652de46e M4: Bot navigation
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>
2026-11-11 23:38:36 -05:00
claudeandClaude Opus 5.5 802674687c Devlog: B9, M1 and M2
Also removes a stray probe .uid committed with M2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:49:14 -05:00