a.RewindDebugger.VisualLogs.UseActor

a.RewindDebugger.VisualLogs.UseActor

#Overview

name: a.RewindDebugger.VisualLogs.UseActor

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 a.RewindDebugger.VisualLogs.UseActor is to control the rendering method for visual logs in the Rewind Debugger system. Specifically, it determines whether to use an actor-based debug renderer for visual logs or not.

This setting variable is primarily used in the Rewind Debugger Visual Log (VLog) module, which is part of the GameplayInsights plugin for Unreal Engine. This plugin is likely used for debugging and analyzing gameplay systems.

The value of this variable is set through a console variable (CVar) system, allowing it to be changed at runtime. It is initialized with a default value of 0, meaning the actor-based debug renderer is not used by default.

The associated variable CVarRewindDebuggerVLogUseActor interacts directly with a.RewindDebugger.VisualLogs.UseActor. This C++ variable is used to access and check the value of the console variable in the code.

Developers must be aware that changing this variable will affect how visual logs are rendered in the Rewind Debugger. When set to a non-zero value, it will use an actor-based debug renderer, which might have different performance characteristics or visual output compared to the default method.

Best practices when using this variable include:

  1. Only enable the actor-based renderer if needed for specific debugging scenarios.
  2. Be aware of any performance implications when enabling this feature, especially in performance-sensitive environments.
  3. Use this in conjunction with other Rewind Debugger tools for comprehensive debugging.

Regarding the associated variable CVarRewindDebuggerVLogUseActor:

The purpose of CVarRewindDebuggerVLogUseActor is to provide a programmatic interface to the a.RewindDebugger.VisualLogs.UseActor console variable within the C++ code.

This variable is used in the RewindDebuggerVLog module of the GameplayInsights plugin. It’s primarily used to check the current value of the setting and determine the rendering behavior for visual logs.

The value of CVarRewindDebuggerVLogUseActor is set automatically by the console variable system based on the value of a.RewindDebugger.VisualLogs.UseActor.

It interacts directly with the a.RewindDebugger.VisualLogs.UseActor console variable, essentially serving as its in-code representation.

Developers should be aware that this variable is of type TAutoConsoleVariable, which means it’s thread-safe and can be accessed from any thread.

Best practices for using CVarRewindDebuggerVLogUseActor include:

  1. Use the GetValueOnAnyThread() method to safely retrieve its value from any thread.
  2. Avoid caching the value for long periods, as it can be changed at runtime through the console.
  3. Consider the performance impact of frequently checking this value in performance-critical code paths.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/GameplayInsights/Source/RewindDebuggerVLog/Private/RewindDebuggerVLog.cpp:19

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "RewindDebuggerVLog"

TAutoConsoleVariable<int32> CVarRewindDebuggerVLogUseActor(TEXT("a.RewindDebugger.VisualLogs.UseActor"), 0, TEXT("Use actor based debug renderer for visual logs"));

FRewindDebuggerVLog::FRewindDebuggerVLog()
{

}

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/GameplayInsights/Source/RewindDebuggerVLog/Private/RewindDebuggerVLog.cpp:19

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "RewindDebuggerVLog"

TAutoConsoleVariable<int32> CVarRewindDebuggerVLogUseActor(TEXT("a.RewindDebugger.VisualLogs.UseActor"), 0, TEXT("Use actor based debug renderer for visual logs"));

FRewindDebuggerVLog::FRewindDebuggerVLog()
{

}

#Loc: <Workspace>/Engine/Plugins/Animation/GameplayInsights/Source/RewindDebuggerVLog/Private/RewindDebuggerVLog.cpp:79

Scope (from outer to inner):

file
function     void FRewindDebuggerVLog::RenderLogEntry

Source code excerpt:

void FRewindDebuggerVLog::RenderLogEntry(const FVisualLogEntry& Entry)
{
	if (CVarRewindDebuggerVLogUseActor.GetValueOnAnyThread())
	{
		// old actor based codepath
		if (AVLogRenderingActor* RenderingActor = GetRenderingActor())
		{
			RenderingActor->AddLogEntry(Entry);
		}