g.debug.vlog.AttributeGraph
g.debug.vlog.AttributeGraph
#Overview
name: g.debug.vlog.AttributeGraph
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controlls whether Attribute changes are being recorded by VisLog
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of g.debug.vlog.AttributeGraph is to control whether attribute changes are being recorded by the Visual Logger (VisLog) in Unreal Engine 5. This setting is primarily used for debugging and profiling purposes within the Gameplay Abilities system.
The Unreal Engine subsystem that relies on this setting variable is the Gameplay Abilities plugin, specifically the AttributeSet component. This can be seen from the file path where the variable is defined and used: Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp.
The value of this variable is set using the FAutoConsoleVariableRef system, which allows it to be modified at runtime through the console. It is initialized with a default value of 1, meaning attribute logging is enabled by default.
The associated variable bDoAttributeGraphVLogging interacts directly with g.debug.vlog.AttributeGraph. They share the same value, with bDoAttributeGraphVLogging being the actual boolean flag used in the code to determine if attribute logging should occur.
Developers must be aware that this variable is marked with ECVF_Cheat flag, indicating it’s intended for debugging and should not be used in shipping builds. Also, the logging only occurs when the Visual Logger is recording, as seen in the condition: if (bDoAttributeGraphVLogging && FVisualLogger::IsRecording()).
Best practices when using this variable include:
- Use it only during development and debugging phases.
- Ensure it’s disabled in shipping builds to avoid performance overhead.
- Combine it with the Visual Logger tools to effectively track and visualize attribute changes.
Regarding the associated variable bDoAttributeGraphVLogging:
The purpose of bDoAttributeGraphVLogging is to serve as the actual boolean flag checked in the code to determine if attribute changes should be logged.
It is used within the Gameplay Abilities plugin, specifically in the AttributeSet component.
Its value is set by the console variable g.debug.vlog.AttributeGraph through the FAutoConsoleVariableRef system.
This variable directly interacts with the Visual Logger system when attribute changes occur.
Developers should be aware that this variable is only effective when ENABLE_VISUAL_LOG is defined and the Visual Logger is recording.
Best practices include using this variable in conjunction with the Visual Logger tools for effective debugging of attribute changes in the Gameplay Abilities system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp:26
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
{
int32 bDoAttributeGraphVLogging = 1;
FAutoConsoleVariableRef CVarDoAttributeGraphVLogging(TEXT("g.debug.vlog.AttributeGraph")
, bDoAttributeGraphVLogging, TEXT("Controlls whether Attribute changes are being recorded by VisLog"), ECVF_Cheat);
}
#endif
float FGameplayAttributeData::GetCurrentValue() const
{
#Associated Variable and Callsites
This variable is associated with another variable named bDoAttributeGraphVLogging
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp:25
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
namespace
{
int32 bDoAttributeGraphVLogging = 1;
FAutoConsoleVariableRef CVarDoAttributeGraphVLogging(TEXT("g.debug.vlog.AttributeGraph")
, bDoAttributeGraphVLogging, TEXT("Controlls whether Attribute changes are being recorded by VisLog"), ECVF_Cheat);
}
#endif
float FGameplayAttributeData::GetCurrentValue() const
{
return CurrentValue;
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AttributeSet.cpp:110
Scope (from outer to inner):
file
function void FGameplayAttribute::SetNumericValueChecked
Source code excerpt:
#if ENABLE_VISUAL_LOG
// draw a graph of the changes to the attribute in the visual logger
if (bDoAttributeGraphVLogging && FVisualLogger::IsRecording())
{
AActor* OwnerActor = Dest->GetOwningActor();
if (OwnerActor)
{
ABILITY_VLOG_ATTRIBUTE_GRAPH(OwnerActor, Log, GetName(), OldValue, NewValue);
}