Lyra.DeviceProfile.Mobile.DefaultFrameRate
Lyra.DeviceProfile.Mobile.DefaultFrameRate
#Overview
name: Lyra.DeviceProfile.Mobile.DefaultFrameRate
The value of this variable can be defined or overridden in .ini config files. 13
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Default 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.Mobile.DefaultFrameRate is to set the default frame rate for mobile devices in the Lyra game project. This setting is specifically for the mobile version of the game and is part of the frame pacing system.
This setting variable is primarily used in the LyraGame module, specifically within the LyraSettingsLocal class. It’s part of the game’s settings system, which likely interfaces with Unreal Engine’s core systems for managing frame rates and device-specific optimizations.
The value of this variable is set using a TAutoConsoleVariable, which means it can be adjusted at runtime through console commands. Its default value is set to 30 frames per second.
This variable interacts closely with another variable called CVarDeviceProfileDrivenMobileMaxFrameRate, which sets the maximum frame rate for mobile devices. Together, these variables allow for fine-tuning of the game’s performance on mobile platforms.
Developers must be aware that this setting is specifically for mobile devices and may not affect other platforms. They should also consider the relationship between this default frame rate and the maximum frame rate to ensure they are set appropriately for the target mobile devices.
Best practices when using this variable include:
- Adjusting it based on the capabilities of target mobile devices.
- Testing the game’s performance at different frame rates to find the optimal balance between smoothness and battery life.
- Considering the impact on game logic that might be frame-rate dependent.
Regarding the associated variable CVarDeviceProfileDrivenMobileDefaultFrameRate:
This is the actual C++ variable that stores and manages the Lyra.DeviceProfile.Mobile.DefaultFrameRate setting. It’s implemented as a TAutoConsoleVariable, which allows it to be easily adjusted via console commands.
The purpose of this variable is to provide programmatic access to the default mobile frame rate setting within the C++ code. It’s used in the GetDefaultMobileFrameRate() function of the ULyraSettingsLocal class to retrieve the current value of the default frame rate.
Developers should be aware that changes to this variable will directly affect the game’s frame rate on mobile devices. They should use the GetDefaultMobileFrameRate() function to access this value rather than directly accessing the console variable, as this provides a level of abstraction and potential for additional logic in the future.
Best practices for using this variable include:
- Using the provided getter function (GetDefaultMobileFrameRate()) instead of directly accessing the console variable.
- Considering the implications of changing this value at runtime, especially if any game systems rely on a consistent frame rate.
- Documenting any changes to this value, as it can significantly impact the game’s performance and feel on mobile devices.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:58, section: [Mobile DeviceProfile]
- INI Section:
Mobile DeviceProfile
- Raw value:
30
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:267, section: [iPad7 DeviceProfile]
- INI Section:
iPad7 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:272, section: [iPad8 DeviceProfile]
- INI Section:
iPad8 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:277, section: [iPad9 DeviceProfile]
- INI Section:
iPad9 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:289, section: [iPadPro11 DeviceProfile]
- INI Section:
iPadPro11 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:297, section: [iPadPro2_11 DeviceProfile]
- INI Section:
iPadPro2_11 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:305, section: [iPadPro3_11 DeviceProfile]
- INI Section:
iPadPro3_11 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:313, section: [iPadPro3_129 DeviceProfile]
- INI Section:
iPadPro3_129 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:321, section: [iPadPro4_129 DeviceProfile]
- INI Section:
iPadPro4_129 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:476, section: [iPadAir3 DeviceProfile]
- INI Section:
iPadAir3 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:481, section: [iPadAir4 DeviceProfile]
- INI Section:
iPadAir4 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:486, section: [iPadMini5 DeviceProfile]
- INI Section:
iPadMini5 DeviceProfile
- Raw value:
60
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:491, section: [iPadMini6 DeviceProfile]
- INI Section:
iPadMini6 DeviceProfile
- Raw value:
60
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:69
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenMobileDefaultFrameRate(
TEXT("Lyra.DeviceProfile.Mobile.DefaultFrameRate"),
30,
TEXT("Default FPS when being driven by device profile"),
ECVF_Default | ECVF_Preview);
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenMobileMaxFrameRate(
TEXT("Lyra.DeviceProfile.Mobile.MaxFrameRate"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDeviceProfileDrivenMobileDefaultFrameRate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:68
Scope: file
Source code excerpt:
// Mobile frame pacing
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenMobileDefaultFrameRate(
TEXT("Lyra.DeviceProfile.Mobile.DefaultFrameRate"),
30,
TEXT("Default FPS when being driven by device profile"),
ECVF_Default | ECVF_Preview);
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenMobileMaxFrameRate(
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:655
Scope (from outer to inner):
file
function int32 ULyraSettingsLocal::GetDefaultMobileFrameRate
Source code excerpt:
int32 ULyraSettingsLocal::GetDefaultMobileFrameRate()
{
return CVarDeviceProfileDrivenMobileDefaultFrameRate.GetValueOnGameThread();
}
int32 ULyraSettingsLocal::GetMaxMobileFrameRate()
{
return CVarDeviceProfileDrivenMobileMaxFrameRate.GetValueOnGameThread();
}