Skip to content

feat(framepacer): decouple logic from render fps and default to 60 fps#172

Merged
fbraz3 merged 1 commit into
mainfrom
feat/60fps-decoupling
Jun 21, 2026
Merged

feat(framepacer): decouple logic from render fps and default to 60 fps#172
fbraz3 merged 1 commit into
mainfrom
feat/60fps-decoupling

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Description

This PR solves two key issues with our previous 60 FPS modernization:

  1. Game Speed Acceleration (Fast-Forward effect): By default, the simulation logic tick rate (30 Hz) was tied directly to the rendering FPS limit, causing the game to run at 200% speed on a 60 FPS cap. Enabling the logic time scale decouples them completely.
  2. SagePatch.ini Migration: Existing configurations previously stuck to 30 FPS because their existing SagePatch.ini was not updated. We now auto-migrate existing setups by appending the 60 FPS limit defaults if they are missing.
  3. Skirmish FPS slider: Redesigned the Skirmish menu options slider to control the rendering FPS cap directly (ranging from 30 FPS up to 120 FPS, with uncapped/-- limit for values over 120 FPS).

Changes

Core / Shared

  • FramePacer.cpp: Enabled m_enableLogicTimeScale = TRUE by default in the constructor so logic ticks at 30 Hz regardless of the render framerate.
  • GadgetSlider.h: Added GadgetSliderSetMinMax to dynamically override the slider boundaries.

Generals (Base) & Zero Hour (MD)

  • GlobalData.cpp: Set the default m_framesPerSecondLimit = 60 and m_useFpsLimit = TRUE.
  • GameEngine.cpp: Added an auto-migration check to read and inject 60 FPS defaults into existing SagePatch.ini setups, and updated the default template for fresh setups.
  • SkirmishGameOptionsMenu.cpp: Set up the "Game Speed" slider to act as an FPS limit slider with bounds 30 to 121 (where values > 120 represent uncapped --).

Verification

  • Both Zero Hour (z_generals) and base Generals (g_generals) targets successfully compiled on macos-vulkan preset.
  • Source changes were annotated using the standard format: // GeneralsX @tweak felipebraz 20/06/2026 ....

- Enable logic time scale (m_enableLogicTimeScale = TRUE) to decouple simulation tick rate (30 Hz) from the render framerate limit.
- Set default rendering FPS limit to 60 FPS in GlobalData and auto-generate/migrate SagePatch.ini to include the 60 FPS default limit.
- Redesign Skirmish options menu slider to range from 30 FPS up to 120 FPS, with any higher setting capping to uncapped (--).
@fbraz3 fbraz3 self-assigned this Jun 21, 2026
@fbraz3 fbraz3 merged commit fdfd824 into main Jun 21, 2026
8 checks passed
@fbraz3 fbraz3 deleted the feat/60fps-decoupling branch June 21, 2026 04:14
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