Skip to content

fix(render): Preserve frame limiter deadlines so a 60 fps cap runs at 60 - #647

Open
tintinhamans wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/phase-preserving-limiter
Open

tintinhamans wants to merge 1 commit 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 up, so a frame that runs over the period loses that time for good. In network games the logic runs at most one frame per render pass, so at the 60 cap the logic slows down with it, and Network::timeForNewFrame throws the time away once it is a frame behind.

The next deadline is now the previous one plus a period. Lateness is made up on the next frames, pauses longer than a period are dropped instead of banked.

Two clients at a 60 cap with logic at 60, 3 runs each:

  • steady ~15 ms frames: 59.86 → 59.96 logic fps, schedule resets 11.8 → 1.5 per 10 s
  • uneven frames (8/22 ms, some over the period): 49.2 → 58.4 logic fps

CRC matched in all runs. FrameRateLimit is the same upstream, so this goes there too.

@tintinhamans
tintinhamans force-pushed the arctic/go/fix/phase-preserving-limiter branch from 2b9720f to b90d816 Compare October 24, 2026 12:26
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