demo.FastForwardSkipRepNotifies
demo.FastForwardSkipRepNotifies
#Overview
name: demo.FastForwardSkipRepNotifies
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, the driver will optimize fast-forwarding by deferring calls to RepNotify functions until the fast-forward is complete.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.FastForwardSkipRepNotifies is to optimize the fast-forwarding process in Unreal Engine’s demo playback system by deferring calls to RepNotify functions until the fast-forward is complete.
This setting variable is primarily used in the Unreal Engine’s networking and demo playback subsystem, specifically within the DemoNetDriver module. It affects how the engine handles replication notifications during fast-forwarding of demo playbacks.
The value of this variable is set as a console variable (CVar) with an initial value of 1, meaning it’s enabled by default. It can be changed at runtime through console commands or programmatically.
The associated variable CVarDemoFastForwardSkipRepNotifies directly interacts with demo.FastForwardSkipRepNotifies. They share the same value and purpose.
Developers must be aware that when this variable is enabled (set to non-zero), it will affect the timing of RepNotify function calls during fast-forwarding. This can potentially impact gameplay or visual elements that rely on immediate replication notifications.
Best practices when using this variable include:
- Testing the game thoroughly with both enabled and disabled states to ensure correct behavior in all scenarios.
- Being cautious when disabling this optimization, as it may impact performance during fast-forwarding.
- Considering the trade-off between performance optimization and immediate updates when deciding whether to use this feature.
Regarding the associated variable CVarDemoFastForwardSkipRepNotifies:
- It’s implemented as a TAutoConsoleVariable
, allowing for easy runtime modification. - It’s used in the UDemoNetDriver::ShouldSkipRepNotifies() function to determine whether to skip RepNotifies during fast-forwarding.
- The function checks if the variable is non-zero and if the driver is currently fast-forwarding (bIsFastForwarding).
- Developers should be aware that this function can affect the behavior of replication notifications throughout the demo playback system.
When working with both variables, developers should ensure consistency in their values and be mindful of their impact on demo playback behavior and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:52
Scope: file
Source code excerpt:
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" ) );
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." ) );
#Associated Variable and Callsites
This variable is associated with another variable named CVarDemoFastForwardSkipRepNotifies
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:52
Scope: file
Source code excerpt:
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" ) );
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." ) );
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:1547
Scope (from outer to inner):
file
function bool UDemoNetDriver::ShouldSkipRepNotifies
Source code excerpt:
bool UDemoNetDriver::ShouldSkipRepNotifies() const
{
if (CVarDemoFastForwardSkipRepNotifies.GetValueOnAnyThread() != 0)
{
return bIsFastForwarding;
}
return false;
}