net.DisableRemapScriptActors
net.DisableRemapScriptActors
#Overview
name: net.DisableRemapScriptActors
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When set, disables name remapping of compiled script actors (for networking)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.DisableRemapScriptActors is to control the name remapping of compiled script actors for networking purposes in Unreal Engine 5.
This setting variable is primarily used in the Engine module, specifically within the World subsystem. It’s referenced in the World.cpp file, which is a core component of Unreal Engine’s runtime.
The value of this variable is set through a console variable (CVar) system. It’s initialized as a static integer with a default value of 0, and then bound to the console variable “net.DisableRemapScriptActors” using FAutoConsoleVariableRef.
The associated variable bDisableRemapScriptActors interacts directly with net.DisableRemapScriptActors. They share the same value, with bDisableRemapScriptActors being used in the actual code logic.
Developers must be aware that when this variable is set to a non-zero value, it disables the name remapping of compiled script actors for networking. This can have significant implications for networked gameplay, especially in multiplayer scenarios.
Best practices when using this variable include:
- Only modify it if you fully understand the implications for your game’s networking.
- Test thoroughly in multiplayer scenarios if you change this setting.
- Consider leaving it at its default value (0) unless you have a specific reason to disable script actor remapping.
Regarding the associated variable bDisableRemapScriptActors:
The purpose of bDisableRemapScriptActors is to provide a quick, in-code check for whether script actor remapping should be performed.
It’s used directly in the UWorld::RemapCompiledScriptActor function to determine whether to proceed with remapping or not.
The value of bDisableRemapScriptActors is set by the console variable system, mirroring the value of net.DisableRemapScriptActors.
Developers should be aware that this variable is used in a critical path for handling compiled script actors. Changing its value can affect how these actors are processed in networked environments.
Best practices for bDisableRemapScriptActors include:
- Treat it as read-only in most scenarios, as it’s controlled by the console variable.
- If you need to check whether remapping is disabled in your code, use this variable rather than directly querying the console variable for slightly better performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:145
Scope: file
Source code excerpt:
static int32 bDisableRemapScriptActors = 0;
FAutoConsoleVariableRef CVarDisableRemapScriptActors(TEXT("net.DisableRemapScriptActors"), bDisableRemapScriptActors, TEXT("When set, disables name remapping of compiled script actors (for networking)"));
static bool bDisableInGamePerfTrackersForUninitializedWorlds = true;
FAutoConsoleVariableRef CVarDisableInGamePerfTrackersForUninitializedWorlds(TEXT("s.World.SkipPerfTrackerForUninitializedWorlds"), bDisableInGamePerfTrackersForUninitializedWorlds, TEXT("When set, disables allocation of InGamePerformanceTrackers for Worlds that aren't initialized."));
static TAutoConsoleVariable<int32> CVarPurgeEditorSceneDuringPIE(
#Associated Variable and Callsites
This variable is associated with another variable named bDisableRemapScriptActors
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:144
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "World"
static int32 bDisableRemapScriptActors = 0;
FAutoConsoleVariableRef CVarDisableRemapScriptActors(TEXT("net.DisableRemapScriptActors"), bDisableRemapScriptActors, TEXT("When set, disables name remapping of compiled script actors (for networking)"));
static bool bDisableInGamePerfTrackersForUninitializedWorlds = true;
FAutoConsoleVariableRef CVarDisableInGamePerfTrackersForUninitializedWorlds(TEXT("s.World.SkipPerfTrackerForUninitializedWorlds"), bDisableInGamePerfTrackersForUninitializedWorlds, TEXT("When set, disables allocation of InGamePerformanceTrackers for Worlds that aren't initialized."));
static TAutoConsoleVariable<int32> CVarPurgeEditorSceneDuringPIE(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/World.cpp:3817
Scope (from outer to inner):
file
function bool UWorld::RemapCompiledScriptActor
Source code excerpt:
{
// We're really only interested in compiled script actors, skip everything else.
if (bDisableRemapScriptActors != 0 || !Str.Contains(TEXT("_C_")))
{
return false;
}
// Wrap our search string as an FName. This will allow us to do a quick search to see if the object exists regardless of index.
const FName ActorName(*Str);