#6c Ledge mantling #28

Closed
opened 2026-11-14 20:44:48 +00:00 by claude · 1 comment
Member

Part of #6. Let the player climb onto ledges they jump at, instead of sliding off them.

Scope

  • While jumping or falling and pressing forward into a wall, probe with physics shape casts for a standable surface whose top is within reach (start at about 1.1 × actor height above the feet) and with enough headroom for the actor's collision shape.
  • If found, move the actor up and onto the ledge over a short time (around 0.4 s), with movement input ignored for the duration. No animation requirement: content without a climb animation still mantles.
  • New [Game] mantling setting, on by default, plus max height factor. Lua: self.controls.jump keeps working; add a Lua event or interface hook so content can veto a mantle.
  • Player only in this step.

Acceptance

  • Ledge-detection geometry logic separated from physics calls so it can be unit tested (reach, headroom, slope limits, too-high and too-low cases).
  • A headless scenario with a ledge made from Game Template meshes or test geometry shows a mantle (log line) and the player ending on top.
  • Setting off: identical to upstream. Build, tests and default boot pass.
  • Feel needs Eric's playtest.
Part of #6. Let the player climb onto ledges they jump at, instead of sliding off them. **Scope** - While jumping or falling and pressing forward into a wall, probe with physics shape casts for a standable surface whose top is within reach (start at about 1.1 × actor height above the feet) and with enough headroom for the actor's collision shape. - If found, move the actor up and onto the ledge over a short time (around 0.4 s), with movement input ignored for the duration. No animation requirement: content without a climb animation still mantles. - New `[Game] mantling` setting, on by default, plus max height factor. Lua: `self.controls.jump` keeps working; add a Lua event or interface hook so content can veto a mantle. - Player only in this step. **Acceptance** - Ledge-detection geometry logic separated from physics calls so it can be unit tested (reach, headroom, slope limits, too-high and too-low cases). - A headless scenario with a ledge made from Game Template meshes or test geometry shows a mantle (log line) and the player ending on top. - Setting off: identical to upstream. Build, tests and default boot pass. - Feel needs Eric's playtest.
claude added this to the 2. Feel milestone 2026-11-14 20:44:48 +00:00
eric referenced this issue from a commit 2026-11-15 20:44:43 +00:00
eric closed this issue 2026-11-15 20:44:43 +00:00
Author
Member

Done in 9e28969629.

What changed

  • New [Game] mantling (on), mantle max height (1.1 × actor height above the feet) and mantle duration (0.4 s).
  • When the player jumps or falls into a wall while moving towards it (within 60°), the movement solver casts the player's collision shape up (reach + 4 units), across the edge (the shape's full width) and down. With a surface that is walkable, above the feet, within reach and has headroom, the player moves up, across and down onto it along that checked path. Movement and jump input are ignored during the climb, and it ends a fall without fall damage. No animation is needed. A script move or teleport, noclip or paralysis cancels it.
  • Lua: self.controls.mantle (true by default; false vetoes climbs) and an AshlarMantle local event with height. The engine logs Ashlar mantle: ... climbs N onto a ledge / finished at x y z at verbose level.
  • The geometry rules and the path are in mwphysics/mantle.cpp, with no physics calls, so they can be unit tested. The shape casts are in movementsolver.cpp (tryMantle). The climb state lives on the physics Actor and is not saved.
  • Setting off: mCanStart is never set, so the solver never probes and behaves as upstream.

Tests

  • Build OK. components-tests 1636 passed, openmw-tests 637 passed (18 new: reach, headroom, room on top, slope, too high, too low, wall and floor detection, path and timing).
  • New SCENARIO=mantle uses a CC0 box mesh written for it (docker/scenarios/mantle/meshes/ashlar_ledge.dae):
    • mantle: 1 climb (height 46.4 from mid-jump), ending at dz = 81.0 on the 80-unit ledge
    • veto: 0 climbs, highest jump 37.5, ended at ground level
    • toohigh (240-unit wall): 0 climbs, highest jump 37.4
  • The default headless boot is clean; the screenshot matches earlier runs.
  • Headless software rendering runs at a low frame rate, so in that run the climb took about 0.76 s of wall-clock time; simulated time was 0.4 s.

Not verified: feel. Eric's playtest is needed for the reach, the 0.4 s duration, and whether a climb should need Jump held rather than just moving forward.

Follow-ups, not filed: a climb animation hook for content that has one, and NPC/creature mantling.

Done in `9e28969629`. **What changed** - New `[Game] mantling` (on), `mantle max height` (1.1 × actor height above the feet) and `mantle duration` (0.4 s). - When the player jumps or falls into a wall while moving towards it (within 60°), the movement solver casts the player's collision shape up (reach + 4 units), across the edge (the shape's full width) and down. With a surface that is walkable, above the feet, within reach and has headroom, the player moves up, across and down onto it along that checked path. Movement and jump input are ignored during the climb, and it ends a fall without fall damage. No animation is needed. A script move or teleport, noclip or paralysis cancels it. - Lua: `self.controls.mantle` (true by default; false vetoes climbs) and an `AshlarMantle` local event with `height`. The engine logs `Ashlar mantle: ... climbs N onto a ledge` / `finished at x y z` at verbose level. - The geometry rules and the path are in `mwphysics/mantle.cpp`, with no physics calls, so they can be unit tested. The shape casts are in `movementsolver.cpp` (`tryMantle`). The climb state lives on the physics `Actor` and is not saved. - Setting off: `mCanStart` is never set, so the solver never probes and behaves as upstream. **Tests** - Build OK. components-tests 1636 passed, openmw-tests 637 passed (18 new: reach, headroom, room on top, slope, too high, too low, wall and floor detection, path and timing). - New `SCENARIO=mantle` uses a CC0 box mesh written for it (`docker/scenarios/mantle/meshes/ashlar_ledge.dae`): - `mantle`: 1 climb (height 46.4 from mid-jump), ending at dz = 81.0 on the 80-unit ledge - `veto`: 0 climbs, highest jump 37.5, ended at ground level - `toohigh` (240-unit wall): 0 climbs, highest jump 37.4 - The default headless boot is clean; the screenshot matches earlier runs. - Headless software rendering runs at a low frame rate, so in that run the climb took about 0.76 s of wall-clock time; simulated time was 0.4 s. **Not verified: feel.** Eric's playtest is needed for the reach, the 0.4 s duration, and whether a climb should need Jump held rather than just moving forward. Follow-ups, not filed: a climb animation hook for content that has one, and NPC/creature mantling.
eric referenced this issue from a commit 2026-11-15 20:45:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gaming/ashlar#28