#6e First-person presence: weapon sway, landing dip and head bob #30

Open
opened 2026-11-14 20:44:59 +00:00 by claude · 2 comments
Member

Part of #6. Make first person feel physical without new assets.

Scope

  • Weapon/arms sway: the first-person arms lag slightly behind view rotation and settle back (spring), scaled by a setting.
  • Landing dip: a short camera dip proportional to fall speed on landing, and a small dip on jump take-off.
  • Turn on the existing head bobbing by default with gentler values, and tie its amplitude to the #6a smoothed speed so it fades in and out.
  • All under a [Camera] or Lua camera settings group, on by default, each switchable; respects a "reduce motion" master toggle that turns all of them off.
  • Full-body awareness (seeing your own legs) is out of scope; consider a later issue.

Acceptance

  • Spring and dip math in testable functions with unit or Lua tests.
  • Headless boot clean; no change with the master toggle off.
  • Feel needs Eric's playtest.
Part of #6. Make first person feel physical without new assets. **Scope** - Weapon/arms sway: the first-person arms lag slightly behind view rotation and settle back (spring), scaled by a setting. - Landing dip: a short camera dip proportional to fall speed on landing, and a small dip on jump take-off. - Turn on the existing head bobbing by default with gentler values, and tie its amplitude to the #6a smoothed speed so it fades in and out. - All under a `[Camera]` or Lua camera settings group, on by default, each switchable; respects a "reduce motion" master toggle that turns all of them off. - Full-body awareness (seeing your own legs) is out of scope; consider a later issue. **Acceptance** - Spring and dip math in testable functions with unit or Lua tests. - Headless boot clean; no change with the master toggle off. - Feel needs Eric's playtest.
claude added this to the 2. Feel milestone 2026-11-14 20:44:59 +00:00
Author
Member

Progress 2026-11-17 (early run): the implementation is written but not built or committed. Host memory stayed at about 3.7 GB available for over 25 minutes, under the 4 GB rule, so nothing was compiled. The work is left uncommitted in the working tree for the next run.

What's in the tree:

  • Engine: the first-person neck controller takes an extra rotation and offset (mwrender/viewmodel.cpp). Lua gets camera.set/getFirstPersonViewModelRotation (pitch, yaw, roll) and set/getFirstPersonViewModelOffset (right, forward, up). With both at zero, the neck controller gets exactly the upstream values.
  • Lua: camera/first_person.lua adds weapon sway (the arms lag up to 3° behind turns, and a critically damped spring brings them back in about 0.4 s) and a landing dip (0.012 units per unit/s of fall speed above 250, up to 9 units, plus 1.5 units on jump take-off; the arms move 1.2 times as far). The math is in camera/presence.lua.
  • Settings: a new First Person Presence group with Reduce Motion (a master switch that also turns off head bobbing), Weapon Sway with an amount, and Landing Dip with an amount. Head bobbing is on by default with gentler values (height 2, roll 0.1).
  • Camera interface v3: getFirstPersonPresence, isFirstPersonPresenceEnabled, and disable/enableFirstPersonPresence.
  • Tests: components_tests/lua/testcamerapresence.cpp (8 tests) and openmw_tests/mwrender/testviewmodel.cpp (4 tests). A new SCENARIO=presence headless run checks sway, settling, head bob, the landing and take-off dips, and that Reduce Motion leaves everything at zero (scripts/ashlar_presence_summary.py).
  • Docs: docs/ashlar/CAMERA.md and SCENARIOS.md.

Next run: build, run the tests and SCENARIO=presence, fix what fails, then commit with Closes #30. How it feels needs Eric's playtest.

Progress 2026-11-17 (early run): the implementation is written but **not built or committed**. Host memory stayed at about 3.7 GB available for over 25 minutes, under the 4 GB rule, so nothing was compiled. The work is left uncommitted in the working tree for the next run. What's in the tree: - **Engine:** the first-person neck controller takes an extra rotation and offset (`mwrender/viewmodel.cpp`). Lua gets `camera.set/getFirstPersonViewModelRotation` (pitch, yaw, roll) and `set/getFirstPersonViewModelOffset` (right, forward, up). With both at zero, the neck controller gets exactly the upstream values. - **Lua:** `camera/first_person.lua` adds weapon sway (the arms lag up to 3° behind turns, and a critically damped spring brings them back in about 0.4 s) and a landing dip (0.012 units per unit/s of fall speed above 250, up to 9 units, plus 1.5 units on jump take-off; the arms move 1.2 times as far). The math is in `camera/presence.lua`. - **Settings:** a new First Person Presence group with Reduce Motion (a master switch that also turns off head bobbing), Weapon Sway with an amount, and Landing Dip with an amount. Head bobbing is on by default with gentler values (height 2, roll 0.1). - **Camera interface v3:** `getFirstPersonPresence`, `isFirstPersonPresenceEnabled`, and `disable`/`enableFirstPersonPresence`. - **Tests:** `components_tests/lua/testcamerapresence.cpp` (8 tests) and `openmw_tests/mwrender/testviewmodel.cpp` (4 tests). A new `SCENARIO=presence` headless run checks sway, settling, head bob, the landing and take-off dips, and that Reduce Motion leaves everything at zero (`scripts/ashlar_presence_summary.py`). - **Docs:** `docs/ashlar/CAMERA.md` and `SCENARIOS.md`. Next run: build, run the tests and `SCENARIO=presence`, fix what fails, then commit with `Closes #30`. How it feels needs Eric's playtest.
Author
Member

2026-11-17 (afternoon run): still not built. Available memory stayed at 2.0 to 2.3 GB for 15 minutes (browsers and desktop apps hold most of it), under the 4 GB rule, so no compile. This is the second run in a row skipped this way.

One change to the uncommitted tree: camera/first_person.lua no longer steps the springs when the frame time is 0, because the turn and fall rates divide by it. It still reapplies the current offsets that frame so there's no pop. Next run: build, run the tests and SCENARIO=presence, then commit with Closes #30.

2026-11-17 (afternoon run): still not built. Available memory stayed at 2.0 to 2.3 GB for 15 minutes (browsers and desktop apps hold most of it), under the 4 GB rule, so no compile. This is the second run in a row skipped this way. One change to the uncommitted tree: `camera/first_person.lua` no longer steps the springs when the frame time is 0, because the turn and fall rates divide by it. It still reapplies the current offsets that frame so there's no pop. Next run: build, run the tests and `SCENARIO=presence`, then commit with `Closes #30`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gaming/ashlar#30