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
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
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.
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.
Part of #6. Let the player climb onto ledges they jump at, instead of sliding off them.
Scope
[Game] mantlingsetting, on by default, plus max height factor. Lua:self.controls.jumpkeeps working; add a Lua event or interface hook so content can veto a mantle.Acceptance
Done in
9e28969629.What changed
[Game] mantling(on),mantle max height(1.1 × actor height above the feet) andmantle duration(0.4 s).self.controls.mantle(true by default; false vetoes climbs) and anAshlarMantlelocal event withheight. The engine logsAshlar mantle: ... climbs N onto a ledge/finished at x y zat verbose level.mwphysics/mantle.cpp, with no physics calls, so they can be unit tested. The shape casts are inmovementsolver.cpp(tryMantle). The climb state lives on the physicsActorand is not saved.mCanStartis never set, so the solver never probes and behaves as upstream.Tests
SCENARIO=mantleuses 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 ledgeveto: 0 climbs, highest jump 37.5, ended at ground leveltoohigh(240-unit wall): 0 climbs, highest jump 37.4Not 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.