demo.IncreaseRepPrioritizeThreshold
demo.IncreaseRepPrioritizeThreshold
#Overview
name: demo.IncreaseRepPrioritizeThreshold
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The % of Replicated to Prioritized actors at which prioritize time will be decreased.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of demo.IncreaseRepPrioritizeThreshold is to control the threshold at which the time spent prioritizing actors in demo recordings will be decreased. This setting is part of Unreal Engine’s demo recording and playback system.
This setting variable is primarily used in the Engine module, specifically within the demo recording subsystem. It’s referenced in the DemoNetDriver.cpp file, which is responsible for handling network-related aspects of demo recording and playback.
The value of this variable is set as a console variable (CVar) with a default value of 0.9 (90%). This means that by default, when 90% of actors are replicated compared to prioritized actors, the system will decrease the time spent on prioritization.
This variable interacts closely with several other demo-related variables:
- CVarDemoDecreaseRepPrioritizeThreshold
- CVarDemoMinimumRepPrioritizeTime
- CVarDemoMaximumRepPrioritizeTime
Developers must be aware that this variable is part of a dynamic system that adjusts prioritization time based on the ratio of replicated to prioritized actors. Changing this value will affect how aggressively the system reduces prioritization time, which can impact demo recording performance and quality.
Best practices when using this variable include:
- Keeping it balanced with CVarDemoDecreaseRepPrioritizeThreshold
- Testing thoroughly with different values to find the optimal setting for your specific game
- Considering the impact on both recording and playback performance
Regarding the associated variable CVarDemoIncreaseRepPrioritizeThreshold:
The purpose of CVarDemoIncreaseRepPrioritizeThreshold is to set the threshold at which the time spent prioritizing actors in demo recordings will be increased. It works in tandem with demo.IncreaseRepPrioritizeThreshold to manage the prioritization time dynamically.
This variable is also part of the Engine module’s demo recording subsystem and is used in the same DemoNetDriver.cpp file.
The value is set as a console variable with a default value of 0.9 (90%), the same as demo.IncreaseRepPrioritizeThreshold. However, in practice, these two variables should have different values to create a range for stable operation.
CVarDemoIncreaseRepPrioritizeThreshold interacts with the same set of variables as demo.IncreaseRepPrioritizeThreshold. They are used together in the AdjustConsiderTime function to determine how to adjust the prioritization time.
Developers should be aware that these two thresholds work together to create a “dead zone” where prioritization time remains stable. Setting them too close together may result in frequent adjustments, while setting them too far apart might make the system less responsive to changes.
Best practices include:
- Setting CVarDemoIncreaseRepPrioritizeThreshold lower than demo.IncreaseRepPrioritizeThreshold
- Adjusting both variables in tandem to find the right balance for your game
- Monitoring the impact on demo recording and playback performance when changing these values
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:82
Scope: file
Source code excerpt:
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."));
static TAutoConsoleVariable<float> CVarDemoMaximumRepPrioritizeTime(TEXT("demo.MaximumRepPrioritizePercent"), 0.7, TEXT("Maximum percent of time that may be spent prioritizing actors, regardless of throttling."));
static TAutoConsoleVariable<int32> CVarFastForwardLevelsPausePlayback(TEXT("demo.FastForwardLevelsPausePlayback"), 0, TEXT("If true, pause channels and playback while fast forward levels task is running."));
#Associated Variable and Callsites
This variable is associated with another variable named CVarDemoIncreaseRepPrioritizeThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:82
Scope: file
Source code excerpt:
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."));
static TAutoConsoleVariable<float> CVarDemoMaximumRepPrioritizeTime(TEXT("demo.MaximumRepPrioritizePercent"), 0.7, TEXT("Maximum percent of time that may be spent prioritizing actors, regardless of throttling."));
static TAutoConsoleVariable<int32> CVarFastForwardLevelsPausePlayback(TEXT("demo.FastForwardLevelsPausePlayback"), 0, TEXT("If true, pause channels and playback while fast forward levels task is running."));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp:5521
Scope (from outer to inner):
file
function void UDemoNetDriver::AdjustConsiderTime
Source code excerpt:
float DecreaseThreshold = CVarDemoDecreaseRepPrioritizeThreshold.GetValueOnAnyThread();
float IncreaseThreshold = CVarDemoIncreaseRepPrioritizeThreshold.GetValueOnAnyThread();
ConditionallySwap(DecreaseThreshold, IncreaseThreshold);
float MinRepTime = CVarDemoMinimumRepPrioritizeTime.GetValueOnAnyThread();
float MaxRepTime = CVarDemoMaximumRepPrioritizeTime.GetValueOnAnyThread();
ConditionallySwap(MinRepTime, MaxRepTime);
MinRepTime = FMath::Clamp<float>(MinRepTime, 0.1, 1.0);