Skip to content

feat: ledges are easy to catch in a jump and can't be caught while falling, like Gothic - the grip pulls you onto the lip, an Immersion option allows grabs while falling - #587

Open
BoroBongo wants to merge 11 commits into
feature/hero-jump-fallfrom
feature/ledge-air-reach
Open

BoroBongo wants to merge 11 commits into
feature/hero-jump-fallfrom
feature/ledge-air-reach

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

Ledges are easy to catch in a jump, and can't be caught while falling, like in Gothic.

  • In a jump (Core: HeroFallService.Phase == Jumping, plus 0.2 s after landing) a hand catches a climbable lip within about 0.6 m instead of 0.2 m (0.45 m with ledge hints Glow). The lip glows and the hand half closes and ticks from that far. A grip there pulls the body up until the hand sits on the lip, and the climb continues as usual (pull up or comfort climb).
  • While falling (walked off an edge, or a jump that dropped below its take-off) no ledge can be caught - like Gothic. The new Immersion option "Grab while falling" (ledgeGrabFalling, default off) allows it, with the normal short reach.
  • On the ground nothing changes. Ladders are unchanged. A hand that touches a ladder or an item in a jump grabs that, not a ledge from afar.

Technical:

  • Core: LedgeProbeDomain.ProbeEdge(..., reach) searches the top further from the hand (PlayMode test). LedgeService.CanCatchLedge(phase, allowWhileFalling) is the Gothic rule.
  • VR: VrLedgeReachMode (Normal / Jump / Blocked) decides the reach. VrLedgeAnchor stretches its grab box to the hand and answers the new port IVrGripOffset.
  • XRI backend: XriInteractableBridge pulls the rig (XriRig.PullBody, CharacterController.Move) before XRI's ClimbProvider anchors the climb, and warns once if a pull leaves the hand off its grip (an XRI upgrade guard). IVrGrabber.GetTouched lets a touched ladder or item win over the stretched box.
  • Option texts in 8 languages, added through Unity MCP.

Stacked on #584 (needs HeroFallService).

ADR: Docs/adr/2026-11-30-ledge-air-reach.md, map in Docs/ledge-climbing.md.

Why

Playtest (G1 Mroczne Tajemnice, a Gothic 1 mod): grabbing a ledge while jumping in place below it was very hard. In Gothic you target the ledge (ALT) and climb; in VR the hand had to hit a 0.2 m spot at the top of a jump.

How to test manually

  • Stand at a 2-3 m wall, raise both hands and jump in place. Within about 0.6 m of the lip: glow and a tick; [Ledge] Jump reach (Jumping) in the log. Grip: [XRI] Grip pull ..., the hand ends on the lip and you hang; pull up or comfort climb as usual.
  • Grip right after landing (within 0.2 s): still works.
  • Walk off a high edge past a ledge: no glow, no grab (Blocked). Immersion "Grab while falling" = on: the normal short reach catches it.
  • On the ground: ledges as before. Ladders as before; in a jump a hand touching a ladder grabs the ladder.
  • PlayMode LedgeProbeTest (18 tests).

Save/load

Nothing is saved. The option is Gothic.ini ([GOTHIC_VR_IMMERSION] ledgeGrabFalling, default 0).

Known gaps / follow-ups

  • Wiki: the new Immersion ini key ledgeGrabFalling (separate wiki repository).
  • Reviews: .claude/review/feature-ledge-air-reach/ (architecture: fits with concerns -> the body pull moved into the XRI backend, the reach mode and the Gothic rule extracted; gothic: no blockers, all items fixed). Tested by the author in the editor (VR simulator).

🤖 Generated with Claude Code

BoroBongo and others added 11 commits November 29, 2026 17:40
…ched that much higher, lower and further along the approach (one ray per 15 cm, the walkable hit nearest to the hand wins), so a hand jumping below a lip finds it; reach 0 probes exactly as before, with a PlayMode test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls (XriRig: CharacterController.Move like the leap) - in a ledge anchor's select event it runs before XRI's ClimbProvider anchors the hand, so the climb holds the hand where it arrives

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mping) and 0.2 s after its landing a hand grips lips 0.6 m away: the anchor's grab box stretches to the hand, half-close tick and glow are on, the grip pulls the body until the hand sits on the lip; while falling no ledge can be grabbed like in Gothic, unless the new Immersion option ledgeGrabFalling (default off) allows it with the normal reach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o the lip only in a jump, no ledge grab while falling unless the new Immersion option allows it, ladders unchanged) and its ranges, option and XRI select-order pitfall in Docs/ledge-climbing.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lling) in all 8 languages (added through Unity MCP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ic rule "a falling hero catches no ledge" (unless the player's option allows it) lives in Core, not in the VR reach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s' ledge reach - Normal / Jump / Blocked from HeroFallService.Phase with the 0.2 s grace and LedgeService.CanCatchLedge, logged on change; VrLedgeReach updates it before its guards (no stale flags while suspended) and hides the stretched anchors when the jump reach ends

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd - VrLedgeAnchor answers the new port IVrGripOffset (how far the grip pulls, zero unless stretched), XriInteractableBridge moves the rig in the climbable's select event before XRI's ClimbProvider anchors the hand (XriRig.PullBody, CharacterController.Move; off controller = no move, warned once) and warns once when a pulled hand is off its grip a frame later; IVrRig.MoveBody is gone; the anchor shrinks its box itself when placed, hidden, gripped or let go, skips resizes under 1 cm and keeps no hand behind the wall face

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uches - XRI ranks near targets by attach point, so the stretched box (ranked by its lip) won over a ladder whose transform is further away; IVrGrabber.GetTouched (XriGrabberBridge: one overlap at the near caster, mapped by the interaction manager) lets VrLedgeReach hide the hand's anchor meanwhile; and a hand within 5 cm of where the jump probe last found no lip isn't probed again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the XRI backend (IVrGripOffset, XriInteractableBridge.PullToGrip, the once-only off-grip warning as XRI-upgrade guard), the ledge yielding to a touched ladder or item, the probe pre-gate and LedgeService.CanCatchLedge in Docs/ledge-climbing.md; the decision record's consequences name where the pull happens and the ladder/item rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Mode (generated by Unity on import)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BoroBongo

Copy link
Copy Markdown
Contributor Author

AI review (architecture-reviewer + gothic-reviewer)

Commit Architecture Gothic
23aaf97 fits with concerns (1 major, 3 minor) no blockers, 7 risks/nits
676a5ad all fixed all fixed

Fixed in this PR (nothing deferred):

  • The body pull moved into the XRI backend.
    • Before, a component moved the body inside XRI's select event and relied on XRI's internal order. Now the anchor only answers the new port IVrGripOffset, and XriInteractableBridge pulls the rig (XriRig.PullBody) before XRI's ClimbProvider anchors the climb.
    • A one-time warning fires if a pull leaves the hand off its grip, which guards against an XRI upgrade changing that order.
    • With the CharacterController off, the pull does nothing and warns; before, it moved the root through walls.
  • The rules sit in the right places.
    • VrLedgeReachMode (Normal / Jump / Blocked) decides the reach.
    • The Gothic rule "a falling hero catches no ledge" is LedgeService.CanCatchLedge in Core.
  • The anchor owns its stretched box. It resets itself on place, hide, grab and release. It rewrites the collider only when the hand moved more than 1 cm, and it respects the wall side.
  • Ladders and items win. A ladder or item the hand touches wins over the stretched box (IVrGrabber.GetTouched).
  • The jump probe has a distance pre-gate. The reach mode updates before its guards.

Not changed: a grab on the way down below the take-off counts as falling. That is the ADR's rule (only in a jump).

Verified locally:

  • Compiles, 167/167 EditMode tests, 18/18 PlayMode LedgeProbeTest.
  • The author tested the jump grab in the editor (VR simulator) before the backend refactor. The pull now lives in the backend; the [XRI] Grip pull ... log and the off-grip warning show whether it works.

Reports and answers: .claude/review/feature-ledge-air-reach/.

@BoroBongo BoroBongo mentioned this pull request Nov 30, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant