demo.EnableCheckpoints
demo.EnableCheckpoints
#Overview
name: demo.EnableCheckpoints
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether or not checkpoints save on the server
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.EnableCheckpoints is to control whether checkpoints are saved on the server during demo recording in Unreal Engine 5. This setting is primarily used for the networking and replay systems.
-
The Unreal Engine subsystem that relies on this setting variable is the demo recording system, specifically within the DemoNetDriver and ReplayHelper modules.
-
The value of this variable is set as a console variable (CVar) with a default value of 1, meaning checkpoints are enabled by default. It can be changed at runtime through console commands or programmatically.
-
This variable interacts closely with the associated variable CVarEnableCheckpoints. They share the same value and are used interchangeably in the code.
-
Developers must be aware that this variable affects the performance and functionality of demo recordings. When enabled, it allows for periodic saving of game state, which can be used for faster seeking and replay functionality.
-
Best practices when using this variable include:
- Consider the performance impact of frequent checkpoint saving, especially in resource-intensive games.
- Use in conjunction with other demo-related settings for optimal replay functionality.
- Be aware of the potential increase in demo file size when checkpoints are enabled.
Regarding the associated variable CVarEnableCheckpoints:
-
Its purpose is identical to demo.EnableCheckpoints, controlling checkpoint saving during demo recording.
-
It is used in the same subsystems (DemoNetDriver and ReplayHelper) as demo.EnableCheckpoints.
-
The value is set in the same way as demo.EnableCheckpoints, as a console variable with a default value of 1.
-
It interacts directly with demo.EnableCheckpoints, sharing the same value.
-
Developers should treat CVarEnableCheckpoints the same way as demo.EnableCheckpoints, as they are essentially the same variable.
-
Best practices for CVarEnableCheckpoints are the same as those for demo.EnableCheckpoints.
In summary, both demo.EnableCheckpoints and CVarEnableCheckpoints control the same functionality in Unreal Engine 5’s demo recording system, allowing developers to enable or disable checkpoint saving during demo recordings.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:49
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDemoTimeDilation( TEXT( "demo.TimeDilation" ), -1.0f, TEXT( "Override time dilation during demo playback (-1 = don't override)" ) );
static TAutoConsoleVariable<float> CVarDemoSkipTime( TEXT( "demo.SkipTime" ), 0, TEXT( "Skip fixed amount of network replay time (in seconds)" ) );
TAutoConsoleVariable<int32> CVarEnableCheckpoints( TEXT( "demo.EnableCheckpoints" ), 1, TEXT( "Whether or not checkpoints save on the server" ) );
static TAutoConsoleVariable<float> CVarGotoTimeInSeconds( TEXT( "demo.GotoTimeInSeconds" ), -1, TEXT( "For testing only, jump to a particular time" ) );
static TAutoConsoleVariable<int32> CVarDemoFastForwardDestroyTearOffActors( TEXT( "demo.FastForwardDestroyTearOffActors" ), 1, TEXT( "If true, the driver will destroy any torn-off actors immediately while fast-forwarding a replay." ) );
static TAutoConsoleVariable<int32> CVarDemoFastForwardSkipRepNotifies( TEXT( "demo.FastForwardSkipRepNotifies" ), 1, TEXT( "If true, the driver will optimize fast-forwarding by deferring calls to RepNotify functions until the fast-forward is complete. " ) );
static TAutoConsoleVariable<int32> CVarDemoQueueCheckpointChannels( TEXT( "demo.QueueCheckpointChannels" ), 1, TEXT( "If true, the driver will put all channels created during checkpoint loading into queuing mode, to amortize the cost of spawning new actors across multiple frames." ) );
static TAutoConsoleVariable<int32> CVarUseAdaptiveReplayUpdateFrequency( TEXT( "demo.UseAdaptiveReplayUpdateFrequency" ), 1, TEXT( "If 1, NetUpdateFrequency will be calculated based on how often actors actually write something when recording to a replay" ) );
static TAutoConsoleVariable<int32> CVarDemoAsyncLoadWorld( TEXT( "demo.AsyncLoadWorld" ), 0, TEXT( "If 1, we will use seamless server travel to load the replay world asynchronously" ) );
#Associated Variable and Callsites
This variable is associated with another variable named CVarEnableCheckpoints
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:49
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDemoTimeDilation( TEXT( "demo.TimeDilation" ), -1.0f, TEXT( "Override time dilation during demo playback (-1 = don't override)" ) );
static TAutoConsoleVariable<float> CVarDemoSkipTime( TEXT( "demo.SkipTime" ), 0, TEXT( "Skip fixed amount of network replay time (in seconds)" ) );
TAutoConsoleVariable<int32> CVarEnableCheckpoints( TEXT( "demo.EnableCheckpoints" ), 1, TEXT( "Whether or not checkpoints save on the server" ) );
static TAutoConsoleVariable<float> CVarGotoTimeInSeconds( TEXT( "demo.GotoTimeInSeconds" ), -1, TEXT( "For testing only, jump to a particular time" ) );
static TAutoConsoleVariable<int32> CVarDemoFastForwardDestroyTearOffActors( TEXT( "demo.FastForwardDestroyTearOffActors" ), 1, TEXT( "If true, the driver will destroy any torn-off actors immediately while fast-forwarding a replay." ) );
static TAutoConsoleVariable<int32> CVarDemoFastForwardSkipRepNotifies( TEXT( "demo.FastForwardSkipRepNotifies" ), 1, TEXT( "If true, the driver will optimize fast-forwarding by deferring calls to RepNotify functions until the fast-forward is complete. " ) );
static TAutoConsoleVariable<int32> CVarDemoQueueCheckpointChannels( TEXT( "demo.QueueCheckpointChannels" ), 1, TEXT( "If true, the driver will put all channels created during checkpoint loading into queuing mode, to amortize the cost of spawning new actors across multiple frames." ) );
static TAutoConsoleVariable<int32> CVarUseAdaptiveReplayUpdateFrequency( TEXT( "demo.UseAdaptiveReplayUpdateFrequency" ), 1, TEXT( "If 1, NetUpdateFrequency will be calculated based on how often actors actually write something when recording to a replay" ) );
static TAutoConsoleVariable<int32> CVarDemoAsyncLoadWorld( TEXT( "demo.AsyncLoadWorld" ), 0, TEXT( "If 1, we will use seamless server travel to load the replay world asynchronously" ) );
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:1766
Scope (from outer to inner):
file
function void UDemoNetDriver::TickDemoRecord
Source code excerpt:
// Save a checkpoint if it's time
if (CVarEnableCheckpoints.GetValueOnAnyThread() == 1)
{
check(ReplayHelper.GetCheckpointSaveState() == FReplayHelper::ECheckpointSaveState::Idle); // We early out above, so this shouldn't be possible
if (ReplayHelper.ShouldSaveCheckpoint())
{
ReplayHelper.SaveCheckpoint(ClientConnections[0]);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ReplayHelper.cpp:23
Scope: file
Source code excerpt:
extern TAutoConsoleVariable<int32> CVarWithDeltaCheckpoints;
extern TAutoConsoleVariable<int32> CVarWithGameSpecificFrameData;
extern TAutoConsoleVariable<int32> CVarEnableCheckpoints;
extern TAutoConsoleVariable<float> CVarCheckpointUploadDelayInSeconds;
extern TAutoConsoleVariable<float> CVarCheckpointSaveMaxMSPerFrameOverride;
extern TAutoConsoleVariable<int32> CVarDemoUseNetRelevancy;
extern TAutoConsoleVariable<int32> CVarDemoClientRecordAsyncEndOfFrame;
extern TAutoConsoleVariable<float> CVarDemoRecordHz;
extern TAutoConsoleVariable<float> CVarDemoMinRecordHz;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ReplayHelper.cpp:526
Scope (from outer to inner):
file
function void FReplayHelper::TickRecording
Source code excerpt:
// Save a checkpoint if it's time
if (CVarEnableCheckpoints.GetValueOnAnyThread() == 1)
{
check(CheckpointSaveContext.CheckpointSaveState == FReplayHelper::ECheckpointSaveState::Idle); // We early out above, so this shouldn't be possible
if (ShouldSaveCheckpoint())
{
SaveCheckpoint(Connection);