p.NetMoveCombiningAttachedLocationTolerance

p.NetMoveCombiningAttachedLocationTolerance

#Overview

name: p.NetMoveCombiningAttachedLocationTolerance

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.NetMoveCombiningAttachedLocationTolerance is to set a tolerance value for relative location changes when combining character movement updates in networked gameplay.

This setting variable is primarily used by the Character Movement Component in Unreal Engine’s gameplay framework. It’s part of the engine’s networking and movement systems, specifically dealing with network replication of character movement.

The value of this variable is set in the CharacterMovementComponent.cpp file, within the CharacterMovementCVars namespace. It’s initialized with a default value of 0.01f and can be modified at runtime through the console variable system.

The associated variable NetMoveCombiningAttachedLocationTolerance directly interacts with p.NetMoveCombiningAttachedLocationTolerance. They share the same value, with the console variable (p.NetMoveCombiningAttachedLocationTolerance) allowing for runtime modification of the static variable (NetMoveCombiningAttachedLocationTolerance).

Developers must be aware that this variable affects the precision of character movement replication. A smaller value will result in more precise movement updates but may increase network traffic, while a larger value can reduce network load at the cost of some movement accuracy.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your game, considering the balance between movement precision and network performance.
  2. Testing thoroughly with different network conditions to ensure optimal performance.
  3. Considering the implications on gameplay, especially for fast-paced or precision-based games.

Regarding the associated variable NetMoveCombiningAttachedLocationTolerance:

#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:179

Scope (from outer to inner):

file
namespace    CharacterMovementCVars

Source code excerpt:

	static float NetMoveCombiningAttachedLocationTolerance = 0.01f;
	FAutoConsoleVariableRef CVarNetMoveCombiningAttachedLocationTolerance(
		TEXT("p.NetMoveCombiningAttachedLocationTolerance"),
		NetMoveCombiningAttachedLocationTolerance,
		TEXT("Tolerance for relative location attachment change when combining moves. Small tolerances allow for very slight jitter due to transform updates."),
		ECVF_Default);

	static float NetMoveCombiningAttachedRotationTolerance = 0.01f;
	FAutoConsoleVariableRef CVarNetMoveCombiningAttachedRotationTolerance(

#Associated Variable and Callsites

This variable is associated with another variable named NetMoveCombiningAttachedLocationTolerance. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:177

Scope (from outer to inner):

file
namespace    CharacterMovementCVars

Source code excerpt:

		ECVF_Default);

	static float NetMoveCombiningAttachedLocationTolerance = 0.01f;
	FAutoConsoleVariableRef CVarNetMoveCombiningAttachedLocationTolerance(
		TEXT("p.NetMoveCombiningAttachedLocationTolerance"),
		NetMoveCombiningAttachedLocationTolerance,
		TEXT("Tolerance for relative location attachment change when combining moves. Small tolerances allow for very slight jitter due to transform updates."),
		ECVF_Default);

	static float NetMoveCombiningAttachedRotationTolerance = 0.01f;
	FAutoConsoleVariableRef CVarNetMoveCombiningAttachedRotationTolerance(
		TEXT("p.NetMoveCombiningAttachedRotationTolerance"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:12609

Scope (from outer to inner):

file
function     bool FSavedMove_Character::CanCombineWith

Source code excerpt:

		// If attached, no combining if relative location changed.
		const FVector RelativeLocationDelta = (StartAttachRelativeLocation - NewMove->StartAttachRelativeLocation);
		if (!RelativeLocationDelta.IsNearlyZero(CharacterMovementCVars::NetMoveCombiningAttachedLocationTolerance))
		{
			//UE_LOG(LogCharacterMovement, Warning, TEXT("NoCombine: DeltaLocation(%s)"), *RelativeLocationDelta.ToString());
			return false;
		}
		// For rotation, Yaw doesn't matter for capsules
		FRotator RelativeRotationDelta = StartAttachRelativeRotation - NewMove->StartAttachRelativeRotation;