fix(fps): a backflip's takeoff rises as at 60 fps above a 60 cap (HOS_FPS_TAKEOFF) #2071
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2071
Loading…
Reference in a new issue
No description provided.
Delete branch "GummiNaomi/Longshot:fix/downhill-contact-fps"
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?
Summary
Above a Frame rate cap of 60, a backflip down a slope took off twice and carried Link about 24 % farther (2.77-2.86 m against
2.25 m in Hyrule Field).
f_80b97d10computes a jump's takeoff speed andf_804f5030hands Havok Link's body that speed on thetakeoff's update (the world's set-velocity call). On a backflip the next update hands no vertical speed, so the body hops by one
step of the takeoff speed: 6.4 cm at 60 fps, 4.2 cm at 94. From the lower hop he met the slope at 0.1 s, the controller landed
and the backflip took off again. Now
f_80b97d10hands the speed to the host, and right before the set-velocity call a bodyhanded the takeoff speed in the takeoff's own update is watched: when the next update asks it for no vertical speed, that
update gets the rest of a 60 fps takeoff step's rise, above a 60 cap on a frame shorter than a 60 fps one. A body the game
keeps raising (a side hop) already rises as at 60 under the variable step and is left as it is. A cap of 60 is unchanged.
Read first:
oot_takeoff_matchandoot_takeoff_rest_speedinhost/oot_high_fps.h(the rule and why),patch_jump_speedand
patch_takeoff_velocityinnx2/oot_patches.py, thentests/test_jump_takeoff_step.py.See #1740 (the same function's driven bodies; left as it is).
Testing
Tested: Windows 11 Pro 26200, RTX 4070 SUPER, Ryzen 9 9950X3D with SMT off: a build of main @
e6196f0fwith this change,the movement probe (control bridge,
kokiri-startsave) at cap 60 and Uncapped (109-110 fps), a verify run and two launcheswith the change, two with
HOS_FPS_TAKEOFF=0: Hyrule Field (run, roll, two side hops, backflip down a slope, a run down it),Kakariko's steps up and down, the Market; 0 errors in the logs. The commit was then moved onto main @
9dd41326with no conflict(the same patch; main's 8 newer commits do not touch these functions, and #1905 leaves the lifted functions' C text as it was):
the slope measurements are from the
e6196f0fbuild; this head was built and played later, in the move probe below, andthe checks below ran on it.
Adult Link and the other moves (21 Nov, a move probe with the same setup, cap 60 and Uncapped 99-120 fps in each launch, two
launches a build): this head, built on main @
9dd41326, against main @66dc0a51. The adult backflip has the child's bug on main(its first hop above 60 is 2 cm against 5 cm at 60, and it lands 4 % short, 2.25 / 2.27 m against 2.36 m, with one takeoff
from this spot); on this head the hop above 60 is 5-6 cm, as at 60. The other moves the repository's saves reach move as at
60 on both builds: the camera (right stick 108.6-108.8 deg/s, recentred on Z in 0.24-0.26 s), the Z sidestep and backpedal
(within 1 %), Death Mountain Trail up and down (within 0.5 %), running off the Goron City ledge (a plain fall, 4.46-4.51 m
along at landing at both caps), the adult run.
Checks (Windows, clang, no gcc here), each also run on main @
9dd41326:tests/run_all.py --changedpicks 73 checks: 32pass, 14 fail, 27 skip. The 22 skipped for gcc or g++ alone ran by hand with
--cc clang/--cxx clang++(-lmdropped: nom.libwith theWindows runtime): 19 pass,
tests/test_jump_takeoff_step.pyandtest_drive_targetamong them,test_gpu_clockskipsitself,
test_song_note_cueandtest_text_sizedo not compile with clang, as on main. The 14 fail the same way on main:test_bc_small_scratch,test_crash_dialog,test_dev_ab,test_dev_packs,test_frame_overlap,test_frame_whole,test_high_fps_fixes,test_lift_cache,test_linux_pressure,test_oot_cloth_60,test_oot_cloth_time,test_quick_pipelines,test_texture_ahead,test_water_substeps. On main's lifttests/test_jump_takeoff_step.py's94 fps case fails (4.2 cm against 6.6).
mise run test: not run whole (no mise here).Still to test:
attack and running off a ledge, then at a 60 cap, expecting no crash or hang and frame times as main's (Test Farm:
@Beanstalk linux, asked in a comment; its planner can't time the jumps themselves, run game-free tests or measure where
Link lands, and offers the movement with a backflip, uncapped and at 60, with frame times measured after: that plan
waits for a BigBean's
@Beanstalk test it anyway)tests/test_jump_takeoff_step.py, expecting PASS (by hand; CI's Python checks run only when started byhand)
them as at 60 (by hand)
Measurements
Verdict: one takeoff and within 5 % of 60's distance above 60 fps (was two and +20-24 %); side hops as before; 60 unchanged.
Setup: Windows 11 Pro 26200, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off; one build of main @
e6196f0fwiththis change (the same patch as this head), headless with the control bridge and the movement probe (Link's position streamed
every frame),
kokiri-startsave; the Before column is that build withHOS_FPS_TAKEOFF=0(the game's own speed, as main);cap 60 and Uncapped (108.8-109.7 fps) in each launch, two launches a side, the sides interleaved. Distances from Link's
position at the takeoff; the paths are his position every 50 ms against the same launch's cap 60 block, the mean.
e6196f0f(HOS_FPS_TAKEOFF=0)a0e9b5eb(built one6196f0f)66dc0a51)9dd41326)HOS_FPS_TAKEOFF(new, a kill switch) ships on;=0brings the game's speed back.Risks
A jump through
f_80b97d10whose next update asks no vertical speed now rises in its first two updates as at 60 above a 60cap; a jump the game keeps raising is unchanged.
f_804f5030calls the host once a body an update; it returns at once unless atakeoff is in its 50 ms, and then keeps at most 8 bodies under a lock. Turning it off:
HOS_FPS_TAKEOFF=0. After updating:nothing changes for saves,
longshot_options.inior the caches.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Not run whole; the changed-file checks as Testing says, each failure also fails on main.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.tests/that reads changed source is updated, not weakened. (None needed a change; Testing says whichran.)
someone else.)
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
@Beanstalk Linux, a desktop PC that runs well above 60 fps (not the Steam Deck): this PR against main, two runs a side. In Hyrule Field as a child (HyruleField_Child), with the Frame rate cap off (unlimited), play the jumps that go through the changed takeoff code, each three times with a second's pause between: a backflip down a slope (hold Z-target, then the stick back + A), a side hop each way (Z-target held, the stick left or right + A), a jump attack if the save has a sword (Z-target + A), and running off a ledge. Then the same at a 60 cap. Measure frame times over the jumps.
Fail on a crash or a hang, or frame times (p99) more than 10 % above main's. Upload a picture right after the first backflip lands on each side, not compared with main: above 60, main's backflip takes off a second time and carries Link about 0.5 m farther, so the pictures are expected to differ.
HOS_FPS_TAKEOFFis this PR's new switch (on by default;=0is the game's own speed); it logs no value line.Beanstalk test farm · ⛔ can't be tested as asked
Commit
a0e9b5e· approved by GummiNaomi (untrusted) · dashboardNot run: the farm can't test this as asked, so nothing is built or run:
⚠️ Note: The discrete-GPU tag is only a desktop proxy; it does not guarantee a non-Steam-Deck PC or performance well above 60 fps.
⚠️ Note: The alternative does not perform all requested jumps or verify that its picture follows a backflip landing; the save does not establish sword ownership.
⚠️ Note: The farm cannot run the separate GCC unit test or measure Link's landing position.
What it could test instead: The alternative plan builds main and the PR on a Linux discrete-GPU PC, then exercises movement in child Hyrule Field at uncapped and 60 fps, with two runs per side. It records an unpaired picture after an attempted backflip and compares p99 frame time in a subsequent stationary segment; a crash, hang, or p99 increase over 10% fails. The lift builds are also timed. This alternative cannot establish the requested jump-frame performance or landing behavior.
A member of
BigBeanscan comment@Beanstalk <new words>to ask for something else, or@Beanstalk test it anywayto run the plan regardless.Measured: adult Link and the other moves above 60 (21 Nov)
A move probe (control bridge,
kokiri-startsave, headless; Windows 11 Pro 26200, RTX 4070 SUPER, Ryzen 9 9950X3D with SMToff), cap 60 and Uncapped (99-120 fps) in each launch, two launches a build, the cap order swapped in the second: this head
a0e9b5ebbuilt on main @9dd41326, against main @66dc0a51. Adult Link from the Debug tab's age switch, at the Hyrule Fieldspot of the slope runs.
66dc0a51a0e9b5ebSo the adult backflip has the child's bug on main (from the same spot it lands 4 % short above 60, 2.25 / 2.27 m against
2.36 m, with one takeoff), and this change restores its first hop. Its distance on this head was not measured from the same
spot: the adult side hops before it branch at both caps (the first one 4.1 or 1.8 m), so the backflip started elsewhere.
The other moves the repository's saves reach move as at 60 on both builds: the camera turned by the right stick (108.6-108.8
deg/s) and recentred on Z (0.24-0.26 s), the Z sidestep right and left and the Z backpedal (within 1 %), Death Mountain Trail
up and down (within 0.5 %), running off the Goron City ledge (a plain fall, no hop: 4.46-4.51 m along at landing at both
caps), the adult run. The description's Tested, Measurements and Still to test are updated; a jump attack and the horse stay
by hand (no sword or horse in the repository's saves).