Skip to content

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
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/phase-preserving-limiter
Open

tintinhamans wants to merge 2 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/phase-preserving-limiter

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Oct 23, 2026 •

Copy link
Copy Markdown

FrameRateLimit::wait restarts 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. FrameRateLimit is the same upstream, so this goes there too.

The render frame rate limit was kept in settings.json (render.limit_framerate and render.fps_limit) and only applied to online matches. It is now RenderFpsLimit in Options.ini, which the render rate hotkeys write as well. An old value is moved over once, unless Options.ini already 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. -noFPSLimit now 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 FPS pref 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_generals builds.

@tintinhamans
tintinhamans force-pushed the arctic/go/fix/phase-preserving-limiter branch from 2b9720f to b90d816 Compare October 24, 2026 12:26
@tintinhamans tintinhamans changed the title fix(render): Preserve frame limiter deadlines so a 60 fps cap runs at 60 fix(render): Keep a 60 fps cap at 60 and apply the Options.ini render limit in every game Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant