UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPacketSimulationSettings Struct Reference

#include <NetDriver.h>

Public Member Functions

ENGINE_API void LoadConfig (const TCHAR *OptionalQualifier=nullptr)
 
ENGINE_API bool LoadEmulationProfile (const TCHAR *ProfileName)
 
ENGINE_API void ApplySettings (const FPacketSimulationSettings &NewSettings)
 
ENGINE_API void ValidateSettings ()
 
ENGINE_API void ResetSettings ()
 
bool ShouldDropPacketOfSize (int32 NumBits) const
 
ENGINE_API bool ParseSettings (const TCHAR *Stream, const TCHAR *OptionalQualifier=nullptr)
 
ENGINE_API bool ParseHelper (const TCHAR *Cmd, const TCHAR *Name, int32 &Value, const TCHAR *OptionalQualifier)
 
ENGINE_API bool ConfigHelperInt (const TCHAR *Name, int32 &Value, const TCHAR *OptionalQualifier)
 
ENGINE_API bool ConfigHelperBool (const TCHAR *Name, bool &Value, const TCHAR *OptionalQualifier)
 

Public Attributes

int32 PktLoss = 0
 
int32 PktLossMaxSize = 0
 
int32 PktLossMinSize = 0
 
int32 PktOrder = 0
 
int32 PktDup = 0
 
int32 PktLag = 0
 
int32 PktLagVariance = 0
 
int32 PktLagMin = 0
 
int32 PktLagMax = 0
 
int32 PktIncomingLagMin = 0
 
int32 PktIncomingLagMax = 0
 
int32 PktIncomingLoss = 0
 
int32 PktJitter = 0
 
int32 PktFrameDelay = 0
 
int32 PktIncomingFrameDelay = 0
 
int32 PktBufferBloatInMS = 0
 
int32 PktIncomingBufferBloatInMS = 0
 

Detailed Description

Holds the packet simulation settings in one place

Member Function Documentation

◆ ApplySettings()

ENGINE_API void FPacketSimulationSettings::ApplySettings ( const FPacketSimulationSettings NewSettings)

Force new emulation settings and ignore config or cmdline values

◆ ConfigHelperBool()

bool FPacketSimulationSettings::ConfigHelperBool ( const TCHAR Name,
bool Value,
const TCHAR OptionalQualifier 
)

◆ ConfigHelperInt()

bool FPacketSimulationSettings::ConfigHelperInt ( const TCHAR Name,
int32 Value,
const TCHAR OptionalQualifier 
)

◆ LoadConfig()

void FPacketSimulationSettings::LoadConfig ( const TCHAR OptionalQualifier = nullptr)

reads in settings from the .ini file

Note
: overwrites all previous settings

◆ LoadEmulationProfile()

bool FPacketSimulationSettings::LoadEmulationProfile ( const TCHAR ProfileName)

Load a preconfigured emulation profile from the .ini Returns true if the given profile existed

◆ ParseHelper()

bool FPacketSimulationSettings::ParseHelper ( const TCHAR Cmd,
const TCHAR Name,
int32 Value,
const TCHAR OptionalQualifier 
)

◆ ParseSettings()

bool FPacketSimulationSettings::ParseSettings ( const TCHAR Cmd,
const TCHAR OptionalQualifier = nullptr 
)

Reads the settings from a string: command line or an exec

Parameters
Streamthe string to read the settings from @Param OptionalQualifier: optional string to prepend to Pkt* settings. E.g, "GameNetDriverPktLoss=50"

Reads the settings from a string: command line or an exec

Parameters
Streamthe string to read the settings from

◆ ResetSettings()

void FPacketSimulationSettings::ResetSettings ( )

◆ ShouldDropPacketOfSize()

bool FPacketSimulationSettings::ShouldDropPacketOfSize ( int32  NumBits) const
inline

Tells if a packet fits the size settings to potentially be dropped

◆ ValidateSettings()

void FPacketSimulationSettings::ValidateSettings ( )

Ensure that settings have proper values

Member Data Documentation

◆ PktBufferBloatInMS

int32 FPacketSimulationSettings::PktBufferBloatInMS = 0

Time in milliseconds during which outgoing packets will get delayed before being sent all at once.

◆ PktDup

int32 FPacketSimulationSettings::PktDup = 0

When set, will cause calls to FlushNet to duplicate packets. Value is treated as % of packets duplicated (i.e. 0 = None, 100 = All). No general pattern / ordering is guaranteed. Clamped between 0 and 100.

Cannot be used with PktOrder or PktLag.

◆ PktFrameDelay

int32 FPacketSimulationSettings::PktFrameDelay = 0

Delays sending packets for a specific number of ticks

◆ PktIncomingBufferBloatInMS

int32 FPacketSimulationSettings::PktIncomingBufferBloatInMS = 0

Time in milliseconds during which incoming packets will get delayed before being processed all at once.

◆ PktIncomingFrameDelay

int32 FPacketSimulationSettings::PktIncomingFrameDelay = 0

Delays processing received packets for a specific number of ticks

◆ PktIncomingLagMax

int32 FPacketSimulationSettings::PktIncomingLagMax = 0

The maximum delay in milliseconds to add to incoming packets before they are processed.

◆ PktIncomingLagMin

int32 FPacketSimulationSettings::PktIncomingLagMin = 0

Set a value to add a minimum delay in milliseconds to incoming packets before they are processed.

◆ PktIncomingLoss

int32 FPacketSimulationSettings::PktIncomingLoss = 0

The ratio of incoming packets that will be dropped to simulate packet loss

◆ PktJitter

int32 FPacketSimulationSettings::PktJitter = 0

Causes sent packets to have a variable latency that fluctuates from [PktLagMin] to [PktLagMin+PktJitter] Note that this will cause packet loss on the receiving end.

◆ PktLag

int32 FPacketSimulationSettings::PktLag = 0

When set, will cause calls to FlushNet to delay packets. Value is treated as millisecond lag.

Cannot be used with PktOrder.

◆ PktLagMax

int32 FPacketSimulationSettings::PktLagMax = 0

◆ PktLagMin

int32 FPacketSimulationSettings::PktLagMin = 0

If set lag values will randomly fluctuate between Min and Max. Ignored if PktLag value is set

◆ PktLagVariance

int32 FPacketSimulationSettings::PktLagVariance = 0

When set, will cause PktLag to use variable lag instead of constant. Value is treated as millisecond lag range (e.g. -GivenVariance <= 0 <= GivenVariance).

Can only be used when PktLag is enabled.

◆ PktLoss

int32 FPacketSimulationSettings::PktLoss = 0

When set, will cause calls to FlushNet to drop packets. Value is treated as % of packets dropped (i.e. 0 = None, 100 = All). No general pattern / ordering is guaranteed. Clamped between 0 and 100.

Works with all other settings.

◆ PktLossMaxSize

int32 FPacketSimulationSettings::PktLossMaxSize = 0

Sets the maximum size of packets in bytes that will be dropped according to the PktLoss setting. Default is INT_MAX.

Works with all other settings.

◆ PktLossMinSize

int32 FPacketSimulationSettings::PktLossMinSize = 0

Sets the minimum size of packets in bytes that will be dropped according to the PktLoss setting. Default is 0.

Works with all other settings.

◆ PktOrder

int32 FPacketSimulationSettings::PktOrder = 0

When set, will cause calls to FlushNet to change ordering of packets at random. Value is treated as a bool (i.e. 0 = False, anything else = True). This works by randomly selecting packets to be delayed until a subsequent call to FlushNet.

Takes precedence over PktDup and PktLag.


The documentation for this struct was generated from the following files: