Net.RepGraph.ConditionalBreakpointActorName
Net.RepGraph.ConditionalBreakpointActorName
#Overview
name: Net.RepGraph.ConditionalBreakpointActorName
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Helper CVar for debugging. Set this string to conditionally log/breakpoint various points in the repgraph pipeline. Useful for bugs like \'why is this actor channel closing\'
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Net.RepGraph.ConditionalBreakpointActorName is to assist in debugging the replication graph pipeline in Unreal Engine 5. It is a helper console variable (CVar) that allows developers to set conditional breakpoints or log specific points in the replication process for a particular actor.
This setting variable is primarily used by the Replication Graph plugin, which is part of Unreal Engine’s networking subsystem. The plugin is responsible for optimizing network replication for large-scale multiplayer games.
The value of this variable is set through the console or programmatically during runtime. It is not hardcoded and can be changed dynamically for debugging purposes.
The associated variable CVarRepGraphConditionalBreakpointActorName interacts directly with Net.RepGraph.ConditionalBreakpointActorName. They share the same value and purpose.
Developers must be aware that this variable is intended for debugging purposes only and should not be used in production builds. It’s especially useful for investigating issues related to actor channel closing or other replication-related problems.
Best practices when using this variable include:
- Only enable it in development or debug builds.
- Use it in conjunction with other debugging tools and logs for comprehensive analysis.
- Clear the value when not actively debugging to avoid unnecessary performance overhead.
- Be specific with the actor name to minimize unintended breakpoints.
Regarding the associated variable CVarRepGraphConditionalBreakpointActorName:
This is a static TAutoConsoleVariable of type FString, which is the actual implementation of the Net.RepGraph.ConditionalBreakpointActorName console variable. It is used internally by the engine to store and retrieve the value set by the user.
The purpose of CVarRepGraphConditionalBreakpointActorName is identical to Net.RepGraph.ConditionalBreakpointActorName, as they represent the same concept at different levels of abstraction.
This variable is used in the RepGraphConditionalActorBreakpoint function to check if the current actor’s name contains the string set in the console variable. If there’s a match, it triggers the conditional breakpoint or logging.
Developers should be aware that this variable is checked on the game thread, which could potentially impact performance if used extensively. It’s crucial to use it judiciously and only when necessary for debugging specific replication issues.
Best practices for CVarRepGraphConditionalBreakpointActorName align with those of Net.RepGraph.ConditionalBreakpointActorName, emphasizing its use as a temporary debugging tool rather than a permanent feature of the game code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/ReplicationGraph/Source/Private/ReplicationGraph.cpp:181
Scope: file
Source code excerpt:
CSV_DEFINE_CATEGORY(ReplicationGraph, WITH_SERVER_CODE);
static TAutoConsoleVariable<FString> CVarRepGraphConditionalBreakpointActorName(TEXT("Net.RepGraph.ConditionalBreakpointActorName"), TEXT(""),
TEXT("Helper CVar for debugging. Set this string to conditionally log/breakpoint various points in the repgraph pipeline. Useful for bugs like 'why is this actor channel closing'"), ECVF_Default );
// Variable that can be programatically set to a specific actor/connection
FActorConnectionPair DebugActorConnectionPair;
/** Used to call Describe on a Connection or Channel, handling the null case. */
#Associated Variable and Callsites
This variable is associated with another variable named CVarRepGraphConditionalBreakpointActorName
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/ReplicationGraph/Source/Private/ReplicationGraph.cpp:181
Scope: file
Source code excerpt:
CSV_DEFINE_CATEGORY(ReplicationGraph, WITH_SERVER_CODE);
static TAutoConsoleVariable<FString> CVarRepGraphConditionalBreakpointActorName(TEXT("Net.RepGraph.ConditionalBreakpointActorName"), TEXT(""),
TEXT("Helper CVar for debugging. Set this string to conditionally log/breakpoint various points in the repgraph pipeline. Useful for bugs like 'why is this actor channel closing'"), ECVF_Default );
// Variable that can be programatically set to a specific actor/connection
FActorConnectionPair DebugActorConnectionPair;
/** Used to call Describe on a Connection or Channel, handling the null case. */
#Loc: <Workspace>/Engine/Plugins/Runtime/ReplicationGraph/Source/Private/ReplicationGraph.cpp:197
Scope (from outer to inner):
file
function bool RepGraphConditionalActorBreakpoint
Source code excerpt:
{
#if !(UE_BUILD_SHIPPING)
if (CVarRepGraphConditionalBreakpointActorName.GetValueOnGameThread().Len() > 0 && GetNameSafe(Actor).Contains(CVarRepGraphConditionalBreakpointActorName.GetValueOnGameThread()))
{
return true;
}
// Alternatively, DebugActorConnectionPair can be set by code to catch a specific actor/connection pair
if (DebugActorConnectionPair.Actor.Get() == Actor && (DebugActorConnectionPair.Connection == nullptr || DebugActorConnectionPair.Connection == NetConnection ))