Add a frame statistics achievement.

This commit is contained in:
Bartosz Taudul
2026-11-02 00:59:04 +01:00
parent 000ae58203
commit d3fcf981c9
4 changed files with 26 additions and 2 deletions
+1
View File
@@ -217,6 +217,7 @@ Embed(PROFILER_FILES TextCpuData src/achievements/CpuData.md TEXT)
Embed(PROFILER_FILES TextEntryStacks src/achievements/EntryStacks.md TEXT)
Embed(PROFILER_FILES TextFindZone src/achievements/FindZone.md TEXT)
Embed(PROFILER_FILES TextFrameImages src/achievements/FrameImages.md TEXT)
Embed(PROFILER_FILES TextFrameStatistics src/achievements/FrameStatistics.md TEXT)
Embed(PROFILER_FILES TextGhostZones src/achievements/GhostZones.md TEXT)
Embed(PROFILER_FILES TextGlobalSettings src/achievements/GlobalSettings.md TEXT)
Embed(PROFILER_FILES TextGpu src/achievements/Gpu.md TEXT)
@@ -0,0 +1,12 @@
# Frame statistics
The [frame time graph](#frametimegraph) shows frames in time order: pick a slow frame, see it took 90 ms, zoom in, find what caused it. It cannot tell you whether 90 ms happens to one frame in a thousand or to one in twenty, and that decides whether you have a problem at all.
The [Frame statistics window](#framestatistics) draws a histogram instead: each bar is a span of frame times, and its height is how many frames landed inside. The mean hides what matters: a program that runs its usual frame in 16 ms but stalls 200 ms once per second still reports a healthy average, while the player swears the game is stuttering. The percentiles show how long the *slow* frames actually ran. P99, for example, is the time ninety-nine of a hundred frames finished under.
> [!TIP]
> **Tip**
>
> Hover a frame on the frame time graph and the histogram pulses a line at the bar containing it, so you can tell at a glance whether that stall was typical.
Try clicking the * Frame statistics* button in the * Tools* menu and see what your frame times really look like.
+12 -2
View File
@@ -14,6 +14,7 @@
#include "data/TextEntryStacks.hpp"
#include "data/TextFindZone.hpp"
#include "data/TextFrameImages.hpp"
#include "data/TextFrameStatistics.hpp"
#include "data/TextGhostZones.hpp"
#include "data/TextGlobalSettings.hpp"
#include "data/TextGpu.hpp"
@@ -208,7 +209,13 @@ AchievementItem ai_lightFlame = {
.text = Unpack( TextLightFlame )
};
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, &ai_lightFlame, nullptr };
AchievementItem ai_frameStats = {
.id = "frameStats",
.name = "Frame statistics",
.text = Unpack( TextFrameStatistics )
};
AchievementItem* ac_inspectZoneItems[] = { &ai_findZone, &ai_readSource, &ai_lightFlame, &ai_frameStats, nullptr };
AchievementItem ai_inspectZone = {
.id = "inspectZone",
@@ -277,10 +284,13 @@ AchievementItem ai_frameImages = {
.text = Unpack( TextFrameImages )
};
AchievementItem* ac_addFrameSetsUnlock[] = { &ai_frameStats, nullptr };
AchievementItem ai_addFrameSets = {
.id = "addFrameSets",
.name = "Add frame sets",
.text = Unpack( TextAddFrameSets )
.text = Unpack( TextAddFrameSets ),
.unlocks = ac_addFrameSetsUnlock
};
AchievementItem* ac_instrumentFramesItems[] = {
+1
View File
@@ -1011,6 +1011,7 @@ bool View::DrawImpl()
}
if( ButtonDisablable( ICON_FA_IMAGES " Frame statistics", !m_worker.AreFramesUsed() ) )
{
if( s_config.achievements ) Achieve( "frameStats" );
m_showFrameStatistics = true;
}
ImGui::EndPopup();