tick.ShowPrerequistes

tick.ShowPrerequistes

#Overview

name: tick.ShowPrerequistes

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 tick.ShowPrerequistes is to control the logging of prerequisites when debugging ticks in Unreal Engine 5. This setting variable is primarily used for debugging the game’s tick system.

The Unreal Engine subsystem that relies on this setting variable is the tick system, which is part of the Engine module. This can be inferred from the file location (Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp) and the context of the code.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 1, meaning it’s enabled by default. Users can change this value at runtime using console commands.

This variable interacts with another variable named CVarLogTicksShowPrerequistes. They share the same value and purpose. CVarLogTicksShowPrerequistes is used to actually retrieve the value and control the behavior in the code.

Developers must be aware that this variable is intended for debugging purposes only. Enabling it may have performance implications, as it will cause additional logging output during tick operations.

Best practices when using this variable include:

  1. Only enable it when debugging tick-related issues.
  2. Disable it in production builds to avoid unnecessary performance overhead.
  3. Use it in conjunction with other tick-related debug options for comprehensive debugging.

Regarding the associated variable CVarLogTicksShowPrerequistes:

The purpose of CVarLogTicksShowPrerequistes is to provide a programmatic way to access the value of the tick.ShowPrerequistes console variable within the C++ code.

This variable is used directly in the FTickTaskSequencer class, specifically in the StartFrame() function. It controls whether prerequisite information is included when logging tick operations.

The value of CVarLogTicksShowPrerequistes is set by the tick.ShowPrerequistes console variable and can be accessed using the GetValueOnGameThread() method.

Developers should be aware that this variable is used in performance-sensitive areas of the engine, specifically in the tick system. Frequent access or changes to this variable could potentially impact performance.

Best practices for using CVarLogTicksShowPrerequistes include:

  1. Cache the value at the beginning of a frame or tick cycle to avoid frequent calls to GetValueOnGameThread().
  2. Only use it in debug or development builds, not in shipping builds.
  3. Be cautious about changing its value during runtime, as it may affect ongoing tick operations.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:40

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLogTicksShowPrerequistes(
	TEXT("tick.ShowPrerequistes"),
	1,
	TEXT("When logging ticks, show the prerequistes; debugging."));

static TAutoConsoleVariable<int32> CVarAllowAsyncComponentTicks(
	TEXT("tick.AllowAsyncComponentTicks"),
	1,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:39

Scope: file

Source code excerpt:

	TEXT("Spew ticks for debugging."));

static TAutoConsoleVariable<int32> CVarLogTicksShowPrerequistes(
	TEXT("tick.ShowPrerequistes"),
	1,
	TEXT("When logging ticks, show the prerequistes; debugging."));

static TAutoConsoleVariable<int32> CVarAllowAsyncComponentTicks(
	TEXT("tick.AllowAsyncComponentTicks"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:580

Scope (from outer to inner):

file
class        class FTickTaskSequencer
function     void StartFrame

Source code excerpt:

	{
		bLogTicks = !!CVarLogTicks.GetValueOnGameThread();
		bLogTicksShowPrerequistes = !!CVarLogTicksShowPrerequistes.GetValueOnGameThread();

		if (bLogTicks)
		{
			UE_LOG(LogTick, Log, TEXT("tick %6llu ---------------------------------------- Start Frame"),(uint64)GFrameCounter);
		}