demo.FastForwardIgnoreRPCs
demo.FastForwardIgnoreRPCs
#Overview
name: demo.FastForwardIgnoreRPCs
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, RPCs will be discarded during playback fast forward.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.FastForwardIgnoreRPCs is to control whether Remote Procedure Calls (RPCs) should be discarded during playback fast-forward in Unreal Engine’s demo recording and playback system.
This setting variable is part of the Unreal Engine’s networking and demo recording subsystem. It is primarily used in the DemoNetDriver, which is responsible for recording and playing back gameplay demonstrations.
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 CVarDemoFastForwardIgnoreRPCs directly interacts with demo.FastForwardIgnoreRPCs. They share the same value and purpose.
Developers must be aware that when this variable is set to true (1), RPCs will be discarded during fast-forward playback. This can significantly affect the behavior of the replay, especially for gameplay elements that rely heavily on RPCs for state updates or event triggering.
Best practices when using this variable include:
- Consider the impact on gameplay consistency when discarding RPCs during fast-forward.
- Test thoroughly to ensure that skipping RPCs doesn’t lead to unexpected behavior or desynchronization.
- Use this setting judiciously, balancing between playback performance and maintaining critical game state information.
- Be aware of how this setting interacts with other demo playback settings, such as checkpoints and fast-forwarding.
Regarding the associated variable CVarDemoFastForwardIgnoreRPCs:
This is the actual console variable that controls the behavior. It is used in the UDemoNetDriver::ShouldIgnoreRPCs() function to determine whether RPCs should be ignored. The function checks if CVarDemoFastForwardIgnoreRPCs is true and if the demo is either loading a checkpoint or fast-forwarding.
Developers should note that this variable’s value is accessed using GetValueOnAnyThread(), which suggests it can be safely read from multiple threads. However, changing its value during runtime might have immediate effects on demo playback behavior, so it should be done with caution.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:65
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDemoRecordHzWhenNotRelevant( TEXT( "demo.RecordHzWhenNotRelevant" ), 2.0f, TEXT( "Record at this frequency when actor is not relevant." ) );
static TAutoConsoleVariable<int32> CVarLoopDemo(TEXT("demo.Loop"), 0, TEXT("<1> : play replay from beginning once it reaches the end / <0> : stop replay at the end"));
static TAutoConsoleVariable<int32> CVarDemoFastForwardIgnoreRPCs( TEXT( "demo.FastForwardIgnoreRPCs" ), 1, TEXT( "If true, RPCs will be discarded during playback fast forward." ) );
static TAutoConsoleVariable<int32> CVarDemoLateActorDormancyCheck(TEXT("demo.LateActorDormancyCheck"), 1, TEXT("If true, check if an actor should become dormant as late as possible- when serializing it to the demo archive."));
static TAutoConsoleVariable<int32> CVarDemoJumpToEndOfLiveReplay(TEXT("demo.JumpToEndOfLiveReplay"), 1, TEXT("If true, fast forward to a few seconds before the end when starting playback, if the replay is still being recorded."));
static TAutoConsoleVariable<int32> CVarDemoInternalPauseChannels(TEXT("demo.InternalPauseChannels"), 1, TEXT("If true, run standard logic for PauseChannels rather than letting the game handle it via FOnPauseChannelsDelegate."));
static int32 GDemoLoopCount = 0;
#Associated Variable and Callsites
This variable is associated with another variable named CVarDemoFastForwardIgnoreRPCs
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:65
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarDemoRecordHzWhenNotRelevant( TEXT( "demo.RecordHzWhenNotRelevant" ), 2.0f, TEXT( "Record at this frequency when actor is not relevant." ) );
static TAutoConsoleVariable<int32> CVarLoopDemo(TEXT("demo.Loop"), 0, TEXT("<1> : play replay from beginning once it reaches the end / <0> : stop replay at the end"));
static TAutoConsoleVariable<int32> CVarDemoFastForwardIgnoreRPCs( TEXT( "demo.FastForwardIgnoreRPCs" ), 1, TEXT( "If true, RPCs will be discarded during playback fast forward." ) );
static TAutoConsoleVariable<int32> CVarDemoLateActorDormancyCheck(TEXT("demo.LateActorDormancyCheck"), 1, TEXT("If true, check if an actor should become dormant as late as possible- when serializing it to the demo archive."));
static TAutoConsoleVariable<int32> CVarDemoJumpToEndOfLiveReplay(TEXT("demo.JumpToEndOfLiveReplay"), 1, TEXT("If true, fast forward to a few seconds before the end when starting playback, if the replay is still being recorded."));
static TAutoConsoleVariable<int32> CVarDemoInternalPauseChannels(TEXT("demo.InternalPauseChannels"), 1, TEXT("If true, run standard logic for PauseChannels rather than letting the game handle it via FOnPauseChannelsDelegate."));
static int32 GDemoLoopCount = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:4616
Scope (from outer to inner):
file
function bool UDemoNetDriver::ShouldIgnoreRPCs
Source code excerpt:
bool UDemoNetDriver::ShouldIgnoreRPCs() const
{
return (CVarDemoFastForwardIgnoreRPCs.GetValueOnAnyThread() && (ReplayHelper.bIsLoadingCheckpoint || bIsFastForwarding));
}
FNetworkGUID UDemoNetDriver::GetGUIDForActor(const AActor* InActor) const
{
UNetConnection* Connection = ServerConnection;