Concert.SetCompressionType
Concert.SetCompressionType
#Overview
name: Concert.SetCompressionType
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.SetCompressionType is to specify the type of compression to use when serializing data in the Concert system, which is part of Unreal Engine’s collaboration framework.
This setting variable is primarily used by the Concert plugin, which is part of Unreal Engine’s developer tools for real-time collaboration. It’s specifically utilized in the ConcertMessageData module, which handles data serialization and compression for network communication in collaborative sessions.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 2, but can be changed at runtime through console commands or configuration files.
The variable interacts closely with another console variable, CVarCompressionSizeLimit, which sets a size limit for when compression should be applied. Together, these variables control the compression behavior of the Concert system.
Developers should be aware that:
- A value of 0 means compression is off.
- A value of 1 uses Oodle compression.
- All other values (including the default 2) use Zlib compression.
Best practices when using this variable include:
- Consider the trade-off between compression ratio and performance. Higher compression might save bandwidth but could increase CPU usage.
- Align the compression type with the size and nature of the data being transmitted in collaborative sessions.
- Use in conjunction with Concert.SetCompressionSizeLimit to optimize when compression is applied.
Regarding the associated variable CVarCompressionType:
This is the actual console variable object that stores and manages the Concert.SetCompressionType setting. It’s defined as a static TAutoConsoleVariable
The CVarCompressionType variable is used internally by the Concert system to retrieve the current compression type setting. For example, the GetConsoleVariableCompressionType() function directly accesses this variable to return its value.
Developers should note that while they can interact with Concert.SetCompressionType through console commands, programmatic access should be done through the CVarCompressionType variable or provided accessor functions like GetConsoleVariableCompressionType(). This ensures thread-safe access to the variable’s value.
#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:173
Scope (from outer to inner):
file
namespace UE::Concert::Compression
Source code excerpt:
static TAutoConsoleVariable<int32> CVarCompressionType(
TEXT("Concert.SetCompressionType"), 2,
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."));
#Associated Variable and Callsites
This variable is associated with another variable named CVarCompressionType
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:172
Scope (from outer to inner):
file
namespace UE::Concert::Compression
Source code excerpt:
{
static TAutoConsoleVariable<int32> CVarCompressionType(
TEXT("Concert.SetCompressionType"), 2,
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."));
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:186
Scope (from outer to inner):
file
namespace UE::Concert::Compression
function int32 GetConsoleVariableCompressionType
Source code excerpt:
int32 GetConsoleVariableCompressionType()
{
return CVarCompressionType.GetValueOnAnyThread();
}
int32 GetConsoleVariableCompressionFlags()
{
return CVarCompressionFlags.GetValueOnAnyThread();
}