p.NetEnableMoveCombiningOnStaticBaseChange
p.NetEnableMoveCombiningOnStaticBaseChange
#Overview
name: p.NetEnableMoveCombiningOnStaticBaseChange
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow combining client moves when moving between static geometry.\n0: Disable, 1: Enable
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.NetEnableMoveCombiningOnStaticBaseChange is to control whether client moves can be combined when a character is moving between static geometry in the game’s networking system.
This setting variable is primarily used by the Character Movement Component, which is part of the Unreal Engine’s core gameplay framework. It affects how character movement is processed and optimized in networked gameplay scenarios.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (enabled) but can be changed at runtime through console commands or configuration files.
The associated variable NetEnableMoveCombiningOnStaticBaseChange directly interacts with p.NetEnableMoveCombiningOnStaticBaseChange. They share the same value and purpose.
Developers must be aware that this variable affects network optimization for character movement. When enabled (value 1), it allows the engine to combine multiple small movement updates into larger, more efficient network packets when characters are moving between static geometry. When disabled (value 0), each movement update is sent separately, which may increase network traffic but could provide more precise movement replication in some scenarios.
Best practices when using this variable include:
- Leave it enabled (default value of 1) for most scenarios, as it helps optimize network performance.
- Consider disabling it if you notice issues with character movement precision, especially in games that require extremely accurate positioning.
- Test thoroughly with both settings in networked environments to ensure it doesn’t negatively impact your specific game’s movement requirements.
- Be aware that changing this setting may require adjustments to other movement-related parameters to maintain the desired gameplay feel.
Regarding the associated variable NetEnableMoveCombiningOnStaticBaseChange:
This is an internal variable that directly reflects the value of the console variable. It’s used within the Character Movement Component’s code to determine whether move combining should be allowed. The variable is checked in the FSavedMove_Character::CanCombineWith function to decide if moves can be combined when the character’s base changes.
Developers should not modify this variable directly in code. Instead, they should use the console variable p.NetEnableMoveCombiningOnStaticBaseChange to control this behavior. This ensures that the setting can be easily adjusted during development and potentially by end-users if exposed through game settings.
#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:171
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
static int32 NetEnableMoveCombiningOnStaticBaseChange = 1;
FAutoConsoleVariableRef CVarNetEnableMoveCombiningOnStaticBaseChange(
TEXT("p.NetEnableMoveCombiningOnStaticBaseChange"),
NetEnableMoveCombiningOnStaticBaseChange,
TEXT("Whether to allow combining client moves when moving between static geometry.\n")
TEXT("0: Disable, 1: Enable"),
ECVF_Default);
static float NetMoveCombiningAttachedLocationTolerance = 0.01f;
#Associated Variable and Callsites
This variable is associated with another variable named NetEnableMoveCombiningOnStaticBaseChange
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:169
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
ECVF_Default);
static int32 NetEnableMoveCombiningOnStaticBaseChange = 1;
FAutoConsoleVariableRef CVarNetEnableMoveCombiningOnStaticBaseChange(
TEXT("p.NetEnableMoveCombiningOnStaticBaseChange"),
NetEnableMoveCombiningOnStaticBaseChange,
TEXT("Whether to allow combining client moves when moving between static geometry.\n")
TEXT("0: Disable, 1: Enable"),
ECVF_Default);
static float NetMoveCombiningAttachedLocationTolerance = 0.01f;
FAutoConsoleVariableRef CVarNetMoveCombiningAttachedLocationTolerance(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:12556
Scope (from outer to inner):
file
function bool FSavedMove_Character::CanCombineWith
Source code excerpt:
// Only need to prevent combining when on a dynamic base that changes (unless forced off via CVar). Again, because relative location can change.
const bool bPreventOnStaticBaseChange = (CharacterMovementCVars::NetEnableMoveCombiningOnStaticBaseChange == 0);
if (bPreventOnStaticBaseChange || (bDynamicBaseOld || bDynamicBaseNew))
{
if (OldBasePtr != NewBasePtr)
{
return false;
}