feat(frame-pacer): overhaul logic and render FPS limits and presets#2699
feat(frame-pacer): overhaul logic and render FPS limits and presets#2699githubawn wants to merge 3 commits into
Conversation
- Added 15 FPS to render presets and expanded logic presets (1 to 960 FPS). - Implemented array-based preset snapping for logic FPS. - Renamed extraStep to snapValue for clarity. - Removed redundant logic speed scaling guards and safety asserts. - Cleaned up stale comments and dead code in CommandXlat.
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/Common/FrameRateLimit.h | Removed the StepFpsValue/MinFpsValue enum from LogicTimeScaleFpsPreset, replaced with array-based design; added optional snapValue params to all three public methods; moved s_fpsValues to private — clean interface change with no issues. |
| Core/GameEngine/Source/Common/FrameRateLimit.cpp | Added 15 to RenderFpsPreset array, introduced LogicTimeScaleFpsPreset::s_fpsValues (1–960, UncappedFpsValue), replaced linear step logic with ascending-array search + snap; edge cases (floor at 1, ceiling at UncappedFpsValue, value==snapValue, value between presets) all handled correctly. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp | Simplified changeLogicTimeScale: removed the remainder-ceiling math, passes maxRenderFps as snapValue, and only calls setLogicTimeScaleFps when actually enabling timescale so the last active FPS is preserved for sane re-enable — logic is correct for all capped/uncapped combinations. |
| GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp | Identical simplification to the Generals/ counterpart; both files are kept in sync correctly. |
Reviews (3): Last reviewed commit: "implemented feedback" | Re-trigger Greptile
xezon
left a comment
There was a problem hiding this comment.
My review is incomplete.
This change conflicts a bit with a change I have in the works where logic step can run faster than render update. I can only continue it after the particle decoupling.
This change should wait.
|
|
||
| const UnsignedInt RenderFpsPreset::s_fpsValues[] = { | ||
| 30, 50, 56, 60, 65, 70, 72, 75, 80, 85, 90, 100, 110, 120, 144, 240, 480, UncappedFpsValue }; | ||
| 15, 30, 50, 56, 60, 65, 70, 72, 75, 80, 85, 90, 100, 110, 120, 144, 240, 480, UncappedFpsValue }; |
There was a problem hiding this comment.
15 is not ok when LOGICFRAMES_PER_SECOND is 30, because it will halve multiplayer game speed for everyone. That is what the static assert was for.
| UnsignedInt LogicTimeScaleFpsPreset::getNextFpsValue(UnsignedInt value, UnsignedInt snapValue) | ||
| { | ||
| return value + StepFpsValue; | ||
| UnsignedInt nextValue = s_fpsValues[ARRAY_SIZE(s_fpsValues) - 1]; // Defaults to Uncapped |
There was a problem hiding this comment.
Can be simplified to = RenderFpsPreset::UncappedFpsValue
This change was generated with AI assistance. All generated code has been reviewed, tested, and verified for functionality.