Concert.SetCompressionSizeLimit

Concert.SetCompressionSizeLimit

#Overview

name: Concert.SetCompressionSizeLimit

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 Concert.SetCompressionSizeLimit is to control the compression behavior for data serialization in the Concert plugin of Unreal Engine 5. Specifically, it sets a size threshold for when compression should be applied to data packages.

This setting variable is primarily used by the Concert plugin, which is part of the Developer tools in Unreal Engine 5. It’s particularly relevant to the data serialization and network communication aspects of the Concert system.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 32 (MB) but can be changed at runtime through console commands or configuration files.

The associated variable CVarCompressionSizeLimit directly interacts with Concert.SetCompressionSizeLimit. They share the same value and purpose.

Developers should be aware that:

  1. This variable affects performance. Compression is only applied if the package size is less than the specified limit to avoid unnecessary performance costs for small packages.
  2. A value of 0 or less will always trigger compression, regardless of package size.
  3. This setting works in conjunction with other compression-related variables like CVarCompressionFlags and likely a compression type variable (though not shown in the provided code).

Best practices when using this variable include:

  1. Carefully consider the trade-off between network bandwidth and CPU usage when setting this value.
  2. Monitor performance metrics to find the optimal value for your specific use case.
  3. Be aware of how this interacts with other compression settings in the Concert system.

Regarding the associated variable CVarCompressionSizeLimit:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:177

Scope (from outer to inner):

file
namespace    UE::Concert::Compression

Source code excerpt:


static TAutoConsoleVariable<int32> CVarCompressionSizeLimit(
	TEXT("Concert.SetCompressionSizeLimit"), 32,
	TEXT("The compressor incurs a performance cost and will only be used if the package size is less than the amount specified (default 32 MB). A value of 0 or less will always compress."));

static TAutoConsoleVariable<int32> CVarCompressionFlags(
	TEXT("Concert.SetCompressionFlags"), 0,
	TEXT("Specify the flags to use when compression is enabled. A value of 0 means no flags. A value of 1 favors smaller sizes. Any other value favors faster encoding."));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:176

Scope (from outer to inner):

file
namespace    UE::Concert::Compression

Source code excerpt:

	TEXT("Specify the type of compression to use when serializing data. A value of 0 means compression is off. A value of 1 = Oodle. All other values = Zlib."));

static TAutoConsoleVariable<int32> CVarCompressionSizeLimit(
	TEXT("Concert.SetCompressionSizeLimit"), 32,
	TEXT("The compressor incurs a performance cost and will only be used if the package size is less than the amount specified (default 32 MB). A value of 0 or less will always compress."));

static TAutoConsoleVariable<int32> CVarCompressionFlags(
	TEXT("Concert.SetCompressionFlags"), 0,
	TEXT("Specify the flags to use when compression is enabled. A value of 0 means no flags. A value of 1 favors smaller sizes. Any other value favors faster encoding."));

#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:196

Scope (from outer to inner):

file
namespace    UE::Concert::Compression
function     int32 GetConsoleVariableCompressionSizeLimit

Source code excerpt:

int32 GetConsoleVariableCompressionSizeLimit()
{
	return CVarCompressionSizeLimit.GetValueOnAnyThread();
}

}

namespace PayloadDetail
{