net.MaxClientGuidRemaps

net.MaxClientGuidRemaps

#Overview

name: net.MaxClientGuidRemaps

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of net.MaxClientGuidRemaps is to control the maximum number of unmapped network GUIDs that can be resolved per tick on the client-side in Unreal Engine’s networking system.

This setting variable is primarily used by the networking subsystem of Unreal Engine, specifically within the NetDriver module. It’s part of the engine’s network optimization and performance management features.

The value of this variable is set as a console variable (CVar) in the Unreal Engine’s configuration system. It’s initialized with a default value of 100 in the C++ code, but can be modified at runtime or through configuration files.

The associated variable CVarMaxClientGuidRemaps directly interacts with net.MaxClientGuidRemaps. They share the same value and purpose.

Developers must be aware that this variable only affects client-side behavior, as evidenced by the check IsServer() ? 0 : CVarMaxClientGuidRemaps.GetValueOnAnyThread() in the code. It limits the number of GUID remaps processed per tick, which can help prevent performance issues caused by excessive GUID resolution attempts.

Best practices when using this variable include:

  1. Monitor its impact on network performance and client-side processing.
  2. Adjust the value based on the specific needs of your game, considering factors like network complexity and client hardware capabilities.
  3. Use in conjunction with other network optimization settings for best results.
  4. Be cautious about setting it too high, as it could lead to increased per-tick processing time on the client.

Regarding the associated variable CVarMaxClientGuidRemaps:

The purpose of CVarMaxClientGuidRemaps is identical to net.MaxClientGuidRemaps. It’s the actual CVar object that stores and provides access to the setting value.

This variable is used directly in the NetDriver module to control the GUID remapping behavior. It’s accessed using the GetValueOnAnyThread() method, which allows for thread-safe retrieval of the current value.

The value of CVarMaxClientGuidRemaps is set when the CVar is initialized in the C++ code, but can be modified at runtime through console commands or configuration changes.

Developers should be aware that changes to this CVar will immediately affect the behavior of the GUID remapping system. It’s important to consider the potential performance implications of adjusting this value, especially in a live game environment.

Best practices for CVarMaxClientGuidRemaps include:

  1. Use it for fine-tuning network performance in different game scenarios.
  2. Consider exposing it as a configurable option for advanced users or during development/testing phases.
  3. Monitor its effects in conjunction with other network-related metrics to ensure optimal performance.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:922

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarOptimizedRemapping( TEXT( "net.OptimizedRemapping" ), 1, TEXT( "Uses optimized path to remap unmapped network guids" ) );
static TAutoConsoleVariable<int32> CVarMaxClientGuidRemaps( TEXT( "net.MaxClientGuidRemaps" ), 100, TEXT( "Max client resolves of unmapped network guids per tick" ) );

namespace UE
{
	namespace Net
	{
		int32 FilterGuidRemapping = 1;

#Associated Variable and Callsites

This variable is associated with another variable named CVarMaxClientGuidRemaps. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:922

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarOptimizedRemapping( TEXT( "net.OptimizedRemapping" ), 1, TEXT( "Uses optimized path to remap unmapped network guids" ) );
static TAutoConsoleVariable<int32> CVarMaxClientGuidRemaps( TEXT( "net.MaxClientGuidRemaps" ), 100, TEXT( "Max client resolves of unmapped network guids per tick" ) );

namespace UE
{
	namespace Net
	{
		int32 FilterGuidRemapping = 1;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:1077

Scope (from outer to inner):

file
function     void UNetDriver::UpdateUnmappedObjects

Source code excerpt:

		{
			int32 NumRemapTests = 0;
			const int32 MaxRemaps = IsServer() ? 0 : CVarMaxClientGuidRemaps.GetValueOnAnyThread();

			TArray<FNetworkGUID> UnmappedGuids;
			TArray<FNetworkGUID> NewlyMappedGuids;

			for (auto It = ImportedNetGuidsRef.CreateIterator(); It; ++It)
			{