Repository navigation
fix: the VR hero's feet match the ground - he walks and runs at his body's Gothic animation speeds (x1.4), one owner of the rig's speeds - #583
Open
BoroBongo wants to merge 20 commits into
Conversation
…s go - read from Gothic's animations at the body's scale, the speed potion's run loop included Co-Authored-By: Claude Opus 5.5 <[email protected]>
… runs at Gothic's walk/run loop speeds times the body's scale, crouched at sneak speed, and BS_RUN starts where the run animation does Co-Authored-By: Claude Opus 5.5 <[email protected]>
…neak animations Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…which play as much faster - the feet still match the ground, sneaking stays Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hanges by more than 5 % - nodding or a physical duck no longer changes them mid-stride Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ring instance - a rebuilt overlay string no longer re-reads and logs the speeds every frame Co-Authored-By: Claude Opus 5.5 <[email protected]>
… at 0.2 m/s Co-Authored-By: Claude Opus 5.5 <[email protected]>
…neak speed and BS_SNEAK, and a note that the rig's own speeds must be read before water or a transformation change them Co-Authored-By: Claude Opus 5.5 <[email protected]>
… live in VRConstants.Movement with the other VR tunables, not in the VrHeroSpeeds model Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rvice.HeroSpeeds) - the body's or the rig's configured speeds (IVrRig.DefaultMoveSpeed/DefaultRunSpeed) with the speed potion, no hand copy of the prefab's 1.5/3.5 and no read-once in Awake Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er and a transformation hand it an override (VRPlayerService.SetHeroSpeedOverride, water first), wading and swimming at half the body's walk speed, no land restores of their own and no blip of the prefab speeds leaving the water Co-Authored-By: Claude Opus 5.5 <[email protected]>
…speeds, water and a transformation hand it theirs (water first), the rig says its own speeds, wading and swimming at half the hero's walk speed Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ated by Unity on import) Co-Authored-By: Claude Opus 5.5 <[email protected]>
10 tasks
…ed save or a world change while wading no longer leaves the hero walking at half speed without sprint on land (cleared on WorldSceneLoaded always and in OnDestroy, the listener removed) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at full stick (WalkRunFactor), not about 1 - the playback comment in VrHeroLocomotion said otherwise Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vice, PlayerScope) - body speeds, speed potion, land speeds and the overrides move out of VRPlayerService, which overrides wins is an explicit priority list (water first) instead of the enum's order, with an EditMode test Co-Authored-By: Claude Opus 5.5 <[email protected]>
…otion - a potion without a run loop of its own (a mod) no longer speeds up the water by half again Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ir own with the water-first order as a written list, the water at half the walk without the speed potion, land speeds and sprint back after a load or world change in the water Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ity on import) 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, with reasons:
Verified locally: compiles, 167/167 EditMode tests, an editor playtest (G1 Mroczne Tajemnice, a Gothic 1 mod): walk 1.84 / run 4.40 / sneak 0.72 m/s at scale 0.96, no exceptions. 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
The VR hero's feet match the ground: he walks, runs and sneaks at the speed of his body's own Gothic animations.
Speeds from the animations. Walk = S_WALKL's root motion, run (sprint) = S_RUNL's, crouched = S_SNEAKL's, each times the VR body's scale (head height). They are read while the game runs, so Gothic 2, mods and overlays bring their own. Measured in G1: 1.37 / 3.28 / 0.75 m/s at scale 1.
1.4 times as fast (author's choice after a playtest). Walking and running are 1.4x Gothic's loops and the loops play 1.4x as fast, so the feet still match: about 1.8 m/s walking, 4.4 m/s running at normal height. Sneaking keeps its own speed.
The speed potion runs with its overlay's own run loop (HUMANS_SPRINT); an overlay without one keeps the old x1.5.
One running threshold. Halfway between walk and run speed, for the body's run animation and for BS_RUN, so the stick walks and the sprint runs - for the scripts too.
One owner of the rig's speeds. VRHeroMovement is the only writer of the rig's walk/run speed. Water and a transformation hand it an override (
VRHeroSpeedService.SetHeroSpeedOverride, an explicit priority list: water first) instead of writing the rig. Wading, swimming and diving move at half the hero's land walk speed without the speed potion (about 0.9 m/s, was a fixed 0.75); leaving the water, loading a game or changing worlds brings the land speeds and sprint straight back.Technical:
VrHeroSpeeds(struct),VRHeroSpeedService(PlayerScope:HeroBodySpeeds, get-onlyHeroSpeedswith the potion rule, the overrides; EditMode test),VrHeroSpeedOverride/VrHeroSpeedSource,IVrRig.DefaultMoveSpeed/DefaultRunSpeed,VrHeroLocomotion.UpdateSpeeds,VRHeroMovement.UpdateSpeeds, tunables inVRConstants.Movement.Stacked on #567 (
fix/hero-body-state).ADR:
Docs/adr/2026-11-29-hero-speed-from-animations.md(replaces decision 7 of the 2026-11-03 movement ADR).Why
Playtest: the steps were too short or too long for the speed (fixed 1.5 / 3.5 m/s against the animations' own speeds), sneaking slid, and BS_RUN started at 1 m/s while the body walked until 1.6 m/s.
How to test manually
[VRHeroBody] Speeds of HUMANS.MDS/ at scale X: walk ..., run ..., sneak ...(about 1.8 / 4.4 / 0.72 at scale 0.96).ItFo_Potion_Haste_01): the log line ends with "(the overlay's own run)", sprint is faster, walking unchanged; back to normal when it ends.Save/load
Nothing is saved; the speeds are read again from the animations.
Known gaps / follow-ups
.claude/review/fix-hero-speed-matches-steps/(architecture: fits with concerns; gothic: no blockers), two review rounds, all findings fixed in this PR (architecture: the single writer of the rig speeds and its own service included); one disagreement (a one-frame potion log lag) in the response file.🤖 Generated with Claude Code