net.TickAllOpenChannels

net.TickAllOpenChannels

#Overview

name: net.TickAllOpenChannels

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.TickAllOpenChannels is to control the ticking behavior of open channels in network connections within Unreal Engine’s networking system.

This setting variable is primarily used in the networking subsystem of Unreal Engine, specifically within the NetConnection module. It affects how the engine manages and updates network channels.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0 in the source code.

The associated variable CVarTickAllOpenChannels interacts directly with net.TickAllOpenChannels. They share the same value and purpose.

Developers must be aware that enabling this variable (setting it to a non-zero value) will cause each network connection to tick all of its open channels every frame. This can have significant performance implications, as noted in the comment: “Leaving this off will improve performance.”

Best practices when using this variable include:

  1. Keeping it disabled (set to 0) in most scenarios to maintain optimal performance.
  2. Only enabling it when necessary for debugging or specific networking requirements.
  3. Monitoring performance closely when enabled, as it can impact frame rates and network efficiency.

Regarding the associated variable CVarTickAllOpenChannels:

It is defined as a static TAutoConsoleVariable, which allows it to be modified at runtime through console commands. The variable is used directly in the UNetConnection::Tick function to determine whether all open channels should be ticked.

When using CVarTickAllOpenChannels, developers should:

  1. Be cautious about enabling it in production builds due to performance concerns.
  2. Use it primarily for debugging and testing network behavior.
  3. Consider the impact on network traffic and CPU usage when enabled.
  4. Be aware that it affects all network connections when enabled, not just specific ones.

In summary, both net.TickAllOpenChannels and CVarTickAllOpenChannels serve the same purpose of controlling channel ticking behavior in Unreal Engine’s networking system, with significant performance implications when enabled.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:67

Scope: file

Source code excerpt:

#endif

static TAutoConsoleVariable<int32> CVarTickAllOpenChannels(TEXT("net.TickAllOpenChannels"), 0,
	TEXT("If nonzero, each net connection will tick all of its open channels every tick. Leaving this off will improve performance."));

static TAutoConsoleVariable<int32> CVarRandomizeSequence(TEXT("net.RandomizeSequence"), 1,
	TEXT("Randomize initial packet sequence, can provide some obfuscation"));

static TAutoConsoleVariable<int32> CVarMaxChannelSize(TEXT("net.MaxChannelSize"), 0,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:67

Scope: file

Source code excerpt:

#endif

static TAutoConsoleVariable<int32> CVarTickAllOpenChannels(TEXT("net.TickAllOpenChannels"), 0,
	TEXT("If nonzero, each net connection will tick all of its open channels every tick. Leaving this off will improve performance."));

static TAutoConsoleVariable<int32> CVarRandomizeSequence(TEXT("net.RandomizeSequence"), 1,
	TEXT("Randomize initial packet sequence, can provide some obfuscation"));

static TAutoConsoleVariable<int32> CVarMaxChannelSize(TEXT("net.MaxChannelSize"), 0,

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:4521

Scope (from outer to inner):

file
function     void UNetConnection::Tick

Source code excerpt:


		// Tick the channels.
		if (CVarTickAllOpenChannels.GetValueOnAnyThread() == 0)
		{
			for( int32 i=ChannelsToTick.Num()-1; i>=0; i-- )
			{
				ChannelsToTick[i]->Tick();

				if (ChannelsToTick[i]->CanStopTicking())