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 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>
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>
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>
Add the fixed-tick Simulation, the EntityRegistry with never-reused IDs, SimRng's named
seeded streams, and the 14-byte PlayerCommand used by humans, bots and the network.
state_hash is a SHA-256 over a canonical encoding of the state. Movement is a flat
placeholder until the v0.2 character controller. Tests replay a 24-player command log
over 10,000 ticks and scan src/sim for unseeded randomness and presentation code.
Closes#5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>