WIP: fix(fps): the frozen Zoras stand still above a 60 fps cap #1444
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1444
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/frozen-zora-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: Windows 10, RTX 4090 · Needs: none
Why
The frozen Zoras under the ice in Zora's Domain (the big pond in the first cavern, as the adult) are meant to stand still. With the Game frame rate cap above 60 they twitch back and forth instead; at a cap of 60 they are completely still. Fixes #988.
How to reproduce
Seen on: Windows 10, RTX 4090, NVIDIA driver 32.0.16.1742
Settings and switches: Game frame rate cap Uncapped (about 110 fps in the scene), Render resolution 50%, otherwise defaults
Steps: load a save as the adult, go to Zora's Domain, walk to the first cavern's pond and look at the frozen Zoras under the ice (about [17-24, 100, -7..0])
Expected: the Zoras stand still, as at a cap of 60
Actual: on main they vibrate; set the cap to 60 and they stop
What changed
A loop of one frame (the Zoras: start 0, end 1) is one pose. At 60 fps the clock's step is 1, so every update lands on the same phase. Above 60 the step is the frame's own time (0.36 at 165 fps); the phase moved by it each frame and wrapped, so each frame drew another phase of the loop. The change keeps a loop of one frame or less on whole frames above 60, and leaves longer loops and a cap of 60 as they are.
nx2/oot_patches.py:patch_loop_stepspatches the two clock advances off_802cfca0(each animation entry's time +4, start +16, end +20) to take the step fromhos_loop_step;patch_loop_posepatches the one store of the skeleton's drawn time inf_80944aa0(the value +0 and the range it is kept in +4, +8) tohos_loop_pose. Both leave a file whose code differs, or that is patched already, as it is.host/loop_step.h: the logic.loop_stephands out whole frames of the step for an entry whose loop is one frame or less (end > start,end - start <= 1), the fractions carried per entry (4096 slots found by address);loop_posereturns the loop's start for such a range. Both do nothing at a cap of 60.host/nn_vi.c:hos_loop_stepandhos_loop_pose, the entry points the patches call; the lock is taken only for a loop of one frame or less.tests/test_loop_step.py: the game-free test.README.md: one line next to the known above-60 notes.docs/tested/: one file for each run below.Measurements
Verdict: the Zoras twitch on main Uncapped and stand still with this change at the same frame rate, by eye; nothing else in the room looked different. A GIF of 24 consecutive shots of each build is in the comment of 2026-11-17 18:09, with the change of the area beside Link measured on them (table); the game-free test below holds the phase of the loop over a second at 165 fps.
Baseline: main
e090cc48is the dev base the pack was built over; the After build (a pack over it) carried all of main up to this branch, main50170f81included (zstd decodes, the switch table, perf summaries: nothing in the animation or step code), so the Before and After differ by this change.Hardware: Windows 10 Pro, RTX 4090, driver 32.0.16.1742, i9-13900K, 32 GB
Scene: adult Zora's Domain, the frozen Zoras about 10 units away; Render resolution 50%, Frame rate cap Uncapped
Method: looked at by eye through the game's window,
scripts/longshot_ctl.py launch --profile default,teleport 13and a walk to the pond; no forced stepHow to reproduce: as above
e090cc48ca4f19bdThe test (
python -I -B tests/test_loop_step.py), on the test commit alone (Before: main @e592609f, the fix not in the tree) and on the branch (After: this PR @ca4f19bd):Flags and settings
None.
Testing
Tested:
tests/test_loop_step.pycompiles the production patches on authored updates and the realhost/loop_step.h, and holds: a loop of one frame stays on one phase at 165 fps (both clock sites, two entries in turn each keeping their own phase), a loop from 2 to 3 is a pose too, a loop of a frame and a half and a loop of 1000 frames keep the fractional step, a cap of 60 and a paused clock are as the game has them, the drawn time is the start only for a loop of one frame or less. It fails on main (above) and fails on six deliberately broken fixes (no whole frames, the pose left as the time, the cap of 60 ignored in either function, long loops made whole, the second clock site not patched). The patches are idempotent and leave an unrelated authored function alone.python -I -B tests/run_all.pyon this branch and on main50170f81, the same PC: the same 44 checks fail on both (a missing clang, Vulkan headers and the like on this WSL); this branch addstest_loop_step(passes).test_xess_rulestimed out in the first branch run while the game was running at the same time, and passes alone.ca4f19bd(every patch applied: the lift log shows "2 animation clock(s) with whole frames for a loop of one frame in code_002.c" and "the drawn time of a loop of one frame by its start in code_008.c") against maine090cc48, adult Zora's Domain, Uncapped at about 110 fps: main twitches, this stands still (table above).Not tested: Linux, AMD or Intel; other scenes with a loop of one frame or less (the change applies to every skeleton whose animation clock or drawn-time range is one frame or less above a cap of 60, which at 60 fps stands on one phase too, so those should only match 60 fps; Zora's Domain is the only place looked at); caps other than Uncapped above 60.
Must be tested: None. (Optional, other hardware: adult Zora's Domain, first cavern pond, Frame rate cap Uncapped or 144 with the frame rate above 60, looking at the frozen Zoras under the ice: they should stand still.)
Risks
What could break: a skeleton whose animation is meant to move within a range of one frame or less would stand still above 60, as it already does at 60 fps (step 1 lands on one phase there). Nothing else is touched: longer loops and a cap of 60 take the game's own step and time.
Turning it off: revert the commit; a cap of 60 never takes the new path.
Compatibility: nothing changes for saves,
longshot_options.ini, the shader and pipeline caches or the vk ABI; the lifted game is lifted again with the two patches.Issues
Fixes #988
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main(50170f81).python -I -B tests/run_all.pypasses (any failure that also fails onmainis named): the same 44 checks fail on main, named above.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.e090cc48) beside this PR (After: this PR @ca4f19bd), in the comment of 2026-11-17 18:09.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.host/loop_step.his plain C and is compiled by gcc on Linux in the test;host/nn_vi.cwas not built on Linux (its new lock is the sameSRWLOCKuse ashos_frame_wholebeside it).🤖 Generated with Claude Code
https://claude.ai/code/session_01VxeaZkHkexryjX95trtxhH
Tested in game: Windows 10 Pro, RTX 4090, NVIDIA driver 32.0.16.1742: adult Zora's Domain, the frozen Zoras under the first cavern's pond, Frame rate cap Uncapped at about 110 fps. main
e090cc48: they twitch (still at a cap of 60); this branch's code (ca4f19bd, built as a pack, no probes): they stand still and nothing else in the room looked different. Both watched by eye.@Beanstalk linux: please build this PR on Linux (host/nn_vi.c and the new host/loop_step.h are the host code it changes; the PR's Linux-build box waits on this) and, if the farm can run the game, look at the frozen Zoras in adult Zora's Domain (under the ice of the first cavern's pond) with the Game frame rate cap Uncapped or 144 and the frame rate above 60: they should stand still (on main they vibrate).
@cuecuemoar only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.The frozen Zoras on consecutive frames, Uncapped (about 115 fps), the same spot in adult Zora's Domain on each build (Link at about [18.9, 100.0, -7.9] on main and [18.8, 100.0, -7.0] on this PR). Left: Before: main @
e090cc48. Right: After: this PR @ca4f19bd.How it was made: 24 shots from the control bridge, each the first present after the last one's frame (4 presents apart, about 35 ms, so the GIF at 8 fps is about 3.5 times slower than the game), cropped beside Link and shown with one fixed contrast stretch for both builds (the ice is murky from above, and a per-frame stretch would flicker by itself). Link's idle animation moves on both.
Measured over the same 24 shots, in a 240 by 290 pixel window beside Link (where the Zoras are; 1920x1080 window, Render resolution 50%):
e090cc48ca4f19bdBrought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.