con.DebugEarlyDefault
con.DebugEarlyDefault
#Overview
name: con.DebugEarlyDefault
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
used internally to test the console variable system
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of con.DebugEarlyDefault is to serve as a test variable for the console variable system within Unreal Engine. It is used internally to verify the functionality of the console variable system, particularly in debugging and testing scenarios.
This setting variable is primarily used by the Core module of Unreal Engine, specifically within the console management system. The variable is defined and used in the ConsoleManager.cpp file, which is part of the HAL (Hardware Abstraction Layer) subsystem.
The value of this variable is set when it is declared as a TAutoConsoleVariable. In the provided code, it is initialized with a value of 21. However, it’s important to note that this value can be overridden through configuration files or at runtime through the console.
The associated variable CVarDebugEarlyDefault directly interacts with con.DebugEarlyDefault. They share the same value and are used together in the console variable system tests.
Developers must be aware that this variable is primarily intended for internal testing and debugging of the console variable system. It should not be relied upon for game-specific functionality or settings.
Best practices when using this variable include:
- Avoid modifying or relying on this variable for game-specific logic.
- Use it only for understanding or extending the console variable system if necessary.
- Be aware that its behavior might change in future engine versions as it’s part of the internal testing mechanism.
Regarding the associated variable CVarDebugEarlyDefault:
The purpose of CVarDebugEarlyDefault is to provide a C++ interface to the con.DebugEarlyDefault console variable. It allows for programmatic access to the variable’s value within the engine’s C++ code.
This variable is used in the Core module, specifically in the console management system. It’s defined in the ConsoleManager.cpp file.
The value of CVarDebugEarlyDefault is set when it’s declared as a TAutoConsoleVariable, initialized with the same value as con.DebugEarlyDefault (21 in this case).
CVarDebugEarlyDefault interacts directly with con.DebugEarlyDefault, essentially serving as its C++ representation.
Developers should be aware that this is an internal testing variable and should not be used for game-specific functionality. It’s primarily used to verify the correct behavior of the console variable system, especially in relation to configuration file loading and runtime modifications.
Best practices for CVarDebugEarlyDefault include:
- Use it only for debugging or extending the console variable system if necessary.
- Avoid relying on it for game-specific logic or settings.
- Be prepared for potential changes in its behavior in future engine versions.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2202, section: [SystemSettings]
- INI Section:
SystemSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1625
Scope: file
Source code excerpt:
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyDefault(
TEXT("con.DebugEarlyDefault"),
21,
TEXT("used internally to test the console variable system"),
ECVF_Default);
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyCheat(
TEXT("con.DebugEarlyCheat"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarDebugEarlyDefault
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1624
Scope: file
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyDefault(
TEXT("con.DebugEarlyDefault"),
21,
TEXT("used internally to test the console variable system"),
ECVF_Default);
// part of the automated test for console variables
static TAutoConsoleVariable<int32> CVarDebugEarlyCheat(
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:1655
Scope (from outer to inner):
file
function void FConsoleManager::CallAllConsoleVariableSinks
Source code excerpt:
IConsoleVariable* VarD = IConsoleManager::Get().RegisterConsoleVariable(TEXT("con.DebugLateCheat"), 24, TEXT("used internally to test the console variable system"), ECVF_Cheat);
int32 ValA = CVarDebugEarlyDefault.GetValueOnGameThread();
int32 ValB = CVarDebugEarlyCheat.GetValueOnGameThread();
int32 ValC = VarC->GetInt();
int32 ValD = VarD->GetInt();
// in BaseEngine.ini we set all 4 cvars to "True" but only the non cheat one should pick up the value
check(ValA == 1);