Repository navigation
fix(vi): the time of day passes again above a 60 fps cap - #2093
Conversation
Joey-Magnus
left a comment
There was a problem hiding this comment.
This isn't on main yet (f_803edf70 isn't in WHOLE_SITES), and it doesn't overlap #2470. That draft handles the sound job, the physics solver steps and the quick menu, and doesn't touch the clock or WHOLE_SITES, so the two only meet as nearby text in nx2/oot_patches.py and host/nn_vi.c.
With #2006 merged, the conflict is small but has to be resolved by hand. #2409 (water ripples) added f_800672e0 to WHOLE_SITES and its comment list, and raised FRAME_WHOLE_SLOTS in host/frame_whole.h from 16 to 64 (each water surface takes a slot). Keep both sites and main's 64 slots and slot comment: going back to 16 would bring the ripple freeze back in busy scenes. tests/test_frame_whole.py is an add/add conflict, so merge your rate and minutes-cut checks into main's version rather than replacing it. apply() in oot_patches.py also picked up heap_sites from #2451, so that hunk should keep main's line. After the rebase, hckrman101's approval should still hold, as long as the warning count in nn_vi.c includes both new sites.
7bc9019 to
087ba5d
Compare
|
Rebased onto main (8568959): the PR is now its one commit (087ba5d).
|
f_803edf70 adds (int)(2 * step) game seconds to the time of day each frame. Above a 60 cap the step is the frame's own time: below 120 fps the cut is 1 (the day slow, 83% at 100) and above it 0, so the clock stood still and the sun swung back and forth over the frozen hour. The cut takes hos_frame_whole's whole seconds like the pick-up counter (NotRexed#2006). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Above a Frame rate cap of 60, the time of day runs slow and above 120 fps it stops: the sun swings back and forth over a frozen hour. This is another of the above-60 side effects tracked in #1742.
Builds on #2006 (merged): it adds a site to that PR's
hos_frame_wholetable, next to #2409's water ripples. Rebased onto main, so it is one commit.Cause
Since #1612, above a 60 cap the game's frame step is the frame's own time (0.42 at 144 fps instead of 1).
The time of day is kept by
f_803edf70:(int)(2 * step)game seconds (+60) to the seconds of the day (+40). At 86400 those wrap and carry into the day count (+44).Fix
f_803edf70joinsWHOLE_SITESinnx2/oot_patches.py. Its cut goes throughhos_frame_whole, keyed by the clock's+60. Above a 60 cap that carries the fraction between frames, so the clock gains its 120 game seconds per real second at any frame rate.x8a second time, in the branch that sets the time from another source. So the anchor is the cut plus the store to+60after it, and the other cut is left alone (a test covers this).How it was found
Tests
tests/test_frame_whole.py:2 × 60/144make 120 seconds, a real second's worth at 60.x8, in the branch that sets the time from another source, is left as the game's.python -I -B tests/run_all.pyafter the rebase onto 8568959: 404 passed, 13 failed. All 13 fail the same way on a clean checkout of that main on this PC (which fails two more besides), so none come from this PR.🤖 Generated with Claude Code