net.NetServerMoveTimestampExpiredWarningThreshold
net.NetServerMoveTimestampExpiredWarningThreshold
#Overview
name: net.NetServerMoveTimestampExpiredWarningThreshold
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Tolerance for ServerMove() to warn when client moves are expired more than this time threshold behind the server.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.NetServerMoveTimestampExpiredWarningThreshold is to set a tolerance threshold for warning about expired client moves in the Character Movement Component of Unreal Engine 5.
This setting variable is primarily used in the Character Movement Component, which is part of the Engine module. It specifically relates to the networking and movement systems of characters in multiplayer games.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through the console. It’s initialized with a default value of 1.0f.
The associated variable NetServerMoveTimestampExpiredWarningThreshold directly interacts with net.NetServerMoveTimestampExpiredWarningThreshold. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the logging of expired client moves on the server. It determines when a warning log is generated instead of a regular log entry. This is important for diagnosing network-related movement issues in multiplayer games.
Best practices when using this variable include:
- Adjusting it based on your game’s network conditions and movement requirements.
- Using it in conjunction with other network-related settings for optimal performance.
- Monitoring logs during development and testing to catch potential movement synchronization issues early.
Regarding the associated variable NetServerMoveTimestampExpiredWarningThreshold:
- Its purpose is identical to net.NetServerMoveTimestampExpiredWarningThreshold.
- It’s used directly in the C++ code of the Character Movement Component.
- It’s accessed through the CharacterMovementCVars namespace.
- Developers should treat it as the internal representation of the console variable.
When working with either variable, developers should consider the impact on network performance and player experience, especially in games with fast-paced movement or large numbers of players.
#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:231
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
static float NetServerMoveTimestampExpiredWarningThreshold = 1.0f;
FAutoConsoleVariableRef CVarNetServerMoveTimestampExpiredWarningThreshold(
TEXT("net.NetServerMoveTimestampExpiredWarningThreshold"),
NetServerMoveTimestampExpiredWarningThreshold,
TEXT("Tolerance for ServerMove() to warn when client moves are expired more than this time threshold behind the server."),
ECVF_Default);
int32 AsyncCharacterMovement = 0;
FAutoConsoleVariableRef CVarAsyncCharacterMovement(
#Associated Variable and Callsites
This variable is associated with another variable named NetServerMoveTimestampExpiredWarningThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:229
Scope (from outer to inner):
file
namespace CharacterMovementCVars
Source code excerpt:
ECVF_Default);
static float NetServerMoveTimestampExpiredWarningThreshold = 1.0f;
FAutoConsoleVariableRef CVarNetServerMoveTimestampExpiredWarningThreshold(
TEXT("net.NetServerMoveTimestampExpiredWarningThreshold"),
NetServerMoveTimestampExpiredWarningThreshold,
TEXT("Tolerance for ServerMove() to warn when client moves are expired more than this time threshold behind the server."),
ECVF_Default);
int32 AsyncCharacterMovement = 0;
FAutoConsoleVariableRef CVarAsyncCharacterMovement(
TEXT("p.AsyncCharacterMovement"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:9583
Scope (from outer to inner):
file
function void UCharacterMovementComponent::ServerMove_PerformMovement
Source code excerpt:
const float ServerTimeStamp = ServerData->CurrentClientTimeStamp;
// This is more severe if the timestamp has a large discrepancy and hasn't been recently reset.
if (ServerTimeStamp > 1.0f && FMath::Abs(ServerTimeStamp - ClientTimeStamp) > CharacterMovementCVars::NetServerMoveTimestampExpiredWarningThreshold)
{
UE_LOG(LogNetPlayerMovement, Warning, TEXT("ServerMove: TimeStamp expired: %f, CurrentTimeStamp: %f, Character: %s"), ClientTimeStamp, ServerTimeStamp, *GetNameSafe(CharacterOwner));
}
else
{
UE_LOG(LogNetPlayerMovement, Log, TEXT("ServerMove: TimeStamp expired: %f, CurrentTimeStamp: %f, Character: %s"), ClientTimeStamp, ServerTimeStamp, *GetNameSafe(CharacterOwner));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:9695
Scope (from outer to inner):
file
function void UCharacterMovementComponent::ServerMove_Implementation
Source code excerpt:
const float ServerTimeStamp = ServerData->CurrentClientTimeStamp;
// This is more severe if the timestamp has a large discrepancy and hasn't been recently reset.
if (ServerTimeStamp > 1.0f && FMath::Abs(ServerTimeStamp - TimeStamp) > CharacterMovementCVars::NetServerMoveTimestampExpiredWarningThreshold)
{
UE_LOG(LogNetPlayerMovement, Warning, TEXT("ServerMove: TimeStamp expired: %f, CurrentTimeStamp: %f, Character: %s"), TimeStamp, ServerTimeStamp, *GetNameSafe(CharacterOwner));
}
else
{
UE_LOG(LogNetPlayerMovement, Log, TEXT("ServerMove: TimeStamp expired: %f, CurrentTimeStamp: %f, Character: %s"), TimeStamp, ServerTimeStamp, *GetNameSafe(CharacterOwner));