Lyra.Settings.ApplyDeviceProfilesInPIE
Lyra.Settings.ApplyDeviceProfilesInPIE
#Overview
name: Lyra.Settings.ApplyDeviceProfilesInPIE
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Should we apply experience/platform emulated device profiles in PIE?
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Lyra.Settings.ApplyDeviceProfilesInPIE is to control whether device profiles should be applied in Play-In-Editor (PIE) mode when emulating different platforms or experiences in the Lyra game project.
This setting variable is primarily used in the Lyra game project, which is built on Unreal Engine 5. It’s specifically related to the platform emulation and device profile system within the Lyra game development environment.
The value of this variable is set in two places:
- As a console variable (CVar) in LyraSettingsLocal.cpp, where it’s initialized to false.
- As a UPROPERTY in the ULyraPlatformEmulationSettings class, where it can be edited in the Unreal Editor.
The associated variable CVarApplyDeviceProfilesInPIE interacts directly with Lyra.Settings.ApplyDeviceProfilesInPIE. They share the same value and purpose.
Developers must be aware that:
- This setting only affects Play-In-Editor mode.
- It’s primarily used for testing and development purposes, allowing developers to emulate different device profiles without building for specific platforms.
- The setting is false by default, meaning device profiles are not applied in PIE by default.
Best practices when using this variable include:
- Enable it when testing platform-specific behavior or performance in PIE.
- Disable it when you want to test in PIE without any platform-specific optimizations.
- Be aware that enabling this might change the game’s behavior or performance in PIE, which might not reflect the default editor environment.
Regarding the associated variable CVarApplyDeviceProfilesInPIE:
- It’s a console variable that directly controls the same functionality as Lyra.Settings.ApplyDeviceProfilesInPIE.
- It’s used in the UpdateGameModeDeviceProfileAndFps function to determine whether to apply device profiles in PIE.
- Developers can use this console variable to quickly toggle the setting without going through the editor interface.
- When working with this variable, developers should remember that changes made via console commands are temporary and won’t persist between editor sessions, unlike changes made through the ULyraPlatformEmulationSettings class.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:44
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<bool> CVarApplyDeviceProfilesInPIE(TEXT("Lyra.Settings.ApplyDeviceProfilesInPIE"),
false,
TEXT("Should we apply experience/platform emulated device profiles in PIE?"),
ECVF_Default);
#endif
//////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Development/LyraPlatformEmulationSettings.h:53
Scope (from outer to inner):
file
class class ULyraPlatformEmulationSettings : public UDeveloperSettingsBackedByCVars
Source code excerpt:
// Should we apply experience/platform emulated device profiles in PIE?
UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(InlineEditConditionToggle, ConsoleVariable="Lyra.Settings.ApplyDeviceProfilesInPIE"))
bool bApplyDeviceProfilesInPIE = false;
#if WITH_EDITOR
public:
// Called by the editor engine to let us pop reminder notifications when cheats are active
LYRAGAME_API void OnPlayInEditorStarted() const;
#Associated Variable and Callsites
This variable is associated with another variable named CVarApplyDeviceProfilesInPIE
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:44
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<bool> CVarApplyDeviceProfilesInPIE(TEXT("Lyra.Settings.ApplyDeviceProfilesInPIE"),
false,
TEXT("Should we apply experience/platform emulated device profiles in PIE?"),
ECVF_Default);
#endif
//////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:1554
Scope (from outer to inner):
file
function void ULyraSettingsLocal::UpdateGameModeDeviceProfileAndFps
Source code excerpt:
{
#if WITH_EDITOR
if (GIsEditor && !CVarApplyDeviceProfilesInPIE.GetValueOnGameThread())
{
return;
}
#endif
UDeviceProfileManager& Manager = UDeviceProfileManager::Get();