ClientNetSendMoveDeltaTime
ClientNetSendMoveDeltaTime
#Overview
name: ClientNetSendMoveDeltaTime
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ClientNetSendMoveDeltaTime is to control the frequency of character movement updates sent from the client to the server in Unreal Engine’s networking system. It sets the default minimum time delta between client movement updates, allowing for optimization of network bandwidth usage.
This setting variable is primarily used by the Character Movement Component within Unreal Engine’s gameplay framework. It’s part of the GameNetworkManager class, which is responsible for managing network-related game settings.
The value of ClientNetSendMoveDeltaTime is set in the constructor of the AGameNetworkManager class, with a default value of 0.0166f (approximately 60 updates per second). However, this value can be overridden through configuration files since it’s marked with the UPROPERTY(GlobalConfig) macro.
ClientNetSendMoveDeltaTime interacts with several other variables:
- ClientNetSendMoveDeltaTimeThrottled
- ClientNetSendMoveDeltaTimeStationary
- ClientNetSendMoveThrottleAtNetSpeed
- ClientNetSendMoveThrottleOverPlayerCount
These variables work together to adjust the update frequency based on network conditions and player count.
Developers must be aware that this variable affects network performance and game responsiveness. Lower values will result in more frequent updates but higher bandwidth usage, while higher values will reduce network traffic but may impact game feel.
Best practices when using this variable include:
- Carefully balancing it with other related variables to optimize for different network conditions.
- Testing thoroughly with various network speeds and player counts to ensure smooth gameplay.
- Considering different values for different game modes or player counts.
- Monitoring server performance and adjusting as necessary to prevent overload.
- Documenting any changes made to this value for future reference and tuning.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:33, section: [/Script/Engine.GameNetworkManager]
- INI Section:
/Script/Engine.GameNetworkManager
- Raw value:
0.0166
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/GameNetworkManager.h:150
Scope (from outer to inner):
file
class class AGameNetworkManager : public AInfo
Source code excerpt:
/**
* ClientNetSendMoveDeltaTime is the default minimum time delta of CharacterMovement client moves to the server. When updates occur more frequently, they may be combined to save bandwidth.
* This value is not used when player count is over ClientNetSendMoveThrottleOverPlayerCount or player net speed is <= ClientNetSendMoveThrottleAtNetSpeed (see ClientNetSendMoveDeltaTimeThrottled).
*/
UPROPERTY(GlobalConfig)
float ClientNetSendMoveDeltaTime;
/** ClientNetSendMoveDeltaTimeThrottled is used in place of ClientNetSendMoveDeltaTime when player count is high or net speed is low. See ClientNetSendMoveDeltaTime for more info. */
UPROPERTY(GlobalConfig)
float ClientNetSendMoveDeltaTimeThrottled;
/** ClientNetSendMoveDeltaTimeStationary is used when players are determined to not be moving or changing their view. See ClientNetSendMoveDeltaTime for more info. */
UPROPERTY(GlobalConfig)
float ClientNetSendMoveDeltaTimeStationary;
/** When player net speed (CurrentNetSpeed, based on ConfiguredInternetSpeed or ConfiguredLanSpeed) is less than or equal to this amount, ClientNetSendMoveDeltaTimeThrottled is used instead of ClientNetSendMoveDeltaTime. */
UPROPERTY(GlobalConfig)
int32 ClientNetSendMoveThrottleAtNetSpeed;
/** When player count is greater than this amount, ClientNetSendMoveDeltaTimeThrottled is used instead of ClientNetSendMoveDeltaTime. */
UPROPERTY(GlobalConfig)
int32 ClientNetSendMoveThrottleOverPlayerCount;
/** Minimum delay between the server sending error corrections to a client, in seconds. */
UPROPERTY(GlobalConfig)
float ClientErrorUpdateRateLimit;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:12427
Scope (from outer to inner):
file
function float UCharacterMovementComponent::GetClientNetSendDeltaTime
Source code excerpt:
const AGameStateBase* const GameState = MyWorld->GetGameState();
const AGameNetworkManager* GameNetworkManager = (const AGameNetworkManager*)(AGameNetworkManager::StaticClass()->GetDefaultObject());
float NetMoveDelta = GameNetworkManager->ClientNetSendMoveDeltaTime;
if (PC && Player)
{
// send moves more frequently in small games where server isn't likely to be saturated
if ((Player->CurrentNetSpeed > GameNetworkManager->ClientNetSendMoveThrottleAtNetSpeed) && (GameState != nullptr) && (GameState->PlayerArray.Num() <= GameNetworkManager->ClientNetSendMoveThrottleOverPlayerCount))
{
NetMoveDelta = GameNetworkManager->ClientNetSendMoveDeltaTime;
}
else
{
NetMoveDelta = FMath::Max(GameNetworkManager->ClientNetSendMoveDeltaTimeThrottled, 2 * GameNetworkManager->MoveRepSize / Player->CurrentNetSpeed);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameNetworkManager.cpp:33
Scope (from outer to inner):
file
function AGameNetworkManager::AGameNetworkManager
Source code excerpt:
MaxMoveDeltaTime = 0.125f;
MaxClientSmoothingDeltaTime = 0.50f;
ClientNetSendMoveDeltaTime = 0.0166f;
ClientNetSendMoveDeltaTimeThrottled = 0.0222f;
ClientNetSendMoveDeltaTimeStationary = 0.0166f;
ClientNetSendMoveThrottleAtNetSpeed = 10000;
ClientNetSendMoveThrottleOverPlayerCount = 10;
ClientAuthorativePosition = false;
ClientErrorUpdateRateLimit = 0.0f;