NetworkEmulationProfiles
NetworkEmulationProfiles
#Overview
name: NetworkEmulationProfiles
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 NetworkEmulationProfiles is to provide a list of predefined network emulation profiles that can be used to simulate various network conditions during Play-in-Editor (PIE) sessions in Unreal Engine.
This setting variable is primarily used by the Unreal Editor’s network emulation system, which is part of the UnrealEd module. It allows developers to test their game’s performance under different network conditions without the need for actual network infrastructure.
The value of this variable is set in the UNetworkSettings class, which is part of the Engine module. It is defined as a config property, meaning its values can be loaded from and saved to configuration files.
NetworkEmulationProfiles interacts with other parts of the network emulation system, such as the LevelEditorPlayNetworkEmulationSettings class, which uses these profiles to populate the network emulation options in the editor UI.
Developers should be aware that:
- This variable contains an array of FNetworkEmulationProfileDescription objects, each representing a different network condition.
- The profiles defined here are used to populate dropdown menus and other UI elements in the editor for selecting network emulation settings.
- Changes to these profiles will affect the options available to all developers using the project.
Best practices when using this variable include:
- Defining a range of realistic network conditions that cover various scenarios your game might encounter.
- Regularly testing your game using different profiles to ensure it performs well under various network conditions.
- Keeping the profile names and tooltips clear and descriptive to help team members understand what each profile represents.
- Updating the profiles as needed to reflect new network conditions or specific scenarios you want to test.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3292, section: [/Script/Engine.NetworkSettings]
- INI Section:
/Script/Engine.NetworkSettings
- Raw value:
(ProfileName="Average",ToolTip="Simulates average internet conditions")
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:3293, section: [/Script/Engine.NetworkSettings]
- INI Section:
/Script/Engine.NetworkSettings
- Raw value:
(ProfileName="Bad",ToolTip="Simulates laggy internet conditions")
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/LevelEditorPlayNetworkEmulationSettings.cpp:138
Scope (from outer to inner):
file
function TSharedRef<SWidget> FLevelEditorPlayNetworkEmulationSettingsDetail::OnGetProfilesMenuContent
Source code excerpt:
{
// Add preconfigured profiles
for (int32 Index=0; Index < NetworkSettings->NetworkEmulationProfiles.Num(); Index++ )
{
const FNetworkEmulationProfileDescription& ProfileDescription = NetworkSettings->NetworkEmulationProfiles[Index];
MenuBuilder.AddMenuEntry(
FText::FromString(ProfileDescription.ProfileName),
FText::FromString(ProfileDescription.ToolTip),
FSlateIcon(),
FUIAction(
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/LevelEditorPlayNetworkEmulationSettings.cpp:174
Scope (from outer to inner):
file
function void FLevelEditorPlayNetworkEmulationSettingsDetail::OnEmulationProfileChanged
Source code excerpt:
if (const UNetworkSettings* NetworkSettings = GetDefault<UNetworkSettings>())
{
if(NetworkSettings->NetworkEmulationProfiles.IsValidIndex(Index))
{
Selection = NetworkSettings->NetworkEmulationProfiles[Index].ProfileName;
}
else
{
Selection = NetworkEmulationSettingsHelper::GetCustomProfileName();
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/NetworkSettings.h:47
Scope (from outer to inner):
file
class class UNetworkSettings : public UDeveloperSettings
Source code excerpt:
/** This lists the common network emulation profiles that will be selectable in PIE settings */
UPROPERTY(config)
TArray<FNetworkEmulationProfileDescription> NetworkEmulationProfiles;
public:
//~ Begin UObject Interface
ENGINE_API virtual void PostInitProperties() override;