Skip to content

docs(engine): explain that the render FPS cap governs input responsiveness#235

Merged
fbraz3 merged 1 commit into
fbraz3:mainfrom
costin-alupului:docs/fps-cap-input-responsiveness
Jul 24, 2026
Merged

docs(engine): explain that the render FPS cap governs input responsiveness#235
fbraz3 merged 1 commit into
fbraz3:mainfrom
costin-alupului:docs/fps-cap-input-responsiveness

Conversation

@costin-alupului

Copy link
Copy Markdown

Summary

Documentation-only. Adds comments at two authoritative sites explaining that the render FPS Limit cap is not a game-speed control: game logic always runs at a fixed 30 Hz (LOGICFRAMES_PER_SECOND), but because the main loop services input once per render frame and FramePacer::update() sleeps to hold the cap, the cap also sets the input sampling rate. A low cap (e.g. 30) makes the mouse feel laggy and moving units hard to click, while the simulation speed is unchanged.

Sites commented: the FPS preset table in FrameRateLimit.cpp and the pacing wait in GameEngine::execute().

Rationale

This surprised a macOS user (#231) who had lowered "Game Speed" to 30 as a workaround for an unrelated older bug, then experienced it as a "mouse input is delayed" problem — leading to a long investigation. A Metal System Trace confirmed display latency was ~12 ms (not the cause); the real cause was input-per-frame throttled by the 30 FPS cap. These comments should prevent re-diagnosis.

No behavior change. 19 lines, comments only.

Relates to #231

AI assistance disclosure

Per CONTRIBUTING: the comment wording was drafted with AI assistance (Claude) and reviewed/verified by me against the code paths described. No functional code was generated or changed.

…eness

The "FPS Limit" render cap (RenderFpsPreset / GlobalData::m_framesPerSecondLimit)
is easy to mistake for a game-speed control. It is not: game logic always runs at
a fixed LOGICFRAMES_PER_SECOND (30 Hz). But because the main loop services input
(SDL poll + GameClient::UPDATE message processing) once per render frame and then
FramePacer::update() sleeps to hold the cap, the cap also sets the input sampling
rate. A low cap (e.g. 30) makes the mouse feel laggy and moving units hard to
click, while the simulation speed is unchanged.

Adds documentation-only comments at the two authoritative sites (the FPS preset
table in FrameRateLimit.cpp and the pacing wait in GameEngine::execute) so future
readers do not re-diagnose this as an input/display-latency bug.

Relates to fbraz3#231

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@fbraz3
fbraz3 merged commit 1698fbf into fbraz3:main Jul 24, 2026
8 checks passed
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.

2 participants