Concert.SetCompressionFlags

Concert.SetCompressionFlags

#Overview

name: Concert.SetCompressionFlags

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.SetCompressionFlags is to control the compression behavior in the Concert plugin, which is part of Unreal Engine’s collaborative development tools.

This setting variable is primarily used by the Concert plugin, which is a developer tool for real-time collaboration in Unreal Engine. It’s specifically part of the compression system within the Concert plugin.

The value of this variable is set through a console variable (CVar) named CVarCompressionFlags. It’s initialized with a default value of 0, but can be changed at runtime through console commands or programmatically.

Concert.SetCompressionFlags interacts closely with CVarCompressionFlags, as they share the same value. The GetConsoleVariableCompressionFlags() function is used to retrieve the current value of this variable.

Developers should be aware that this variable affects the compression behavior of the Concert plugin. A value of 0 means no special flags are used. A value of 1 favors smaller compressed sizes, while any other value favors faster encoding.

Best practices when using this variable include:

  1. Consider the trade-off between compression size and encoding speed based on your project’s needs.
  2. Monitor the impact of different flag values on performance and network traffic in your collaborative development environment.
  3. Use in conjunction with other Concert compression settings for optimal results.

Regarding the associated variable CVarCompressionFlags:

The purpose of CVarCompressionFlags is to store and manage the compression flags setting within the Concert plugin’s code.

It’s used internally by the Concert plugin to implement the behavior defined by Concert.SetCompressionFlags.

The value of CVarCompressionFlags is set when the Concert.SetCompressionFlags console variable is modified.

CVarCompressionFlags interacts directly with the Concert.SetCompressionFlags console variable, effectively serving as its in-code representation.

Developers working directly with the Concert plugin’s source code should be aware that modifying CVarCompressionFlags will affect the behavior controlled by Concert.SetCompressionFlags.

Best practices for using CVarCompressionFlags include:

  1. Avoid modifying it directly in code unless absolutely necessary; prefer using the Concert.SetCompressionFlags console variable.
  2. When reading its value, use the GetConsoleVariableCompressionFlags() function for consistency.
  3. Consider the implications on compression behavior when changing this value, especially in a networked collaborative environment.

#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:181

Scope (from outer to inner):

file
namespace    UE::Concert::Compression

Source code excerpt:


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."));

int32 GetConsoleVariableCompressionType()
{
	return CVarCompressionType.GetValueOnAnyThread();
}

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    UE::Concert::Compression

Source code excerpt:

	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."));

int32 GetConsoleVariableCompressionType()
{
	return CVarCompressionType.GetValueOnAnyThread();

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

Scope (from outer to inner):

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

Source code excerpt:

int32 GetConsoleVariableCompressionFlags()
{
	return CVarCompressionFlags.GetValueOnAnyThread();
}

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