Repository navigation
feat: steep slopes slide like in Gothic - no more jumping up cliffs, NPCs and monsters slide too - #585
Open
BoroBongo wants to merge 33 commits into
Open
feat: steep slopes slide like in Gothic - no more jumping up cliffs, NPCs and monsters slide too#585BoroBongo wants to merge 33 commits into
BoroBongo wants to merge 33 commits into
Conversation
… - the rule for the hero and NPCs (SlopeSlideDomain), with EditMode tests OpenGothic MoveAlgo::testSlide: slides while sin(SLIDE_ANGLE2) < normal.y < cos(SLIDE_ANGLE) (SLIDE_ANGLE2 now in LedgeRules, 0 in Species.d), gravity along the slope (g * sin), capped at 6 m/s (ours). Steep for 0.2 s before a slide, walkable for 0.1 s before it ends (single steep triangles); a slide that gets nowhere ends as Blocked until moved 0.5 m away; no ground ends it for a fall. S_SLIDE facing downhill, S_SLIDEB backwards. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… anymore, and slides down it like in Gothic - HeroSlideService decides, the XRI rig moves him and refuses the take-off The rig port gets the ground straight under the feet (one ray down per frame - no stair risers), SlideVelocity and IsTakeOffBlocked. VrHeroJumpFall feeds HeroFallService and HeroSlideService with the same sample. XriSlopeSlide queues the slide after XRI's moves (CharacterController.Move, walls still stop it) and takes back the stick's steps up the slope; gravity's fall speed is held and the rig counts as grounded meanwhile, so a slide is no fall. Steeper than SLIDE_ANGLE, a jump press does nothing until released (OpenGothic: no jump while sliding). Not while climbing, swimming, jumping, lying after a fall, transformed or busy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…IDEB backwards, and the scripts see him standing - no footsteps, no running while he slides BS_STAND like OpenGothic (BS_NONE for the slide animations). Without S_SLIDEB the body plays S_SLIDE, without both its normal animations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s SLIDE_ANGLE, S_SLIDE / S_SLIDEB, off an edge into a fall NpcJumpFall gets a Sliding state (busy: the walk and fight moves wait, like for falls): ground straight under a moving NPC near the hero steeper than its SLIDE_ANGLE for 0.2 s, going down or across it, slides it down - kinematic, held on the ground below, stopped by walls. It walks on at walkable ground, stands when blocked, and falls with the slide's speed off an edge (the drop counts from there). Walking up a steep slope stays walking, so routes don't loop. Flyers never slide (NpcFallDomain.CanMove). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p from steep ground, a slide is no fall, NPCs only downhill Co-Authored-By: Claude Opus 5.5 <[email protected]>
… below 0.01) count as a wall even without SLIDE_ANGLE2 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le he fights or sits - why he isn't checked is a HeroSlideHold enum, its text only built when it changes Co-Authored-By: Claude Opus 5.5 <[email protected]>
… dead or unconscious - fall, climb and slide all finish the same way when it can't move, without our landing or idle animations over the death Co-Authored-By: Claude Opus 5.5 <[email protected]>
…slide - its steep time starts again whenever it stands still, is far from the hero or can't move (a block at a wall stays) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rising beside it - only near-vertical hits of its wall ray are walls, the 0.3 m look-ahead is named Co-Authored-By: Claude Opus 5.5 <[email protected]>
…k his jump or start a slide - the slide's ground ray sees only the world mesh layer (Default, with the solid VOBs), like the NPCs' ground ray Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e S_SLIDE, else none) lives once in SlopeSlideDomain.GetAnimation for the hero and NPCs, the names in DaedalusConst Co-Authored-By: Claude Opus 5.5 <[email protected]>
…k is Core's rule (SlopeSlideDomain.RemoveUphill, with EditMode tests) - the XRI backend only moves the body Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd its normal (HeroFallSample) - forgotten, he'd silently never slide or be kept from jumping off steep ground Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n default - 0 is Gothic's own value Co-Authored-By: Claude Opus 5.5 <[email protected]>
…jump, an NPC's steep time starts again when it stops, what happens when an NPC can't move mid-slide Co-Authored-By: Claude Opus 5.5 <[email protected]>
…de animation comes from HeroSlideService Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mport) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pcJumpFall - start, tick, wall look-ahead and the hand-off into a fall; what fall, climb and slide all ask of the body (rest height, guild values, ground below, physics) is NpcMoveBody Co-Authored-By: Claude Opus 5.5 <[email protected]>
…edgeClimb), the landing's and climbs' animations one after another NpcAnimationSequence - NpcJumpFall keeps the state switch, the fall and the landing Co-Authored-By: Claude Opus 5.5 <[email protected]>
…of the hero's body feeds his falls and his slides alike Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dyService.Tick) - the fall, then the slide, decided in Core; the platform applies what it returns (HeroBodyResult: slide velocity, take-off blocked) and the two services' Tick and OnTeleported are internal Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o calls whom for speeds, jumps and falls, fall damage, the lying landing, slides and climbs, where the rules live, the ADRs; pointers from architecture.md and ledge-climbing.md, and stateless Domain rule sets may be static Co-Authored-By: Claude Opus 5.5 <[email protected]>
… before the slide, decided in Core), NpcSlopeSlide and the movement map Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nerated by Unity on import) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eeds from VRHeroSpeedService, the running jump's leap from Core's take-off velocity through HeroBodyService (HeroBodyResult.AirEvent carries the fall's event of the frame), FallPose.FallDown / FallDownToStand in the split NPC workers Co-Authored-By: Claude Opus 5.5 <[email protected]>
…with its state passed in, like Docs/architecture.md - one rule, stated the same in both places Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eroSlideService's (TryGetLocomotionBodyState, VRHeroMovement asks), no slide starts in the air (HeroSlideHold.Airborne while the fall's phase isn't Grounded: a drop onto a steep slope lands first), and a missing hero ends a running slide (NoHero) so the rig keeps no slide velocity Co-Authored-By: Claude Opus 5.5 <[email protected]>
… would move the body, but XriRig counted him grounded and held his gravity Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ad, near-vertical hits only) - a falling NPC no longer stops its run at a slope rising ahead but lands on it; NpcSlopeSlide logs as [NpcSlide] Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Climb, NpcAnimationSequence) are internal to Core - AI code reaches NPC movement only through INpcJumpFallFactory, nothing bypasses NpcJumpFall's state switch Co-Authored-By: Claude Opus 5.5 <[email protected]>
….SlideOffAnEdgeFallsFromTheEdge) - the slide counts as ground, the drop starts at the last grounded frame, the rig's grace only lowers it by a few cm; the movement map names it among the pitfalls 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):
Verified locally:
Still to check in play: NPC ladder/ledge climbs after the 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
Steep slopes slide like in Gothic - for the VR hero and for NPCs and monsters.
Gothic's rule. Ground steeper than the guild's SLIDE_ANGLE (45 deg for humans, Species.d) and not a wall (SLIDE_ANGLE2) slides: gravity along the slope, up to 6 m/s (ours). It must be steep for 0.2 s to start, so single steep triangles and stairs don't trigger it.
The hero. He slides down, the stick can't walk him up (sideways and downhill stay free), and he can't jump off steep ground - no more climbing a cliff by jumping again and again. The body plays S_SLIDE facing downhill, S_SLIDEB backwards; the scripts see him standing. Sliding off an edge becomes a normal fall; a slide itself is no fall and costs no HP.
NPCs and monsters slide with their own guild's angle (bloodfly 75, minecrawler 60, flyers never) when they move down or across a slope, only within 40 m of the hero; S_SLIDE / S_SLIDEB, off an edge into a fall.
Code layout: NpcJumpFall (was ~800 lines) keeps the state switch, the fall and the landing; the slide (
NpcSlopeSlide), ledges and ladders (NpcLedgeClimb), the shared body access (NpcMoveBody) and animation chains (NpcAnimationSequence) are workers. The hero's fall and slide are ticked by one Core entry,HeroBodyService(the fall before the slide, decided in Core); the sample isHeroBodySample. New map of the area:Docs/hero-movement.md(linked fromDocs/architecture.mdandDocs/ledge-climbing.md).Technical: Core
SlopeSlideDomain(static rule set, EditMode tests: IsSlideGround, RemoveUphill, GetAnimation, debounce),HeroSlideService,HeroSlideHold; VR:IVrRig.TryGetGround/SlideVelocity/IsTakeOffBlocked,XriSlopeSlide(one ray down per frame, world mesh layer only);NpcJumpFallsliding state;DaedalusConst.AniSlide/AniSlideBack.Stacked on #584 (
feature/hero-jump-fall).ADR:
Docs/adr/2026-11-29-slope-slide.mdWhy
Playtest (G1 Mroczne Tajemnice, a Gothic 1 mod): the hero could climb any steep slope by jumping repeatedly, and neither he nor NPCs slid down slopes like in Gothic.
How to test manually
[HeroSlide] Slides down a NN deg slope, S_SLIDE (looking downhill) / S_SLIDEB (looking uphill); ends withSlide ended (walkable ground), no damage.[XRI] No jump - the ground is too steep. Jumping on barrels, NPCs and items still works.Slide ended (no ground below - falls), then a normal fall.[NpcJumpFall] ... slides, S_SLIDE; afterwards it walks on with its routine. Kill an NPC mid-slide: its body can be grabbed and looted.Save/load
Nothing is saved; teleports, loading a game and loading a world end any slide.
Known gaps / follow-ups
.claude/review/feature-slope-slide/- two rounds (architecture: fits with concerns -> fits; gothic: 2 medium -> fixed), all findings fixed in this PR: NpcJumpFall split into internal workers, HeroBodyService as the single Core tick, BS_STAND while sliding decided in Core, no slide check in the air, one wall test for NPC fall and slide, Docs/hero-movement.md. Note for reviewers: CLAUDE.md gets one clause (a stateless Domain rule set may be a static class), matching Docs/architecture.md.🤖 Generated with Claude Code