Skip to content

feat(savegames): Use frame rate from skirmish settings as max frame rate after loading a save game #1416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Caball009
Copy link

@Caball009 Caball009 commented Aug 3, 2025

Loaded skirmish (and mission) save games play at the default frame rate. This ignores whatever frame rate they were started with, and it ignores the current frame rate (the value of Game Speed) in the skirmish menu. This PR uses the latter value as max frame rate when loading save games.

TODO:

  • Replicate in Generals.

@Caball009 Caball009 added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Aug 3, 2025
@Caball009
Copy link
Author

Game Speed "--" appears to use a frame rate value of 61. Maybe there should be a check that turns that into 1000.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we should do that. I think the frame rate stuff needs a good look overall.

I think the first course of action is decoupling Render frame rate from engine update rate, unless there are issues. I started looking into that and have a rough plan how to do that and started implementing some things for it.

And then make the Render frame rate and Engine update rate customizable everywhere (except Engine update rate in Multiplayer).

@@ -675,6 +676,10 @@ SaveCode GameState::loadGame( AvailableGameInfo gameInfo )
// clear out the game engine
TheGameEngine->reset();

// TheSuperHackers @tweak Caball009 03/08/2025 Use the fps preference from the skirmish settings as fps limit after game engine reset.
if (gameInfo.saveGameInfo.saveFileType != SAVE_FILE_TYPE_MISSION)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this condition necessary?

@@ -675,6 +676,10 @@ SaveCode GameState::loadGame( AvailableGameInfo gameInfo )
// clear out the game engine
TheGameEngine->reset();

// TheSuperHackers @tweak Caball009 03/08/2025 Use the fps preference from the skirmish settings as fps limit after game engine reset.
if (gameInfo.saveGameInfo.saveFileType != SAVE_FILE_TYPE_MISSION)
TheGameEngine->setFramesPerSecondLimit(SkirmishPreferences().getInt("FPS", TheGlobalData->m_framesPerSecondLimit));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the SkirmishPreferences will be applied when loading a Campaign Mission savegame?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but only to manual save games, not automatic save games ("Mission Start").

@Caball009
Copy link
Author

I am not sure if we should do that. I think the frame rate stuff needs a good look overall.

I think the first course of action is decoupling Render frame rate from engine update rate, unless there are issues. I started looking into that and have a rough plan how to do that and started implementing some things for it.

And then make the Render frame rate and Engine update rate customizable everywhere (except Engine update rate in Multiplayer).

That sounds reasonable. We could hold off on this PR if the above is implemented in the not-too-distant future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Is new feature or request Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't use the default framerate for loaded save games Loading save applies game speed setting from skirmish menu
2 participants