Lyra.Settings.ApplyDeviceProfilesInPIE

Lyra.Settings.ApplyDeviceProfilesInPIE

#Overview

name: Lyra.Settings.ApplyDeviceProfilesInPIE

This variable is created as a Console Variable (cvar).

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:

  1. As a console variable (CVar) in LyraSettingsLocal.cpp, where it’s initialized to false.
  2. 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:

  1. This setting only affects Play-In-Editor mode.
  2. It’s primarily used for testing and development purposes, allowing developers to emulate different device profiles without building for specific platforms.
  3. The setting is false by default, meaning device profiles are not applied in PIE by default.

Best practices when using this variable include:

  1. Enable it when testing platform-specific behavior or performance in PIE.
  2. Disable it when you want to test in PIE without any platform-specific optimizations.
  3. 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:

#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();