net.DebugDraw
net.DebugDraw
#Overview
name: net.DebugDraw
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Draws debug information for network dormancy and relevancy\n1 Enables network debug drawing. 0 disables.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.DebugDraw is to enable debug drawing for network-related information, specifically for network dormancy and relevancy.
This setting variable is primarily used in the networking subsystem of Unreal Engine. Based on the callsites, it’s referenced in the NetDriver.cpp file, which is part of the Engine’s networking module.
The value of this variable is set through a console command. It’s defined as a TAutoConsoleVariable with a default value of 0, which means the debug drawing is disabled by default.
The associated variable CVarNetDebugDraw interacts directly with net.DebugDraw. They share the same value and purpose.
Developers should be aware that enabling this debug drawing may have performance implications, especially in complex networked scenarios. It should primarily be used for debugging and development purposes, not in production builds.
Best practices when using this variable include:
- Only enable it when actively debugging network issues related to dormancy or relevancy.
- Remember to disable it after debugging to avoid unnecessary performance overhead.
- Use in conjunction with other network debugging tools for a comprehensive view of network behavior.
Regarding the associated variable CVarNetDebugDraw:
The purpose of CVarNetDebugDraw is the same as net.DebugDraw - it’s used to control the debug drawing of network dormancy and relevancy information.
This variable is used within the UNetDriver::TickFlush function to determine whether to call the DrawNetDriverDebug function. This suggests it’s checked regularly during the network update cycle.
The value of CVarNetDebugDraw is set and controlled by the net.DebugDraw console variable.
Developers should be aware that this variable is checked on any thread (GetValueOnAnyThread()), which means it’s designed for efficient, thread-safe access.
Best practices for CVarNetDebugDraw align with those for net.DebugDraw, as they are essentially the same variable accessed in different ways. Use it judiciously for debugging, and ensure it’s turned off in production environments to maintain optimal performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:376
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarNetDebugDraw(
TEXT("net.DebugDraw"),
0,
TEXT("Draws debug information for network dormancy and relevancy\n")
TEXT("1 Enables network debug drawing. 0 disables."),
ECVF_Default);
static TAutoConsoleVariable<float> CVarNetDebugDrawCullDistance(
#Associated Variable and Callsites
This variable is associated with another variable named CVarNetDebugDraw
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:375
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<int32> CVarNetDebugDraw(
TEXT("net.DebugDraw"),
0,
TEXT("Draws debug information for network dormancy and relevancy\n")
TEXT("1 Enables network debug drawing. 0 disables."),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:1027
Scope (from outer to inner):
file
function void UNetDriver::TickFlush
Source code excerpt:
}
if (CVarNetDebugDraw.GetValueOnAnyThread() > 0)
{
DrawNetDriverDebug();
}
if (!IsUsingIrisReplication())
{