19 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 2167900e45 M7: Duos and revive
Two-player teams, enforced by the simulation:
- Match puts every player on a team (SimEntity.team); Weapons.damage_player
  refuses damage between teammates from every weapon, the boathook and blasts.
- A player whose health runs out with a teammate standing goes down instead of
  out: 60 health to bleed (one point every half second), crawling at 1 m/s, no
  firing, building, looting or items. Hits still take it; drowning too.
- A standing teammate within 2 m holding interact for 6 s revives them with 30
  health. Letting go or moving away starts it over.
- Downed players are out when their health runs out again or when no teammate
  is left standing, credited to whoever downed them. A team falls together and
  shares its place; the tie-break puts standing ahead of downed.
- Downs and revives go through Match events and the kill feed ("X knocked Y
  down"); the HUD says what to do while down.

Wire: FLAG_DOWNED in the player record and the own block (flags now u16),
so prediction crawls too. Protocol version 5.

Bots: never target a teammate, land with their teammate, regroup when they
stray past 30 m, crawl toward a standing teammate when down, go to revive a
downed teammate within 60 m when not in a fight, and turn from a downed target
to its standing teammate when it's in view.

Options: --team-size=2 on the server, --duos offline, and Solo/Duos under
Crew in the Practice menu. The figure has a downed crawl pose.

Tests: test_duos (downing, crawl, revive, interrupted revive, bleed-out,
finishing, team out, falling together, no friendly damage including kegs,
drowning while down, hash, match placement and tie-break), bots as teammates,
the downed flag on the wire, the feed, server and menu options. make
duo-matches plays 10 bot duos matches.

Closes #30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 03:01:09 -05:00
claudeandClaude Opus 5.5 eb239c5424 M6: Bots that build
Bots now gather materials with the boathook and build with the same build
command and Building.check a player's client goes through:

- Gathering: an armed bot with nothing more pressing gathers from props
  nearby (12 m while looting, 24 m once there's nothing left to loot) up to
  60 of a material, or 120 in the last three tide phases. Not within 10 s of
  seeing an opponent or being hit, and not when hurt.
- Cover: a wall toward a shooter who catches it reloading, from ambush or
  worn down to 60, then waits behind it to reload or heal.
- Wall and heal: a badly hurt bot that would break off walls itself off and
  heals where it stands instead, if it can afford a wall.
- Ramps: a staircase of ramps, each from the top of the last, up to an
  opponent on a cliff or a steep rise (at most 5 a fight).
- Breakwaters: late in the match, a bot the tide would catch before it
  reached dry ground, or one at the last stand, rings its cell with four
  breakwaters and stays inside while they hold.

Measured with the new `make bot-builds` (tools/bot_builds.gd): every other
bot builds and the rest are a control group. Over 40 matches, seeds 501 to
540: builders built in 53% of the fights they began with materials for a
wall (12% of all fights; most fights are in the landing, before anyone has
gathered), lost 58% of the fights they built in against 67% of the rest,
and placed 12.1 on average against the control's 12.8. Overall fight losses
(65.8% / 65.7%) and wins (20 / 20) came out level; docs/BALANCE.md has the
numbers and the earlier batches that led to the careful gathering. Worst
p99 tick 3.4 ms of the 12 ms budget.

Closes #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:13:25 -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 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 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 8a6fb93b50 M2: The rising tide
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>
2026-11-11 20:48:41 -05:00
claudeandClaude Opus 5.5 c6f3c19004 M1: Match state machine
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>
2026-11-11 20:24:00 -05:00
claudeandClaude Opus 5.5 0013a81658 B9: Loot tables and containers
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>
2026-11-11 20:16:20 -05:00
claudeandClaude Opus 5.5 5d2a2bbc31 B7: Weapon roster and consumables
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>
2026-11-11 17:26:04 -05:00
claudeandClaude Opus 5.5 f38bb9c69a B3: Structure health and structural integrity
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>
2026-11-11 14:30:54 -05:00
claudeandClaude Opus 5.5 f35ebf7171 B2: Grid building and placement preview
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>
2026-11-11 14:23:29 -05:00
claudeandClaude Opus 5.5 b847ba9695 B1: Harvesting and materials
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>
2026-11-11 14:11:15 -05:00
claudeandClaude Opus 5.5 278b715e0c W7: The drop: sky barge and wing-sail
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>
2026-11-11 12:34:53 -05:00
claudeandClaude Opus 5.5 be987b6f82 W6: Water and swimming
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>
2026-11-11 12:24:50 -05:00
claudeandClaude Opus 5.5 5db53de4e8 W5: Vegetation and harvestable props
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>
2026-11-11 12:17:42 -05:00
claudeandClaude Opus 5.5 5021d13686 W4: Points of interest
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>
2026-11-10 14:47:10 -05:00
claudeandClaude Opus 5.5 c70d0c1c4f W2: Procedural island generator
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>
2026-11-10 14:15:59 -05:00
claudeandClaude Opus 5.5 0052624662 F2: Game design document and originality rules
Add docs/GDD.md and docs/ORIGINALITY.md, with every gameplay number held in the single
tuning table, src/sim/tuning.gd. The GDD refers to numbers by constant name so it can't
drift from the game.

Closes #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:12:59 -05:00