ClientNetSendMoveThrottleAtNetSpeed

ClientNetSendMoveThrottleAtNetSpeed

#Overview

name: ClientNetSendMoveThrottleAtNetSpeed

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 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ClientNetSendMoveThrottleAtNetSpeed is to set a threshold for network speed, below which the game will use a throttled delta time for client movement updates to conserve bandwidth.

This setting variable is primarily used by the Unreal Engine’s networking and movement systems, specifically within the Character Movement Component and Game Network Manager.

The value of this variable is set in the AGameNetworkManager constructor in GameNetworkManager.cpp, with a default value of 10000. It can be modified through engine configuration files as it’s marked with the UPROPERTY(GlobalConfig) macro.

ClientNetSendMoveThrottleAtNetSpeed interacts closely with other network-related variables such as ClientNetSendMoveDeltaTime, ClientNetSendMoveDeltaTimeThrottled, and ClientNetSendMoveThrottleOverPlayerCount. These variables work together to determine the frequency of client movement updates sent to the server.

Developers must be aware that this variable affects the network performance and responsiveness of character movement in multiplayer games. Setting it too low might cause unnecessary throttling, while setting it too high might not effectively reduce network traffic in low-bandwidth scenarios.

Best practices when using this variable include:

  1. Carefully tuning it based on your game’s specific network requirements and target platforms.
  2. Testing thoroughly with various network conditions to ensure smooth gameplay.
  3. Considering the interplay between this variable and other related network settings.
  4. Monitoring network performance metrics to validate the effectiveness of your chosen value.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:36, section: [/Script/Engine.GameNetworkManager]

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

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. */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/GameNetworkManager.h:166

Scope (from outer to inner):

file
class        class AGameNetworkManager : public AInfo

Source code excerpt:

	/** 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. */

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

Scope (from outer to inner):

file
function     float UCharacterMovementComponent::GetClientNetSendDeltaTime

Source code excerpt:

	{
		// 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:36

Scope (from outer to inner):

file
function     AGameNetworkManager::AGameNetworkManager

Source code excerpt:

	ClientNetSendMoveDeltaTimeThrottled = 0.0222f;
	ClientNetSendMoveDeltaTimeStationary = 0.0166f;
	ClientNetSendMoveThrottleAtNetSpeed = 10000;
	ClientNetSendMoveThrottleOverPlayerCount = 10;
	ClientAuthorativePosition = false;
	ClientErrorUpdateRateLimit = 0.0f;
	ClientNetCamUpdateDeltaTime = 0.0166f;
	ClientNetCamUpdatePositionLimit = 1000.0f;
	bMovementTimeDiscrepancyDetection = false;