Skip to content

FPS counter adjustments#21209

Merged
PunkPun merged 3 commits into
OpenRA:bleedfrom
RoosterDragon:fps
Nov 15, 2023
Merged

FPS counter adjustments#21209
PunkPun merged 3 commits into
OpenRA:bleedfrom
RoosterDragon:fps

Conversation

@RoosterDragon

Copy link
Copy Markdown
Member

First commit fixes #17445.

Second commit switches to a rolling average of frames over the last second, rather than the current once-a-second snapshot of frames in the prior second. Let me know if this is worth keeping.


Fix FPS counter showing initial high figure.

When the widget is created, use the current frame as reference rather than always using zero. That avoids the first FPS reading from a new widget calculating as if all frames rendered since the game started occurred in the first second.


Change FPS counter behaviour.

Calculate a rolling average of FPS over the last second. This allows the FPS counter to be updated every frame - and in particular means it can display a rough figure immediately rather than needing to wait one second to collect information at the start of a game.

When the widget is created, use the current frame as reference rather than always using zero. That avoids the first FPS reading from a new widget calculating as if all frames rendered since the game started occurred in the first second.
Calculate a rolling average of FPS over the last second. This allows the FPS counter to be updated every frame - and in particular means it can display a rough figure immediately rather than needing to wait one second to collect information at the start of a game.
This avoids this displayed counter being dragged down by lower FPS during loading prior to the game starting.

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@PunkPun PunkPun merged commit 399cef8 into OpenRA:bleed Nov 15, 2023
@PunkPun

PunkPun commented Nov 15, 2023

Copy link
Copy Markdown
Member

Changelog

@RoosterDragon RoosterDragon deleted the fps branch November 15, 2023 17:37
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.

Frame counter doesn't count properly during/after load screen

2 participants