GameFeaturePlugin.AllowRuntimeDeviceProfiles
GameFeaturePlugin.AllowRuntimeDeviceProfiles
#Overview
name: GameFeaturePlugin.AllowRuntimeDeviceProfiles
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allow game feature plugins to generate device profiles from config based on existing parents
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of GameFeaturePlugin.AllowRuntimeDeviceProfiles is to control whether game feature plugins are allowed to generate device profiles from configuration based on existing parents. This setting is primarily used in the Game Features plugin system of Unreal Engine 5.
The Game Features module relies on this setting variable. It is used within the GameFeatureData class, which is part of the Game Features plugin.
The value of this variable is set as a console variable (CVar) with a default value of true. It can be changed at runtime through the console or programmatically.
This variable interacts with an associated variable named CVarAllowRuntimeDeviceProfiles. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the behavior of device profile generation for game feature plugins. When set to true, it allows the creation of device profiles based on existing parent profiles, which can impact game performance and settings on different devices.
Best practices when using this variable include:
- Carefully consider the implications of allowing runtime device profile generation, especially in production builds.
- Use this feature judiciously, as it can affect game performance across different devices.
- Test thoroughly on various devices when enabling this feature to ensure consistent behavior.
- Document any custom device profiles generated through this mechanism for easier maintenance and debugging.
Regarding the associated variable CVarAllowRuntimeDeviceProfiles:
The purpose of CVarAllowRuntimeDeviceProfiles is identical to GameFeaturePlugin.AllowRuntimeDeviceProfiles, as they are essentially the same variable.
It is used in the Game Features module, specifically within the UGameFeatureData class.
The value is set using the TAutoConsoleVariable template, initializing it with a default value of true.
This variable directly interacts with GameFeaturePlugin.AllowRuntimeDeviceProfiles, as they represent the same setting.
Developers should be aware that this is the actual variable used in the C++ code to check the setting’s value. It’s accessed using the GetBool() method.
Best practices for using CVarAllowRuntimeDeviceProfiles include:
- Use the GetBool() method to retrieve its current value in C++ code.
- Consider exposing this setting in the game’s options menu if runtime changes are desired.
- Be consistent in using either this variable name or GameFeaturePlugin.AllowRuntimeDeviceProfiles when referring to this setting in documentation and code comments.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Private/GameFeatureData.cpp:76
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarAllowRuntimeDeviceProfiles(
TEXT("GameFeaturePlugin.AllowRuntimeDeviceProfiles"),
true,
TEXT("Allow game feature plugins to generate device profiles from config based on existing parents"),
ECVF_Default);
void UGameFeatureData::InitializeBasePluginIniFile(const FString& PluginInstalledFilename) const
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarAllowRuntimeDeviceProfiles
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Private/GameFeatureData.cpp:75
Scope: file
Source code excerpt:
#endif
static TAutoConsoleVariable<bool> CVarAllowRuntimeDeviceProfiles(
TEXT("GameFeaturePlugin.AllowRuntimeDeviceProfiles"),
true,
TEXT("Allow game feature plugins to generate device profiles from config based on existing parents"),
ECVF_Default);
void UGameFeatureData::InitializeBasePluginIniFile(const FString& PluginInstalledFilename) const
#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Private/GameFeatureData.cpp:159
Scope (from outer to inner):
file
function void UGameFeatureData::InitializeHierarchicalPluginIniFiles
Source code excerpt:
const bool bForceReloadFromDisk = false;
const bool bWriteDestIni = false;
const bool bCreateDeviceProfiles = CVarAllowRuntimeDeviceProfiles->GetBool();
struct FIniLoadingParams
{
FIniLoadingParams(const FString& InName, bool bInUsePlatformDir = false, bool bInCreateDeviceProfiles = false)
: Name(InName), bUsePlatformDir(bInUsePlatformDir), bCreateDeviceProfiles(bInCreateDeviceProfiles)
{}