Repository navigation
feat: the hero jumps, falls and gets hurt like in Gothic - flat falls, lying landings, the running leap, fall damage only when he lands lying (#499) - #584
Open
BoroBongo wants to merge 43 commits into
Conversation
…rom the top of the jump or fall, none within FALLDOWN_HEIGHT, also without the combat system HeroFallService (Core) tracks the hero's airborne phases from per-frame measurements (HeroAirborneDomain), sets BS_JUMP/BS_FALL, computes the damage once at the landing with NpcFallDomain.GetFallDamage and raises HeroLanded and FallDamage. Gated by DeveloperConfig.EnableHeroFallDamage. FightService takes the hero's fall damage without the combat system (NPCs unchanged), honours god mode for a hero without prefab properties and never sets negative hit points. A deep landing locks walking (PlayerLocks.FallLanding). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and gets hurt by deep falls - the rig port feeds HeroFallService VrHeroJumpFall measures feet height, grounded (with the rig's grace), jumping (new IVrRig.IsJumping, XRI's jump provider), climbing, gravity and teleports. A hero jumping or falling into water swims (VRSwimDive takes BS_JUMP/BS_FALL over). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… S_JUMP, S_FALLDN/S_FALL and the small landings VrHeroLocomotion follows HeroFallService's phase: T_STAND_2_JUMP or T_RUNL_2_JUMP (played in 0.3 s, the physics jump is already airborne) -> S_JUMP -> T_JUMP_2_STAND / T_JUMP_2_RUNL (or straight on running), S_FALLDN -> S_FALL past FALLDOWN_HEIGHT -> T_FALLDN_2_STAND. Walking on cuts a landing short. Stairs and slopes no longer show S_FALLDN (the old grounded/speed check). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w stays at the head or goes with the body (Immersion option heroLandingView) VrHeroDownPose plays T_FALL_2_FALLEN -> S_FALLEN -> T_FALLEN_2_STAND on a deep HeroLanded in either heroFallMode, reusing its camera-down mechanism for heroLandingView 1; killed by the fall he stays lying (S_DEAD). Both controllers give a short strong pulse on a deep landing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ad or a loaded game is no fall - the first 2 s aren't tracked Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ht (0.46, a force unit) lifted him only about 0.3 m Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ce, or on his back when he went over the edge backwards; the damage still starts at FALLDOWN_HEIGHT The pose is decoupled from the damage: NpcFallDomain.LyingFallHeight (2 m, shared with NpcJumpFall) switches to S_FALL / S_FALLB and a lying landing (HeroFallPose: T_FALL_2_FALLEN, S_FALLEN, T_FALLEN_2_STAND or the FALLB/FALLENB set, S_DEAD/S_DEADB when it kills), the lock lasts the chosen set's animations. Backwards = horizontal movement against the facing when the fall turns flat; the face set if the model lacks the back one. A 3 m fall lands lying with damage 0. HeroLanded carries the HeroLanding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ace or the back, separate from the damage Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ort) and EnableHeroFallDamage on in Production Co-Authored-By: Claude Opus 5.5 <[email protected]>
… - the jump's own rise no longer lays the hero on his face HeroAirborneDomain measures the lying depth of a jump from its take-off (LyingReferenceY), a fall from its start; a jump stays a jump (S_JUMP, the jump's landing) until that deep. The damage height is still from the top. Tests: a running jump down a slope landing 1.5 m lower lands as a jump, a jump off a 3 m ledge lands lying. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at T_RUNL_2_JUMP's speed in the direction of the run VrHeroJumpFall starts the leap when a jump begins at or above VrHeroSpeeds.RunThreshold: IVrRig.SetLeapVelocity (new port member) with VrHeroSpeeds.RunJump - T_RUNL_2_JUMP's root motion at the body's scale (VrHeroLocomotion.UpdateSpeeds), else 1.6x the run. XriRig moves the CharacterController at that velocity with the stick's movement off until it lands, climbs or is teleported; water, a ledge or a teleport also end it from HeroFallService's phase. The standing and walking jump stays vertical, both rise 1 m. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…m its take-off, the running jump leaps Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fall, dialogs, knocked out) - and a running jump logs how far it went Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llows the rig's movement per physics step, not the frame's average VrPhysicsHand.Drive followed _rigVelocity unlimited and the rest clamped to Max Speed (15 m/s). _rigVelocity was measured per frame in LateUpdate, but the rig moves once per frame: in the second physics step of a frame (editor below 50 fps) the controller stood still while the hand was still driven at the rig's velocity; at 20 m/s the clamp left 5 m/s, the body overshot the controller by ~10 cm, and beyond the 5 mm blocked distance UpdateVisual showed the interpolated body one step behind - the hands jumped every few frames (no snap or stuck log: neither ran). Now the rig's movement since the last step is measured in FixedUpdate. Also a rig move per frame counts as a teleport only beyond (terminal fall speed + 5 m/s) * deltaTime, at least 1 m - a fast fall at a low frame rate snapped the hands; real teleports raise Teleported anyway. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…UP), not Gothic's forward leap - and the take-off plays at its own speed until he lands T_STAND_2_JUMP is Gothic's standing forward jump (2.65 m, flailing arms); the vertical VR jump now uses the jump-up, T_STAND_2_JUMP / S_JUMP only for a model without it. The running jump (VRPlayerService.IsRunningJump, set by VrHeroJumpFall with the leap - one decision for the leap and the animation) keeps T_RUNL_2_JUMP -> S_JUMP. The take-off is no longer squeezed into 0.3 s: it plays at its own speed and the landing cuts it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…IGHT below the take-off - jumping down steep slopes no longer lays him on his face Like OpenGothic, a jump falls flat (and lands lying) only beyond the guild's FALLDOWN_HEIGHT (5 m human) below its take-off; a fall without a jump keeps NpcFallDomain.LyingFallHeight (2 m) below its start. HeroAirborneDomain.Tick takes the safe height again for that (LyingDepth), the damage stays from the top. Tests: a jump 3.5 m down a steep slope lands as a jump, a jump off a 6 m ledge lands lying. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eir own speed, a jump falls flat only beyond FALLDOWN_HEIGHT Co-Authored-By: Claude Opus 5.5 <[email protected]>
… landing on his feet costs nothing, also from high up Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nsion IsLocomotion/IsAirborne) - HeroFallService, VRHeroMovement and VRSwimDive no longer copy the list Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o string per frame while he sits or lies - logged once when it changes, also in builds Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nding checks the depth again (a hitch at low frame rates landed him on his feet, unhurt) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he hero's death - not only by the platform's Tick, which may stop meanwhile Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ecks EnableCombatSystem like HeroFallService checks EnableHeroFallDamage, FightService only applies it Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y backend), not in the XRI rig - and the rig enables its move and jump providers in one place, the leap included, with null guards Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oNormalJumpRise), not a backend literal Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hange mid-fall drops the fall, the landing re-checks the lying depth, a blocked walk blocks jumping, a drawn weapon changes nothing Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y Unity on import) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eroFallDamage was only for testing and goes Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ero's - and NpcJumpFall falls and lands with FallPose.Front instead of its own literals Co-Authored-By: Claude Opus 5.5 <[email protected]>
…(HeroFallSample.GroundSnapHeight from IVrRig) - no Core constant mirroring the XRI rig's 0.3 m Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Jump: the take-off's speed against HeroFallSample.RunSpeed) - VR only leaps, VRPlayerService.IsRunningJump goes Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng while bound) - HeroFallService.LandingCount and LastLanding go, one channel for one fact Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e times it (HeroLanding.StandUpStart / StandUpEnd) and decides the back set once (LyingFallPose), VrHeroDownPose follows those times with one DownReason and an animation set per reason (VrHeroDownAnimations) instead of its own chain and four landing flags Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e, the hero's fall damage is always on Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…) in all 8 languages - aside or with the body (added through Unity MCP) Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks
…off velocity (HeroAirborneDomain/HeroFallService.TakeOffVelocity next to IsRunningJump), HeroFallService.Tick returns the event it handled and VrHeroJumpFall starts the leap on JumpStarted in that direction (its own smoothed velocity and phase-edge check are gone); tests for the take-off velocity Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to the fall flat's - FallPose.FallDown / FallDownToStand, used by NpcJumpFall and VrHeroLocomotion instead of their own literals Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ends the VR body's lying too - VrHeroDownPose listens to IVrRig.Teleported, so the body no longer lies on after HeroFallService ended the walking lock Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w menu comment wrapped to 120 columns Co-Authored-By: Claude Opus 5.5 <[email protected]>
…jump/fall code reads the hero's speeds from VRHeroSpeedService Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
AI review (architecture-reviewer + gothic-reviewer), two rounds
Fixed in this PR (nothing deferred):
Not changed:
Verified locally:
Reports and answers: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #499. The hero jumps, falls and gets hurt like in Gothic, and the VR body shows it.
heroLandingView): the view stays aside (default) or goes down and up with the body.HeroLanding.StandUpStart/End, the VR body follows it), the damage; VR only measures throughIVrRig(also the ground snap height) and animates. NPCs and the hero shareFallPose(HUMANS.MDS fall sets).Technical: Core
HeroFallService+HeroAirborneDomain(EditMode tests), models inModels/Movement(FallPose,HeroLanding,HeroFallHold, ...), eventHeroLanded,PlayerLocks.FallLanding,BodyStateExtension(IsLocomotion/IsAirborne). VR:VrHeroJumpFall(measures viaIVrRig: IsJumping, GroundSnapHeight, SetLeapVelocity),VrHeroLocomotion(air animations, listens toHeroLanded),VrHeroDownPose(one down reason +VrHeroDownAnimations),GothicJumpProvider(1 m rise,VRConstants.HeroNormalJumpRise),VRContextInteractionService(a blocked walk blocks jumping).Stacked on #583 (
fix/hero-speed-matches-steps).ADR:
Docs/adr/2026-11-29-hero-jump-fall.mdWhy
#499 - the hero took no fall damage and his VR body showed no jumps or falls.
How to test manually
G1 Mroczne Tajemnice (a Gothic 1 mod) or vanilla G1/G2.
[HeroFall] Landed (jump) ... damage 0.[VrHeroJumpFall] Running jump ... leap at ...andLeap ended ... after X m.lying landing on his face ... damage 0, walking and jumping locked about 1.7 s.EnableCombatSystemoff: the hero is hurt, NPCs aren't (NpcJumpFall checks it where it raises the damage).Save/load
Nothing is saved. A load resets the tracking and the lock; the first 2 s after a world load aren't tracked (bridges still loading).
Known gaps / follow-ups
heroLandingView(Immersion)..claude/review/feature-hero-jump-fall/- two rounds (architecture: fits with concerns -> fits; gothic: no blockers), all findings fixed in this PR, the architecture ones included (one measurement of the take-off in Core, the lying timeline in Core, HeroLanded instead of polling, down reasons, FallPose incl. the upright fall, the ground snap from the rig, the flag removed). The leap direction now comes from Core's take-off velocity. Tested by the author in the headset: no hand flicker; a 36 m running jump kills and the death menu opens.🤖 Generated with Claude Code