How-To: Performance Stats on the HUD

Goal: let the player pick which performance stats (FPS, frame time, ping, ...) a HUD readout shows.

Not shipped by this plugin
CrimsonSettings does not ship a performance-stats page: the stat list and the HUD readout belong to your UI, and this plugin stays independent of it. You add the page yourself with the building blocks below.

1. Store the choice

Keep the per-stat choice in your own settings object (a UGameUserSettings subclass or a config = GameUserSettings UObject), with a getter, a setter and a change event your HUD binds.

2. Add one discrete row per stat

In your UCrimsonSettingRegistry subclass, build a discrete setting per stat whose options read and write your store, and add it under the collection of your choice with RegisterSettingInParent (C++) or Register Setting In Parent (K2_RegisterSettingInParent, Blueprint).

Verify
The rows appear on the page you chose; changing one updates your store and your HUD readout rebuilds from the change event. Settings are local: in Play As Client each client keeps its own choice.
(CrimsonCore - requires all Crimson plugins)
CrimsonCore ships this page prebuilt: UCrimsonCorePerfStatSettingsLibrary::AddPerformanceStatsPage(Registry, ParentCollection) adds the eighteen rows under Video -> Display, UCrimsonCorePerfStatUserSettings stores the choice, and UCrimsonCorePerfStatSettings (Project Settings) lists which stats each platform offers.

See also

  • How-To: Bind a Setting to Game Code
  • API Reference