MaxInternetClientRate
MaxInternetClientRate
#Overview
name: MaxInternetClientRate
The value of this variable can be defined or overridden in .ini config files. 4
.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 MaxInternetClientRate is to set the maximum data transfer rate for internet clients connecting to a server in an Unreal Engine networked game. This setting is used to control network bandwidth usage and manage performance for online multiplayer games.
MaxInternetClientRate is primarily used by the Unreal Engine’s networking subsystem, specifically within the UNetDriver class. This class is responsible for managing network connections and data transfer in multiplayer games.
The value of this variable is set in the UNetDriver constructor with a default value of 10000 (bytes per second). It can be modified through configuration files or at runtime.
MaxInternetClientRate interacts closely with MaxClientRate. In the UWorld::Listen function, there’s a check to potentially adjust MaxClientRate based on MaxInternetClientRate when the game is not in LAN mode and certain conditions are met.
Developers must be aware that this variable directly impacts the network performance of their game. Setting it too low may result in reduced game responsiveness for clients, while setting it too high might overwhelm slower internet connections.
Best practices when using this variable include:
- Carefully tuning the value based on the game’s networking requirements and target audience’s typical internet speeds.
- Consider providing in-game options for players to adjust this setting within a reasonable range.
- Regularly test the game’s network performance with various MaxInternetClientRate values to ensure optimal gameplay experience.
- Be mindful of the interaction between MaxInternetClientRate and MaxClientRate, ensuring they are set appropriately for both internet and LAN play scenarios.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1636, section: [/Script/OnlineSubsystemUtils.IpNetDriver]
- INI Section:
/Script/OnlineSubsystemUtils.IpNetDriver
- Raw value:
100000
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:2263, section: [/Script/SteamSockets.SteamSocketsNetDriver]
- INI Section:
/Script/SteamSockets.SteamSocketsNetDriver
- Raw value:
100000
- Is Array:
False
Location: <Workspace>/Engine/Plugins/Experimental/WebSocketNetworking/Config/BaseWebSocketNetDriver.ini:16, section: [/Script/WebSocketNetworking.WebSocketNetDriver]
- INI Section:
/Script/WebSocketNetworking.WebSocketNetDriver
- Raw value:
10000
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:91, section: [/Script/OnlineSubsystemUtils.IpNetDriver]
- INI Section:
/Script/OnlineSubsystemUtils.IpNetDriver
- Raw value:
200000
- 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/Engine/NetDriver.h:870
Scope (from outer to inner):
file
class class UNetDriver : public UObject, public FExec
Source code excerpt:
/** @todo document */
UPROPERTY(Config)
int32 MaxInternetClientRate;
/** @todo document */
UPROPERTY(Config)
int32 MaxClientRate;
/** Amount of time a server will wait before traveling to next map, gives clients time to receive final RPCs on existing level @see NextSwitchCountdown */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:493
Scope (from outer to inner):
file
function UNetDriver::UNetDriver
Source code excerpt:
UNetDriver::UNetDriver(const FObjectInitializer& ObjectInitializer)
: UObject(ObjectInitializer)
, MaxInternetClientRate(10000)
, MaxClientRate(15000)
, ServerConnection(nullptr)
, ClientConnections()
, MappedClientConnections()
, RecentlyDisconnectedClients()
, RecentlyDisconnectedTrackingTime(0)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:6848
Scope (from outer to inner):
file
function bool UWorld::Listen
Source code excerpt:
static const bool bLanPlay = FParse::Param(FCommandLine::Get(),TEXT("lanplay"));
const bool bLanSpeed = bLanPlay || InURL.HasOption(TEXT("LAN"));
if ( !bLanSpeed && (NetDriver->MaxInternetClientRate < NetDriver->MaxClientRate) && (NetDriver->MaxInternetClientRate > 2500) )
{
NetDriver->MaxClientRate = NetDriver->MaxInternetClientRate;
}
NextSwitchCountdown = NetDriver->ServerTravelPause;
return true;
#else
return false;