Lyra.DeviceProfile.Console.TargetFPS
Lyra.DeviceProfile.Console.TargetFPS
#Overview
name: Lyra.DeviceProfile.Console.TargetFPS
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Target FPS when being driven by device profile
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Lyra.DeviceProfile.Console.TargetFPS is to control the target frame rate (FPS) for console platforms in the Lyra game project when it’s being driven by the device profile system. This setting is part of the frame pacing and performance management system for the game.
This setting variable is primarily used in the LyraGame module, specifically within the LyraSettingsLocal class. It’s part of the game’s settings and performance management system.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of -1, which likely indicates that no specific target FPS is set by default.
The associated variable CVarDeviceProfileDrivenTargetFps directly interacts with Lyra.DeviceProfile.Console.TargetFPS. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable is specifically for console platforms and is intended to be driven by the device profile system. The -1 default value suggests that it should only be set when a specific FPS target is desired.
Best practices when using this variable include:
- Only set it when you want to enforce a specific frame rate on console platforms.
- Consider the capabilities of the target console hardware when setting a value.
- Test thoroughly to ensure the desired frame rate can be consistently maintained.
- Be aware of how this interacts with other performance and graphics settings.
Regarding the associated variable CVarDeviceProfileDrivenTargetFps:
The purpose of CVarDeviceProfileDrivenTargetFps is to provide programmatic access to the Lyra.DeviceProfile.Console.TargetFPS setting within the C++ code of the Lyra game project.
This variable is used in the LyraSettingsLocal class, specifically in the UpdateConsoleFramePacing function. It’s part of the game’s frame pacing system for console platforms.
The value of this variable is set when the Lyra.DeviceProfile.Console.TargetFPS console variable is set. It’s defined as a static TAutoConsoleVariable, which means it’s accessible throughout the file where it’s defined.
CVarDeviceProfileDrivenTargetFps directly interacts with the FPlatformRHIFramePacer system, setting the frame pace when its value is not -1.
Developers should be aware that this variable is used to actually apply the frame pacing settings. If it’s -1, no change to the frame pacing will be made.
Best practices include:
- Use this variable for reading the current target FPS setting in code.
- Be cautious about directly modifying this variable; prefer to change the Lyra.DeviceProfile.Console.TargetFPS console variable instead.
- Consider the implications of changing the frame pace during runtime, especially in multiplayer scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:54
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenTargetFps(
TEXT("Lyra.DeviceProfile.Console.TargetFPS"),
-1,
TEXT("Target FPS when being driven by device profile"),
ECVF_Default | ECVF_Preview);
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenFrameSyncType(
TEXT("Lyra.DeviceProfile.Console.FrameSyncType"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDeviceProfileDrivenTargetFps
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:53
Scope: file
Source code excerpt:
// Console frame pacing
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenTargetFps(
TEXT("Lyra.DeviceProfile.Console.TargetFPS"),
-1,
TEXT("Target FPS when being driven by device profile"),
ECVF_Default | ECVF_Preview);
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenFrameSyncType(
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:1715
Scope (from outer to inner):
file
function void ULyraSettingsLocal::UpdateConsoleFramePacing
Source code excerpt:
}
const int32 TargetFPS = CVarDeviceProfileDrivenTargetFps.GetValueOnGameThread();
if (TargetFPS != -1)
{
UE_LOG(LogConsoleResponse, Log, TEXT("Setting frame pace to %d Hz."), TargetFPS);
FPlatformRHIFramePacer::SetFramePace(TargetFPS);
// Set the CSV metadata and analytics Fps mode strings