p.NetEnableSkipProxyPredictionOnNetUpdate
p.NetEnableSkipProxyPredictionOnNetUpdate
#Overview
name: p.NetEnableSkipProxyPredictionOnNetUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow proxies to skip prediction on frames with a network position update, if bNetworkSkipProxyPredictionOnNetUpdate is also true on the movement component.\n0: Disable, 1: Enable
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.NetEnableSkipProxyPredictionOnNetUpdate is to control whether proxy characters can skip prediction on frames where they receive a network position update. This setting is part of the character movement system in Unreal Engine 5.
This setting variable is primarily used by the CharacterMovementComponent, which is a core part of Unreal Engine’s gameplay framework. It’s specifically related to network gameplay and character movement prediction.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console. By default, it is set to 1 (enabled).
This variable interacts with the bNetworkSkipProxyPredictionOnNetUpdate boolean property of the CharacterMovementComponent. Both need to be true for the proxy prediction skip to occur.
Developers must be aware that this setting affects network gameplay performance and behavior. Enabling this setting can potentially reduce network overhead and improve performance, but it may also impact the smoothness of character movement for proxy characters (characters controlled by remote players).
Best practices when using this variable include:
- Testing thoroughly in networked environments to ensure it doesn’t negatively impact gameplay experience.
- Considering the trade-off between performance and movement smoothness.
- Potentially exposing this as a configurable option for players with different network conditions.
The associated variable NetEnableSkipProxyPredictionOnNetUpdate is the actual integer variable that stores the value. It’s used internally within the CharacterMovementComponent to check whether the skip prediction feature is enabled.
The purpose of NetEnableSkipProxyPredictionOnNetUpdate is the same as p.NetEnableSkipProxyPredictionOnNetUpdate, as they are directly linked. It’s the internal representation of the console variable.
This variable is used in the SimulateMovement function of the CharacterMovementComponent to determine whether to simulate movement for proxy characters on a given frame.
Developers should be aware that changing NetEnableSkipProxyPredictionOnNetUpdate directly in code won’t affect the console variable. Always use the console variable p.NetEnableSkipProxyPredictionOnNetUpdate to modify this setting.
Best practices for NetEnableSkipProxyPredictionOnNetUpdate include not modifying it directly in code, and instead using the console variable for any runtime changes or configuration.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:133
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
static int32 NetEnableSkipProxyPredictionOnNetUpdate = 1;
FAutoConsoleVariableRef CVarNetEnableSkipProxyPredictionOnNetUpdate(
TEXT("p.NetEnableSkipProxyPredictionOnNetUpdate"),
NetEnableSkipProxyPredictionOnNetUpdate,
TEXT("Whether to allow proxies to skip prediction on frames with a network position update, if bNetworkSkipProxyPredictionOnNetUpdate is also true on the movement component.\n")
TEXT("0: Disable, 1: Enable"),
ECVF_Default);
static int32 EnableQueuedAnimEventsOnServer = 1;
#Associated Variable and Callsites
This variable is associated with another variable named NetEnableSkipProxyPredictionOnNetUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:131
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
// Latent proxy prediction
static int32 NetEnableSkipProxyPredictionOnNetUpdate = 1;
FAutoConsoleVariableRef CVarNetEnableSkipProxyPredictionOnNetUpdate(
TEXT("p.NetEnableSkipProxyPredictionOnNetUpdate"),
NetEnableSkipProxyPredictionOnNetUpdate,
TEXT("Whether to allow proxies to skip prediction on frames with a network position update, if bNetworkSkipProxyPredictionOnNetUpdate is also true on the movement component.\n")
TEXT("0: Disable, 1: Enable"),
ECVF_Default);
static int32 EnableQueuedAnimEventsOnServer = 1;
FAutoConsoleVariableRef CVarEnableQueuedAnimEventsOnServer(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:2134
Scope (from outer to inner):
file
function void UCharacterMovementComponent::SimulateMovement
Source code excerpt:
// May only need to simulate forward on frames where we haven't just received a new position update.
if (!bHandledNetUpdate || !bNetworkSkipProxyPredictionOnNetUpdate || !CharacterMovementCVars::NetEnableSkipProxyPredictionOnNetUpdate)
{
UE_LOG(LogCharacterMovement, Verbose, TEXT("Proxy %s simulating movement"), *GetNameSafe(CharacterOwner));
FStepDownResult StepDownResult;
MoveSmooth(Velocity, DeltaSeconds, &StepDownResult);
// find floor and check if falling