demo.WithTimeBurnIn

demo.WithTimeBurnIn

#Overview

name: demo.WithTimeBurnIn

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 demo.WithTimeBurnIn is to enable an on-screen debug message displaying the current demo time and changelist during demo playback in Unreal Engine.

This setting variable is primarily used in the demo playback system of Unreal Engine. It’s part of the Engine module, specifically within the DemoNetDriver component, which is responsible for recording and playing back gameplay demos.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as a TAutoConsoleVariable, which means it can be changed at runtime through console commands or configuration files.

The associated variable CVarWithDemoTimeBurnIn directly interacts with demo.WithTimeBurnIn. They share the same value and purpose.

Developers must be aware that enabling this variable will add an on-screen debug message, which may not be desirable in production builds or when capturing footage. It’s primarily intended for debugging and development purposes.

Best practices for using this variable include:

  1. Use it during development and testing phases to verify demo playback accuracy.
  2. Ensure it’s disabled in production builds to avoid unnecessary on-screen messages.
  3. Combine it with other demo-related console variables for comprehensive debugging.

Regarding the associated variable CVarWithDemoTimeBurnIn:

The purpose of CVarWithDemoTimeBurnIn is identical to demo.WithTimeBurnIn. It’s an internal representation of the console variable within the C++ code.

This variable is used in the Engine module, specifically in the DemoNetDriver component. It’s checked in the ConditionallyDisplayBurnInTime function to determine whether to display the on-screen debug message.

The value of CVarWithDemoTimeBurnIn is set automatically by the Unreal Engine console variable system based on the value of demo.WithTimeBurnIn.

CVarWithDemoTimeBurnIn directly interacts with the ConditionallyDisplayBurnInTime function, controlling whether the debug message is displayed.

Developers should be aware that this variable is checked on any thread (GetValueOnAnyThread()), which means it’s designed for frequent access without causing performance issues.

Best practices for CVarWithDemoTimeBurnIn are the same as for demo.WithTimeBurnIn, as they are essentially two representations of the same setting.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:78

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarWithLevelStreamingFixes(TEXT("demo.WithLevelStreamingFixes"), 0, TEXT("If 1, provides fixes for level streaming (but breaks backwards compatibility)."));
TAutoConsoleVariable<int32> CVarWithDemoTimeBurnIn(TEXT("demo.WithTimeBurnIn"), 0, TEXT("If true, adds an on screen message with the current DemoTime and Changelist."));
TAutoConsoleVariable<int32> CVarWithDeltaCheckpoints(TEXT("demo.WithDeltaCheckpoints"), 0, TEXT("If true, record checkpoints as a delta from the previous checkpoint."));
TAutoConsoleVariable<int32> CVarWithGameSpecificFrameData(TEXT("demo.WithGameSpecificFrameData"), 0, TEXT("If true, allow game specific data to be recorded with each demo frame."));

static TAutoConsoleVariable<float> CVarDemoIncreaseRepPrioritizeThreshold(TEXT("demo.IncreaseRepPrioritizeThreshold"), 0.9, TEXT("The % of Replicated to Prioritized actors at which prioritize time will be decreased."));
static TAutoConsoleVariable<float> CVarDemoDecreaseRepPrioritizeThreshold(TEXT("demo.DecreaseRepPrioritizeThreshold"), 0.7, TEXT("The % of Replicated to Prioritized actors at which prioritize time will be increased."));
static TAutoConsoleVariable<float> CVarDemoMinimumRepPrioritizeTime(TEXT("demo.MinimumRepPrioritizePercent"), 0.3, TEXT("Minimum percent of time that must be spent prioritizing actors, regardless of throttling."));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:78

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarWithLevelStreamingFixes(TEXT("demo.WithLevelStreamingFixes"), 0, TEXT("If 1, provides fixes for level streaming (but breaks backwards compatibility)."));
TAutoConsoleVariable<int32> CVarWithDemoTimeBurnIn(TEXT("demo.WithTimeBurnIn"), 0, TEXT("If true, adds an on screen message with the current DemoTime and Changelist."));
TAutoConsoleVariable<int32> CVarWithDeltaCheckpoints(TEXT("demo.WithDeltaCheckpoints"), 0, TEXT("If true, record checkpoints as a delta from the previous checkpoint."));
TAutoConsoleVariable<int32> CVarWithGameSpecificFrameData(TEXT("demo.WithGameSpecificFrameData"), 0, TEXT("If true, allow game specific data to be recorded with each demo frame."));

static TAutoConsoleVariable<float> CVarDemoIncreaseRepPrioritizeThreshold(TEXT("demo.IncreaseRepPrioritizeThreshold"), 0.9, TEXT("The % of Replicated to Prioritized actors at which prioritize time will be decreased."));
static TAutoConsoleVariable<float> CVarDemoDecreaseRepPrioritizeThreshold(TEXT("demo.DecreaseRepPrioritizeThreshold"), 0.7, TEXT("The % of Replicated to Prioritized actors at which prioritize time will be increased."));
static TAutoConsoleVariable<float> CVarDemoMinimumRepPrioritizeTime(TEXT("demo.MinimumRepPrioritizePercent"), 0.3, TEXT("Minimum percent of time that must be spent prioritizing actors, regardless of throttling."));

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:107

Scope (from outer to inner):

file
function     static void ConditionallyDisplayBurnInTime

Source code excerpt:

static void ConditionallyDisplayBurnInTime(uint32 RecordedCL, float CurrentDemoTime)
{
	if (CVarWithDemoTimeBurnIn.GetValueOnAnyThread() != 0)
	{
		GEngine->AddOnScreenDebugMessage(INDEX_NONE, 0.f, FColor::Red, FString::Printf(TEXT("Current CL: %lu | Recorded CL: %lu | Time: %f"), FEngineVersion::Current().GetChangelist(), RecordedCL, CurrentDemoTime), true, FVector2D(3.f, 3.f));
	}
}

static bool ShouldActorGoDormantForDemo(const AActor* Actor, const UActorChannel* Channel)