Command-driven movement in the simulation (walk, sprint, crouch, jump, slopes, step-up, fall damage), plus a client over-the-shoulder camera with collision and aim-down-sights.
Acceptance
Movement is deterministic given a command log, with tests for speed, jump height and slope limits.
The camera never clips through terrain or structures in a scripted sweep.
Mouse sensitivity is configurable.
**Depends on:** F5
Command-driven movement in the simulation (walk, sprint, crouch, jump, slopes, step-up, fall damage), plus a client over-the-shoulder camera with collision and aim-down-sights.
**Acceptance**
- Movement is deterministic given a command log, with tests for speed, jump height and slope limits.
- The camera never clips through terrain or structures in a scripted sweep.
- Mouse sensitivity is configurable.
claude
added this to the v0.2 Movement and Island milestone 2026-11-09 05:26:04 +00:00
SimGround (src/sim/sim_ground.gd) is the solid world: a terrain heightfield (bilinear heights, normals) plus box solids, with support, body-overlap, point and ray queries. It starts flat; W2 and W3 fill the heightfield, and building adds solids.
Movement (src/sim/movement.gd): walk, sprint (forward only), crouch (1.2 m body, slower, can't jump), jumping with exact constant-gravity integration, air control, stepping onto ledges up to STEP_HEIGHT, ground snapping when walking downhill, slopes steeper than MAX_SLOPE_DEGREES that block walking or jumping uphill and make you slide (capped at SLIDE_MAX_SPEED, so a slide doesn't hurt), ceiling bumps, sliding along walls, and fall damage from landing speed (none up to 6 m, then 8 per metre).
Gravity now applies on ticks with no command. on_ground and crouching are part of the state hash.
Convention fix: F5's strafe "right" vector pointed to the screen's left in Godot's right-handed frame. Right is now (-cos yaw, 0, sin yaw), and turning right decreases yaw. This is documented in ARCHITECTURE.md, and a test checks that strafing goes toward the camera's screen-right.
Client
CameraRig: an over-the-shoulder camera with eased aim-down-sights (1.8 m instead of 3.4 m, FOV 48° instead of 72°). It casts against the same SimGround: pivot to shoulder, shoulder backward, then a straight line from the pivot, with a final pull-in that keeps 0.1 m clearance.
InputSettings: mouse sensitivity (0.05 to 10), aim sensitivity scale and invert-Y. Values are clamped and saved to user://settings.cfg. PlayerCamera applies them.
Testing:make check passes with 97 tests, 40 of them new.
Movement: speeds, a jump height of 1.406 m and airtime, no double or crouch jump, falling with no input, climbing a 30° slope, staying grounded walking down it, being blocked by 60° both walking and jump-spamming, sliding down 60° unharmed, a 0.4 m step versus a 1 m ledge, jumping onto a ledge, sliding along a wall, a ceiling, crouching under a 1.5 m gap, fall damage at 3, 6, 10 and 16 m, and determinism over 1,500 ticks on rough ground with solids.
Camera: a scripted sweep of 24,480 views: 72 yaws × 17 pitches × crouch × aim, in 5 arenas (against a wall, a 1 m corridor, a low roof, a corner, the foot of a 61° bank). It checks that the eye and all four near-plane corners stay out of geometry, with a clear line to the pivot. The sweep caught two real bugs while I was building it. Near-plane corners poked into the steep bank, because the clearance was only checked vertically. And the camera could rise over a wall top until the wall hid the player.
Captures in Forward+, all opened and checked: camera (over the shoulder, player slightly left, breakwater and sea ahead), camera_wall (back to a 1.4 m block: the camera rises over it with no clipping and the head stays in view), and camera_aim (I widened the aim shoulder after the first capture put the player across the crosshair; now the player sits in the left third with the centre clear).
Not verified: how it feels with a real mouse, and frame rate. Those need Eric's playtest on a GPU.
Follow-ups: wiring local input into PlayerCommands and following the interpolated player happens when the client loop exists (v0.4/v0.5). The movement tuning needs a feel pass in the playtest.
Done in 70e88ce.
**Simulation**
- `SimGround` (`src/sim/sim_ground.gd`) is the solid world: a terrain heightfield (bilinear heights, normals) plus box solids, with support, body-overlap, point and ray queries. It starts flat; W2 and W3 fill the heightfield, and building adds solids.
- `Movement` (`src/sim/movement.gd`): walk, sprint (forward only), crouch (1.2 m body, slower, can't jump), jumping with exact constant-gravity integration, air control, stepping onto ledges up to `STEP_HEIGHT`, ground snapping when walking downhill, slopes steeper than `MAX_SLOPE_DEGREES` that block walking or jumping uphill and make you slide (capped at `SLIDE_MAX_SPEED`, so a slide doesn't hurt), ceiling bumps, sliding along walls, and fall damage from landing speed (none up to 6 m, then 8 per metre).
- Gravity now applies on ticks with no command. `on_ground` and `crouching` are part of the state hash.
- **Convention fix:** F5's strafe "right" vector pointed to the screen's left in Godot's right-handed frame. Right is now `(-cos yaw, 0, sin yaw)`, and turning right decreases yaw. This is documented in ARCHITECTURE.md, and a test checks that strafing goes toward the camera's screen-right.
**Client**
- `CameraRig`: an over-the-shoulder camera with eased aim-down-sights (1.8 m instead of 3.4 m, FOV 48° instead of 72°). It casts against the same `SimGround`: pivot to shoulder, shoulder backward, then a straight line from the pivot, with a final pull-in that keeps 0.1 m clearance.
- `InputSettings`: mouse sensitivity (0.05 to 10), aim sensitivity scale and invert-Y. Values are clamped and saved to `user://settings.cfg`. `PlayerCamera` applies them.
**Testing:** `make check` passes with 97 tests, 40 of them new.
- Movement: speeds, a jump height of 1.406 m and airtime, no double or crouch jump, falling with no input, climbing a 30° slope, staying grounded walking down it, being blocked by 60° both walking and jump-spamming, sliding down 60° unharmed, a 0.4 m step versus a 1 m ledge, jumping onto a ledge, sliding along a wall, a ceiling, crouching under a 1.5 m gap, fall damage at 3, 6, 10 and 16 m, and determinism over 1,500 ticks on rough ground with solids.
- Camera: a scripted sweep of **24,480 views**: 72 yaws × 17 pitches × crouch × aim, in 5 arenas (against a wall, a 1 m corridor, a low roof, a corner, the foot of a 61° bank). It checks that the eye and all four near-plane corners stay out of geometry, with a clear line to the pivot. The sweep caught two real bugs while I was building it. Near-plane corners poked into the steep bank, because the clearance was only checked vertically. And the camera could rise over a wall top until the wall hid the player.
- Captures in Forward+, all opened and checked: `camera` (over the shoulder, player slightly left, breakwater and sea ahead), `camera_wall` (back to a 1.4 m block: the camera rises over it with no clipping and the head stays in view), and `camera_aim` (I widened the aim shoulder after the first capture put the player across the crosshair; now the player sits in the left third with the centre clear).
- Not verified: how it feels with a real mouse, and frame rate. Those need Eric's playtest on a GPU.
**Follow-ups:** wiring local input into `PlayerCommand`s and following the interpolated player happens when the client loop exists (v0.4/v0.5). The movement tuning needs a feel pass in the playtest.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Depends on: F5
Command-driven movement in the simulation (walk, sprint, crouch, jump, slopes, step-up, fall damage), plus a client over-the-shoulder camera with collision and aim-down-sights.
Acceptance
Done in
70e88ce.Simulation
SimGround(src/sim/sim_ground.gd) is the solid world: a terrain heightfield (bilinear heights, normals) plus box solids, with support, body-overlap, point and ray queries. It starts flat; W2 and W3 fill the heightfield, and building adds solids.Movement(src/sim/movement.gd): walk, sprint (forward only), crouch (1.2 m body, slower, can't jump), jumping with exact constant-gravity integration, air control, stepping onto ledges up toSTEP_HEIGHT, ground snapping when walking downhill, slopes steeper thanMAX_SLOPE_DEGREESthat block walking or jumping uphill and make you slide (capped atSLIDE_MAX_SPEED, so a slide doesn't hurt), ceiling bumps, sliding along walls, and fall damage from landing speed (none up to 6 m, then 8 per metre).on_groundandcrouchingare part of the state hash.(-cos yaw, 0, sin yaw), and turning right decreases yaw. This is documented in ARCHITECTURE.md, and a test checks that strafing goes toward the camera's screen-right.Client
CameraRig: an over-the-shoulder camera with eased aim-down-sights (1.8 m instead of 3.4 m, FOV 48° instead of 72°). It casts against the sameSimGround: pivot to shoulder, shoulder backward, then a straight line from the pivot, with a final pull-in that keeps 0.1 m clearance.InputSettings: mouse sensitivity (0.05 to 10), aim sensitivity scale and invert-Y. Values are clamped and saved touser://settings.cfg.PlayerCameraapplies them.Testing:
make checkpasses with 97 tests, 40 of them new.camera(over the shoulder, player slightly left, breakwater and sea ahead),camera_wall(back to a 1.4 m block: the camera rises over it with no clipping and the head stays in view), andcamera_aim(I widened the aim shoulder after the first capture put the player across the crosshair; now the player sits in the left third with the centre clear).Follow-ups: wiring local input into
PlayerCommands and following the interpolated player happens when the client loop exists (v0.4/v0.5). The movement tuning needs a feel pass in the playtest.