Camera polish: smooth follow, vertical deadzone, look-ahead #9

Closed
opened 2026-11-07 18:27:40 +00:00 by claude · 1 comment
Member

The camera is rigidly attached to the avatar, so every jump bobs the whole screen. Add a lagged follow with a vertical deadzone and slight look-ahead in the walking direction. That probably means moving the camera entity independently with interpolation instead of attaching it.

The camera is rigidly attached to the avatar, so every jump bobs the whole screen. Add a lagged follow with a vertical deadzone and slight look-ahead in the walking direction. That probably means moving the camera entity independently with interpolation instead of attaching it.
claude added this to the v0.2 Core Feel milestone 2026-11-07 18:27:40 +00:00
claude added the
type
feature
priority
medium
area/camera-controls
labels 2026-11-07 18:27:41 +00:00
eric added this to the Strata Roadmap project 2026-11-07 18:36:27 +00:00
eric moved this to To Do in Strata Roadmap on 2026-11-07 18:37:23 +00:00
eric closed this issue 2026-11-09 06:18:32 +00:00
Author
Member

Done in 2b5d1e6, but how it feels still needs a hands-on check in the client.

The camera entity is no longer attached to the avatar. Each step it sets a velocity towards a goal, which lets the client interpolate it:

  • Look-ahead: x leads the walking direction by up to 1.5 nodes and returns to centre when you stop.
  • Vertical deadzone: a full jump (about 2.5 nodes) doesn't move the view at all. Standing on something re-centres it, smoothly. Falls are followed after 1 node, so you can see where you're landing.
  • Snap: further than 14 nodes from its goal, the camera jumps there rather than sliding across the world. Teleports and respawns also snap.
  • LOOK_LIMIT is now derived from REACH plus the largest off-centre offset, so aiming still covers the full reach.

Tests: 5 new selftest cases, including a real camera entity following a walking and jumping avatar. The suite passed 36/36, zero ERROR lines. I checked the entity test fails when the deadzone is broken.

Not verified: smoothness on a real client, because tests are headless only. The avatar and camera now interpolate independently, so it's possible the avatar visibly jitters against the view. If it does, tune FOLLOW_RATE or set strata_smooth_camera = false (in the game's settings), which restores the old rigid attachment. That fallback path needs a connected player, so the selftest doesn't cover it.

Side effect worth knowing: the server now sees the player at the true camera position (z = −22) instead of on the plane. Interaction range still covers it (POINT_RANGE is camera distance + 8).

**Done in 2b5d1e6, but how it feels still needs a hands-on check in the client.** The camera entity is no longer attached to the avatar. Each step it sets a velocity towards a goal, which lets the client interpolate it: - **Look-ahead:** x leads the walking direction by up to 1.5 nodes and returns to centre when you stop. - **Vertical deadzone:** a full jump (about 2.5 nodes) doesn't move the view at all. Standing on something re-centres it, smoothly. Falls are followed after 1 node, so you can see where you're landing. - **Snap:** further than 14 nodes from its goal, the camera jumps there rather than sliding across the world. Teleports and respawns also snap. - `LOOK_LIMIT` is now derived from `REACH` plus the largest off-centre offset, so aiming still covers the full reach. **Tests:** 5 new selftest cases, including a real camera entity following a walking and jumping avatar. The suite passed 36/36, zero `ERROR` lines. I checked the entity test fails when the deadzone is broken. **Not verified:** smoothness on a real client, because tests are headless only. The avatar and camera now interpolate independently, so it's possible the avatar visibly jitters against the view. If it does, tune `FOLLOW_RATE` or set `strata_smooth_camera = false` (in the game's settings), which restores the old rigid attachment. That fallback path needs a connected player, so the selftest doesn't cover it. Side effect worth knowing: the server now sees the player at the true camera position (z = −22) instead of on the plane. Interaction range still covers it (`POINT_RANGE` is camera distance + 8).
Sign in to join this conversation.