MinDynamicBandwidth

MinDynamicBandwidth

#Overview

name: MinDynamicBandwidth

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MinDynamicBandwidth is to set the minimum bandwidth limit for individual network connections in a multiplayer game environment. It is used in the network management system of Unreal Engine to ensure that each connection has a guaranteed minimum amount of bandwidth available.

This setting variable is primarily used by the Game Networking subsystem of Unreal Engine. Specifically, it is utilized by the GameNetworkManager class, which is responsible for managing network-related aspects of the game.

The value of MinDynamicBandwidth is typically set in the game’s configuration files or through the project settings in the Unreal Editor. It is defined as a UPROPERTY with the ‘globalconfig’ specifier, which means it can be accessed and modified globally across the engine.

MinDynamicBandwidth interacts closely with MaxDynamicBandwidth and TotalNetBandwidth. These variables work together to determine the bandwidth allocation for each network connection. The actual bandwidth assigned to a connection is calculated using these variables, as seen in the CalculatedNetSpeed function.

Developers must be aware that setting MinDynamicBandwidth too low might result in poor network performance for some players, while setting it too high could limit the number of concurrent players the game can support effectively.

Best practices when using this variable include:

  1. Carefully balancing MinDynamicBandwidth with MaxDynamicBandwidth and TotalNetBandwidth to ensure optimal network performance.
  2. Testing the game with various bandwidth settings to find the best configuration for your specific game requirements.
  3. Considering the target platforms and expected network conditions when setting this value.
  4. Regularly monitoring and adjusting this value based on real-world performance data and player feedback.

#Setting Variables

#References In INI files

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

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:32, 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:64

Scope (from outer to inner):

file
class        class AGameNetworkManager : public AInfo

Source code excerpt:

	/** Minimum bandwidth set per connection after splitting TotalNetBandwidth */
	UPROPERTY(globalconfig)
	int32 MinDynamicBandwidth;

	/** Maximum bandwidth set per connection after splitting TotalNetBandwidth */
	UPROPERTY(globalconfig)
	int32 MaxDynamicBandwidth;

	//======================================================================================================================

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameNetworkManager.cpp:139

Scope (from outer to inner):

file
function     int32 AGameNetworkManager::CalculatedNetSpeed

Source code excerpt:

	}

	return FMath::Clamp(TotalNetBandwidth/NumPlayers, MinDynamicBandwidth, MaxDynamicBandwidth);
}

void AGameNetworkManager::StandbyCheatDetected(EStandbyType StandbyType) {}

bool AGameNetworkManager::WithinUpdateDelayBounds(APlayerController* PC, float LastUpdateTime) const
{

#Loc: <Workspace>/Engine/Source/Runtime/EngineSettings/Classes/GameNetworkManagerSettings.h:19

Scope (from outer to inner):

file
class        class UGameNetworkManagerSettings : public UObject

Source code excerpt:

	/** Minimum bandwidth dynamically set per connection. */
	UPROPERTY(globalconfig, EditAnywhere, Category=Bandwidth)
	int32 MinDynamicBandwidth;

	/** Maximum bandwidth dynamically set per connection. */
	UPROPERTY(globalconfig, EditAnywhere, Category=Bandwidth)
	int32 MaxDynamicBandwidth;

	/** Total available bandwidth for listen server, split dynamically across net connections. */