ai.crowd.DrawDebugBoundaries

ai.crowd.DrawDebugBoundaries

#Overview

name: ai.crowd.DrawDebugBoundaries

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ai.crowd.DrawDebugBoundaries is to enable or disable the drawing of shared navmesh boundaries used by crowd simulation in Unreal Engine’s AI system.

This setting variable is primarily used by the AI Module, specifically within the crowd simulation and navigation system. It is part of the debugging tools for AI crowd behavior.

The value of this variable is set through a console variable (cvar) using FAutoConsoleVariableRef. It is initialized to 0 (disabled) by default, but can be changed at runtime through the console or programmatically.

The associated variable DrawDebugBoundaries interacts directly with ai.crowd.DrawDebugBoundaries. They share the same value and are used interchangeably in the code.

Developers should be aware that this is a debugging feature and should be used primarily during development and testing. Enabling this feature in a shipping build might have performance implications.

Best practices for using this variable include:

  1. Use it during AI crowd behavior debugging sessions.
  2. Disable it in shipping builds to avoid potential performance overhead.
  3. Combine it with other AI debugging tools for comprehensive analysis.

Regarding the associated variable DrawDebugBoundaries:

The purpose of DrawDebugBoundaries is the same as ai.crowd.DrawDebugBoundaries - to control the debug visualization of shared navmesh boundaries in crowd simulation.

It is used within the UCrowdManager class, specifically in the DebugTick() function. When enabled, it triggers the DrawDebugSharedBoundary() function, which likely renders the debug visualization.

The value of DrawDebugBoundaries is set by the console variable ai.crowd.DrawDebugBoundaries, ensuring they always have the same value.

Developers should treat DrawDebugBoundaries as an internal variable that reflects the state of the ai.crowd.DrawDebugBoundaries console variable. They should interact with the console variable rather than this internal variable directly.

Best practices for DrawDebugBoundaries are the same as for ai.crowd.DrawDebugBoundaries, focusing on its use as a debugging tool during development and ensuring it’s disabled in production builds.

#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:79

Scope (from outer to inner):

file
namespace    FCrowdDebug

Source code excerpt:

	/** debug flags, don't depend on agent */
	int32 DrawDebugBoundaries = 0;
	FAutoConsoleVariableRef CVarDrawDebugBoundaries(TEXT("ai.crowd.DrawDebugBoundaries"), DrawDebugBoundaries,
		TEXT("Draw shared navmesh boundaries used by crowd simulation.\n0: Disable, 1: Enable"), ECVF_Default);

	const FVector Offset(0, 0, 20);

	const FColor Corner(128, 0, 0);
	const FColor CornerLink(192, 0, 0);

#Associated Variable and Callsites

This variable is associated with another variable named DrawDebugBoundaries. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp:78

Scope (from outer to inner):

file
namespace    FCrowdDebug

Source code excerpt:


	/** debug flags, don't depend on agent */
	int32 DrawDebugBoundaries = 0;
	FAutoConsoleVariableRef CVarDrawDebugBoundaries(TEXT("ai.crowd.DrawDebugBoundaries"), DrawDebugBoundaries,
		TEXT("Draw shared navmesh boundaries used by crowd simulation.\n0: Disable, 1: Enable"), ECVF_Default);

	const FVector Offset(0, 0, 20);

	const FColor Corner(128, 0, 0);
	const FColor CornerLink(192, 0, 0);

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp:1206

Scope (from outer to inner):

file
function     void UCrowdManager::DebugTick

Source code excerpt:

	}

	if (FCrowdDebug::DrawDebugBoundaries)
	{
		DrawDebugSharedBoundary();
	}
#endif // ENABLE_DRAW_DEBUG

	// vislog debugging