`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>
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>
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>
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>
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>