demo.QueueCheckpointChannels
demo.QueueCheckpointChannels
#Overview
name: demo.QueueCheckpointChannels
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.QueueCheckpointChannels is to control the behavior of channel creation during checkpoint loading in Unreal Engine’s demo replay system. Specifically, it determines whether the driver should put all channels created during checkpoint loading into queuing mode.
This setting variable is primarily used in the demo replay system, which is part of Unreal Engine’s networking subsystem. It’s particularly relevant to the DemoNetDriver module, which handles recording and playback of gameplay demos.
The value of this variable is set as a console variable (CVar) with a default value of 1 (true). It can be changed at runtime through the console or configuration files.
The associated variable CVarDemoQueueCheckpointChannels directly interacts with demo.QueueCheckpointChannels. They share the same value and purpose.
Developers should be aware that:
-
When enabled (set to 1), this variable causes the driver to put all channels created during checkpoint loading into queuing mode. This helps to amortize the cost of spawning new actors across multiple frames, potentially improving performance during checkpoint loading.
-
The variable is checked in the ShouldQueueBunchesForActorGUID function of the UDemoNetDriver class, which suggests it affects the queuing behavior of network bunches for specific actors during demo playback.
Best practices when using this variable include:
-
Consider enabling it (set to 1) if you’re experiencing performance issues during checkpoint loading in your replays, especially if many actors are being spawned.
-
Monitor the performance impact of enabling or disabling this feature, as its effectiveness may vary depending on your specific use case and the complexity of your game state.
-
Use in conjunction with other demo-related settings to fine-tune replay performance and behavior.
Regarding the associated variable CVarDemoQueueCheckpointChannels:
This is the actual CVar (Console Variable) object that represents demo.QueueCheckpointChannels in the code. It’s defined as a static TAutoConsoleVariable
The variable is used directly in the code to check its value, as seen in the ShouldQueueBunchesForActorGUID function. This function appears to use the variable to determine whether bunches (packets of network data) should be queued for specific actors during demo playback, particularly while fast-forwarding for a checkpoint.
Developers should be aware that changing this variable at runtime will immediately affect the behavior of the demo system, potentially impacting performance and playback behavior. It’s important to test thoroughly when modifying this value to ensure it doesn’t negatively impact the replay experience in your specific game scenario.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:53
Scope: file
Source code excerpt:
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" ) );
TAutoConsoleVariable<float> CVarCheckpointUploadDelayInSeconds( TEXT( "demo.CheckpointUploadDelayInSeconds" ), 30.0f, TEXT( "" ) );
static TAutoConsoleVariable<int32> CVarDemoLoadCheckpointGarbageCollect( TEXT( "demo.LoadCheckpointGarbageCollect" ), 1, TEXT("If nonzero, CollectGarbage will be called during LoadCheckpoint after the old actors and connection are cleaned up." ) );
TAutoConsoleVariable<float> CVarCheckpointSaveMaxMSPerFrameOverride( TEXT( "demo.CheckpointSaveMaxMSPerFrameOverride" ), -1.0f, TEXT( "If >= 0, this value will override the CheckpointSaveMaxMSPerFrame member variable, which is the maximum time allowed each frame to spend on saving a checkpoint. If 0, it will save the checkpoint in a single frame, regardless of how long it takes." ) );
TAutoConsoleVariable<int32> CVarDemoClientRecordAsyncEndOfFrame( TEXT( "demo.ClientRecordAsyncEndOfFrame" ), 0, TEXT( "If true, TickFlush will be called on a thread in parallel with Slate." ) );
#Associated Variable and Callsites
This variable is associated with another variable named CVarDemoQueueCheckpointChannels
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:53
Scope: file
Source code excerpt:
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" ) );
TAutoConsoleVariable<float> CVarCheckpointUploadDelayInSeconds( TEXT( "demo.CheckpointUploadDelayInSeconds" ), 30.0f, TEXT( "" ) );
static TAutoConsoleVariable<int32> CVarDemoLoadCheckpointGarbageCollect( TEXT( "demo.LoadCheckpointGarbageCollect" ), 1, TEXT("If nonzero, CollectGarbage will be called during LoadCheckpoint after the old actors and connection are cleaned up." ) );
TAutoConsoleVariable<float> CVarCheckpointSaveMaxMSPerFrameOverride( TEXT( "demo.CheckpointSaveMaxMSPerFrameOverride" ), -1.0f, TEXT( "If >= 0, this value will override the CheckpointSaveMaxMSPerFrame member variable, which is the maximum time allowed each frame to spend on saving a checkpoint. If 0, it will save the checkpoint in a single frame, regardless of how long it takes." ) );
TAutoConsoleVariable<int32> CVarDemoClientRecordAsyncEndOfFrame( TEXT( "demo.ClientRecordAsyncEndOfFrame" ), 0, TEXT( "If true, TickFlush will be called on a thread in parallel with Slate." ) );
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:4600
Scope (from outer to inner):
file
function bool UDemoNetDriver::ShouldQueueBunchesForActorGUID
Source code excerpt:
bool UDemoNetDriver::ShouldQueueBunchesForActorGUID(FNetworkGUID InGUID) const
{
if (CVarDemoQueueCheckpointChannels.GetValueOnGameThread() == 0)
{
return false;
}
// While loading a checkpoint, queue most bunches so that we don't process them all on one frame.
if (bIsFastForwardingForCheckpoint)