Repository navigation
fix(render): Keep a 60 fps cap at 60 and apply the Options.ini render limit in every game - #647
Open
tintinhamans wants to merge 2 commits into
Conversation
tintinhamans
force-pushed
the
arctic/go/fix/phase-preserving-limiter
branch
from
October 24, 2026 12:26
2b9720f to
b90d816
Compare
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.
FrameRateLimit::waitrestarts its period when it wakes, so a late frame loses that time for good. In network games the logic then runs below the 60 cap. The next deadline is now the previous one plus a period, so lateness is made up and pauses longer than a period are dropped. When there is no time left to sleep it also yields once per frame (Sleep(0)).Tested with two clients at a 60 cap: steady frames 59.86 to 59.96 logic fps, uneven frames 49.2 to 58.4, CRC matched.
FrameRateLimitis the same upstream, so this goes there too.The render frame rate limit was kept in
settings.json(render.limit_framerateandrender.fps_limit) and only applied to online matches. It is nowRenderFpsLimitinOptions.ini, which the render rate hotkeys write as well. An old value is moved over once, unlessOptions.inialready has one, and a value below 60 is raised to 60. It applies in every game (online, LAN, skirmish, campaign, replay), and menus and the shellmap stay capped at 60.-noFPSLimitnow means uncapped. An uncapped limit in a window renders at the refresh rate of the monitor the window is on (60 if unknown), read again every second and after the window moved or the display changed, since presenting faster only floods the GPU and the desktop compositor. Exclusive full screen stays uncapped. Without focus the limit drops to 60, but never below the logic rate.Offline, the game speed no longer follows the render rate: the logic time scale is on from startup (the approach of TheSuperHackers#2903), so the simulation stays at 60 logic frames per second at any render limit, and the logic time scale hotkey no longer turns the setting off. The skirmish game speed slider now runs from 30 to 120 logic frames per second in steps of 2 (60 is normal, the last position is unlimited), and still saves the
FPSpref in retail units (half of that, 61 for unlimited), so retail reads the same file. Scripted FPS limits stay in retail units and are doubled. Both set the logic rate instead of the render limit, and a restart keeps the chosen speed. A game speed above the render limit raises the render rate to it. Network games still run on the network frame rate.Tested:
z_generalsbuilds.