fix(fps): Epona jumps fences above a 60 fps cap #1434
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1434
Loading…
Reference in a new issue
No description provided.
Delete branch "CraftyCorvid/Longshot:fix/epona-jump-above-60"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Linux, RTX 5090 · Needs: none
Why
With the Game frame rate cap past 60, Epona doesn't jump fences: she starts the jump, but her animation keeps galloping and
she slides through the fence at ground level (her body goes over it, so she isn't stopped). At 70-90 fps it happened on
most jumps here, in one session on every one; the shorter the frames, the more often (the game-free test shows the cause
growing faster at 120 to 240 fps). At a cap of 60 she jumps as she should. No issue covers it (the tracker
searched for Epona, horse, jump, slow motion, blend); the other above-60 problems (#439, #988) are different places.
How to reproduce
Seen on: CachyOS Linux (kernel 7.3), RTX 5090, NVIDIA 620.70.06
Settings and switches: Game frame rate cap Uncapped (about 70-90 fps on this PC), everything else default
Steps: as adult Link, call Epona and ride her at a fence she jumps; do it 5 or 6 times
Expected: each time she leaps over the fence, as at a cap of 60
Actual: most times she gallops through it at ground level
What changed
A horse's jump state machine (
f_82c59eb0) sets the blend frames into its JumpReady animation each frame, so the blendends at takeoff. On a step under 1, which at 60 fps is slow motion, it takes last frame's blend frames plus the step
instead. Above 60 fps every step is under 1, so the blend frames grew each frame (25 at 60 fps, 100 to 1500 above), the jump
animation never blended in, and Epona galloped on while her body jumped. The game's "step < 1" test now first asks
whether the step is the whole frame's (the game's time object's step); if it is, the slow-motion branch is skipped. A step
under the frame's (slow motion), a cap of 60 and a frame slower than 60 fps keep the game's own test.
nx2/oot_patches.pypatch_horse_jump: beforef_82c59eb0's branch onfcmp s10, 1.0(0x82c5ae1c), a call tohos_oot_horse_whole_stepthat takes the same branch (past the slow-motion one) when it returns 1;reportwarns whenit is not found once.
host/oot_high_fps.hoot_horse_whole_step(the rule: above a 60 cap, a step within 0.1% of the frame's own,the frame's under 1) and
host/oot_high_fps.chos_oot_horse_whole_step(reads the time object's step, as the sound gatedoes;
HOS_FPS_LOGcounts it).tests/test_horse_jump_step.py.How it was found: a diagnostic build (not in this PR) logged the jump decision, the controller, the animation layers and
the blend tree each frame around a jump. The jump starts the same way in good and bad jumps; the JumpReady blend weight
stayed under 0.01 at takeoff in the bad ones; a hardware watchpoint on it led to the blend node's interp frames, which read
animation variable 16, which the state machine writes in the branch above.
Measurements
Verdict: fixed. Every uncapped jump in the run after the fix cleared the fence with the jump animation (most slid through
before); the game-free test fails on
mainfor this bug and passes here.Hardware: CachyOS Linux (kernel 7.3), RTX 5090, NVIDIA 620.70.06
Scene: adult Link on Epona at fences; Game frame rate cap Uncapped (about 70-90 fps) and 60
Method:
tests/test_horse_jump_step.py(gcc and clang); in the game, a diagnostic build onmain's code logging theanimation variable the blend reads, then this branch played by hand
How to reproduce:
python -I -B tests/test_horse_jump_step.py; in the game, the steps aboveBaseline: measured on
main67efc4d3.mainis now50170f81, which adds only #1402 (the game's zstd decodes on thehost's libzstd); it touches none of the files or code this PR changes or reads. Rebased onto
50170f81locally, the testfails at the test commit and passes with the fix, and
tests/run_all.pygives the same 602 passed and the same 33failures: the numbers hold.
67efc4d3(with the test,dd5784ae)3293d6f7test_horse_jump_step.pyFlags and settings
None.
Testing
Tested:
tests/test_horse_jump_step.pywith gcc and clang: fails atdd5784ae(the test alone onmain), passes at3293d6f7; withthe new rule forced off the high-fps checks fail, forced on the slow-motion check fails.
python -I -B tests/run_all.py(Linux): 602 passed, 33 failed, 88 skipped (Vulkan and SPIR-V headers missing here). The33 also fail on
main67efc4d3, each run alone on both: test_bug_report_defaults, test_cpu_report, test_crt_options,test_damage_debug_menu, test_discover, test_display_startup_failure, test_dlss_feature_size,
test_failed_compile_keeps_objects, test_framegen_preset, test_guest_imported, test_hud_layout_row, test_invalidate_vcore,
test_lift_lookups, test_linux_preflight, test_linux_pressure, test_linux_update, test_mirror_budget, test_missing_nup,
test_mods_size_table, test_pending_guest_import, test_pipeline_play_cache, test_present_thread, test_profiling_mode,
test_readback_timeout_source, test_rumble_menu, test_run_all_changed, test_slow_frames, test_target_image_pool,
test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_walk, test_walk_key.
host/oot_high_fps.ccompiled alone (-fsyntax-only -Wall -Wextra, the build's include folders) with gcc and clang forLinux and with llvm-mingw clang (tools.lock's, 20261104) and MinGW gcc for Windows: no warnings, as on
main.71b1edd8(the lift reports"a horse's jump blend above 60 fps in code_040.c"). Riding Epona at fences uncapped (about 70-90 fps), every jump cleared
the fence with the jump animation; at a cap of 60 the jumps were as before.
Not tested:
machine; the game-free test covers slow motion above 60 fps.
Must be tested: None.
Risks
What could break: a horse's JumpReady blend above a 60 fps cap (Epona's, and any other horse's that uses this state
machine). A horse in slow motion above 60 fps keeps the game's branch only while its step is under the frame's by more
than 0.1%. At a cap of 60, and on frames slower than 60 fps, nothing changes: the host returns 0 and the game's own test
decides.
Turning it off: revert the commit, or a cap of 60.
Compatibility: Nothing changes for saves, options or caches; an update translates the game's code again, as for any
change to the lift's patches.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened. (None needed: the 27 checks thatread
host/oot_high_fps.*ornx2/oot_patches.py,test_high_fps_fixes.pyandtest_patch_hooks_defined.pyamongthem, pass unchanged.)
🤖 Generated with Claude Code
Tested in game: Linux (CachyOS, kernel 7.3), RTX 5090, NVIDIA 620.70.06; this branch as a dev pack over a base of
71b1edd8. Riding Epona at fences with the Game frame rate cap Uncapped (about 70-90 fps): every jump cleared the fence with the jump animation (on main most of them slid through at ground level). At a cap of 60 the jumps were as before.3293d6f7bbe04c08065aWIP: fix(fps): Epona jumps fences above a 60 fps capto fix(fps): Epona jumps fences above a 60 fps capMeasured on main
67efc4d3; main is now50170f81, which adds only #1402 (zstd decodes on the host's libzstd) and touches none of this PR's files. Rebased onto it locally: the new test fails at the test commit and passes with the fix, and run_all gives the same 602 passed and the same 33 failures as on main. The numbers hold; the Measurements section now says so.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.