ai.crowd.DebugVisLog
ai.crowd.DebugVisLog
#Overview
name: ai.crowd.DebugVisLog
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable detailed vislog recording for all crowd agents.\n0: Disable, 1: Enable
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ai.crowd.DebugVisLog
is to enable detailed visual logging for all crowd agents in the AI module of Unreal Engine 5. This setting variable is primarily used for debugging and development purposes within the crowd simulation system.
-
The AI module, specifically the crowd management system, relies on this setting variable. It is part of the AIModule in Unreal Engine.
-
The value of this variable is set through a console variable (CVar) named “ai.crowd.DebugVisLog”. It is initialized to 0 (disabled) by default.
-
This variable interacts with the
DebugVisLog
integer variable within theFCrowdDebug
namespace. They share the same value, as the console variable is directly linked to theDebugVisLog
variable. -
Developers must be aware that enabling this variable will impact performance, as it will record detailed visual logging information for all crowd agents. It should be used primarily for debugging and development purposes, not in production builds.
-
Best practices when using this variable include:
- Only enable it when necessary for debugging crowd agent behavior.
- Disable it in production builds to avoid performance overhead.
- Use in conjunction with other debugging tools and variables for comprehensive analysis.
Regarding the associated variable DebugVisLog
:
- It serves the same purpose as the console variable, acting as the actual storage for the debug flag.
- It is used within the
UCrowdManager::DebugTick()
function to determine whether to perform visual logging for each active crowd agent. - When enabled (set to a non-zero value), it triggers the creation of visual logs for all crowd agents, which can be useful for visualizing their behavior and pathfinding.
- Developers should use this variable in conjunction with other debugging tools to get a complete picture of crowd agent behavior and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp:49
Scope (from outer to inner):
file
namespace FCrowdDebug
Source code excerpt:
/** if set, basic debug information will be recorded in VisLog for all agents */
int32 DebugVisLog = 0;
FAutoConsoleVariableRef CVarDebugVisLog(TEXT("ai.crowd.DebugVisLog"), DebugVisLog,
TEXT("Enable detailed vislog recording for all crowd agents.\n0: Disable, 1: Enable"), ECVF_Default);
/** debug flags, works only for selected actor */
int32 DrawDebugCorners = 1;
FAutoConsoleVariableRef CVarDrawDebugCorners(TEXT("ai.crowd.DrawDebugCorners"), DrawDebugCorners,
TEXT("Draw path corners data, requires ai.crowd.DebugSelectedActors.\n0: Disable, 1: Enable"), ECVF_Default);
#Associated Variable and Callsites
This variable is associated with another variable named DebugVisLog
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp:48
Scope (from outer to inner):
file
namespace FCrowdDebug
Source code excerpt:
/** if set, basic debug information will be recorded in VisLog for all agents */
int32 DebugVisLog = 0;
FAutoConsoleVariableRef CVarDebugVisLog(TEXT("ai.crowd.DebugVisLog"), DebugVisLog,
TEXT("Enable detailed vislog recording for all crowd agents.\n0: Disable, 1: Enable"), ECVF_Default);
/** debug flags, works only for selected actor */
int32 DrawDebugCorners = 1;
FAutoConsoleVariableRef CVarDrawDebugCorners(TEXT("ai.crowd.DrawDebugCorners"), DrawDebugCorners,
TEXT("Draw path corners data, requires ai.crowd.DebugSelectedActors.\n0: Disable, 1: Enable"), ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp:1213
Scope (from outer to inner):
file
function void UCrowdManager::DebugTick
Source code excerpt:
// vislog debugging
if (FCrowdDebug::DebugVisLog)
{
for (auto It = ActiveAgents.CreateConstIterator(); It; ++It)
{
const ICrowdAgentInterface* IAgent = It.Key();
const UObject* AgentOb = IAgent ? Cast<const UObject>(IAgent) : NULL;
const AActor* LogOwner = AgentOb ? Cast<const AActor>(AgentOb->GetOuter()) : NULL;