ai.debug.DetailedReplicationLogs

ai.debug.DetailedReplicationLogs

#Overview

name: ai.debug.DetailedReplicationLogs

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.debug.DetailedReplicationLogs is to enable or disable very verbose replication logs for the gameplay debugger. This setting variable is primarily used for debugging and monitoring the replication process in the Unreal Engine’s gameplay debugging system.

This setting variable is relied upon by the GameplayDebugger module, which is part of Unreal Engine’s AI and debugging subsystems. Specifically, it’s used in the GameplayDebuggerCategoryReplicator class, which handles the replication of gameplay debug information.

The value of this variable is set through a console variable (CVar) named CVarGameplayDebuggerRepDetails. It’s defined as a TAutoConsoleVariable with an initial value of 0 (disabled). Developers can change this value at runtime using console commands.

The associated variable CVarGameplayDebuggerRepDetails directly interacts with ai.debug.DetailedReplicationLogs. They share the same value and purpose.

Developers must be aware that enabling this variable will result in very verbose logging, which can impact performance and generate large log files. It should only be used when necessary for debugging replication issues in the gameplay debugger.

Best practices when using this variable include:

  1. Only enable it when actively debugging replication issues in the gameplay debugger.
  2. Remember to disable it after debugging to avoid performance overhead and excessive log generation.
  3. Use it in conjunction with other debugging tools and methods for a comprehensive understanding of replication behavior.
  4. Be prepared to handle and analyze large amounts of log data when this setting is enabled.

Regarding the associated variable CVarGameplayDebuggerRepDetails:

The purpose of CVarGameplayDebuggerRepDetails is to provide a console-accessible way to control the ai.debug.DetailedReplicationLogs setting. It’s an integer console variable that enables or disables detailed replication logging for the gameplay debugger.

This variable is used within the GameplayDebugger module, specifically in the GameplayDebuggerCategoryReplicator class. It’s checked in the NetDeltaSerialize function to determine whether to log detailed replication information.

The value of CVarGameplayDebuggerRepDetails can be set through the console or programmatically. It’s initialized with a value of 0 (disabled) but can be changed at runtime.

Developers should be aware that this variable is marked with ECVF_Cheat flag, indicating it’s intended for development and debugging purposes and should not be exposed to end-users in production builds.

Best practices for using CVarGameplayDebuggerRepDetails include:

  1. Use it in development and testing environments, not in production.
  2. Combine it with other debugging tools for comprehensive replication analysis.
  3. Be mindful of the performance impact when enabling verbose logging.
  4. Use console commands to toggle this setting dynamically during gameplay for on-the-fly debugging.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/GameplayDebugger/Private/GameplayDebuggerCategoryReplicator.cpp:31

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarGameplayDebuggerRepDetails(
	TEXT("ai.debug.DetailedReplicationLogs"),
	0,
	TEXT("Enable or disable very verbose replication logs for gameplay debugger"),
	ECVF_Cheat);

FNotifyGameplayDebuggerOwnerChange AGameplayDebuggerCategoryReplicator::NotifyDebuggerOwnerChange;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/GameplayDebugger/Private/GameplayDebuggerCategoryReplicator.cpp:30

Scope: file

Source code excerpt:

DEFINE_LOG_CATEGORY_STATIC(LogGameplayDebugReplication, Display, All);

static TAutoConsoleVariable<int32> CVarGameplayDebuggerRepDetails(
	TEXT("ai.debug.DetailedReplicationLogs"),
	0,
	TEXT("Enable or disable very verbose replication logs for gameplay debugger"),
	ECVF_Cheat);

FNotifyGameplayDebuggerOwnerChange AGameplayDebuggerCategoryReplicator::NotifyDebuggerOwnerChange;

#Loc: <Workspace>/Engine/Source/Runtime/GameplayDebugger/Private/GameplayDebuggerCategoryReplicator.cpp:334

Scope (from outer to inner):

file
function     bool FGameplayDebuggerNetPack::NetDeltaSerialize

Source code excerpt:

		}

		if (CVarGameplayDebuggerRepDetails.GetValueOnAnyThread())
		{
			if (OldState)
			{
				UE_LOG(LogGameplayDebugReplication, Verbose, TEXT("NetDeltaSerialize DUMP OldState"));
				OldState->DumpToLog();
			}