-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Change frame stable catch-up method to allow for much faster sync #26600
Conversation
private void createStabilityContainer(double gameplayStartTime = double.MinValue) => AddStep("create container", () => | ||
mainContainer.Child = new FrameStabilityContainer(gameplayStartTime) { MaxCatchUpFrames = max_frames_catchup } | ||
mainContainer.Child = new FrameStabilityContainer(gameplayStartTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stress tested both tests which had custom overrides and they still pass. For whatever that's worth.
{ | ||
MaxCatchUpFrames = 1 | ||
} | ||
Child = frameStabilityContainer = new FrameStabilityContainer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to look at exactly why this was limiting to one frame just to be certain though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just done for visual testing purposes (to actually show the game catching up in the test scene). I've added back a Thread.Sleep
to make this still look correct.
/// </summary> | ||
public int MaxCatchUpFrames { get; set; } = 5; | ||
private const double max_catchup_milliseconds = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value is just a ballpark good place to be. The game should always maintain at least 60 fps, and this will give enough headroom to allow that.
Probably closes #5119? |
Yeah maybe. There's still more I want to do, but it's a good improvement. |
5295eb6
to
fb4efd9
Compare
Especially noticeable on single-threaded mode (hello macOS).
Before:
2024-01-18.02.24.19.mp4
After:
2024-01-18.02.23.19.mp4
Closes #5119.