p.Chaos.VD.CompressBinaryData
p.Chaos.VD.CompressBinaryData
#Overview
name: p.Chaos.VD.CompressBinaryData
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, serialized binary data will be compressed using Oodle on the fly before being traced
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.VD.CompressBinaryData is to control whether serialized binary data should be compressed using Oodle compression before being traced in the Chaos Visual Debugger system.
This setting variable is primarily used by the Chaos physics system, specifically within the Visual Debugger module of Unreal Engine 5. It’s part of the experimental Chaos namespace, indicating that it’s related to the Chaos physics engine.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean value, defaulting to false, and can be changed at runtime using console commands or through configuration files.
The associated variable bCompressBinaryData directly interacts with p.Chaos.VD.CompressBinaryData. They share the same value, with bCompressBinaryData being the actual boolean variable used in the code logic.
Developers should be aware that enabling this option will introduce additional processing overhead due to the compression step. However, it can significantly reduce the amount of data being traced, which may be beneficial for performance in scenarios where large amounts of debug data are being generated.
Best practices when using this variable include:
- Only enable it when necessary, as it adds computational overhead.
- Consider the trade-off between reduced data size and increased CPU usage for compression.
- Use in conjunction with p.Chaos.VD.CompressionMode to fine-tune the compression level.
Regarding the associated variable bCompressBinaryData:
The purpose of bCompressBinaryData is to serve as the actual boolean flag used in the code to determine whether compression should be applied to the binary data.
It’s used within the Chaos Visual Debugger system, specifically in the TraceBinaryData function of the FChaosVisualDebuggerTrace class.
The value of bCompressBinaryData is set by the console variable p.Chaos.VD.CompressBinaryData, ensuring they always have the same value.
When bCompressBinaryData is true, the code will compress the binary data using Oodle compression before tracing it. The compression level is determined by another associated variable, CompressionMode.
Developers should be aware that changing p.Chaos.VD.CompressBinaryData will directly affect the behavior of bCompressBinaryData. They should also note that when compression is enabled, additional memory is allocated for the compressed data.
Best practices include monitoring the performance impact of enabling compression and adjusting the compression mode if necessary to balance between compression ratio and computational cost.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/ChaosVisualDebugger/ChaosVisualDebuggerTrace.cpp:44
Scope (from outer to inner):
file
namespace Chaos::VisualDebugger::Cvars
Source code excerpt:
static bool bCompressBinaryData = false;
FAutoConsoleVariableRef CVarChaosVDCompressBinaryData(
TEXT("p.Chaos.VD.CompressBinaryData"),
bCompressBinaryData,
TEXT("If true, serialized binary data will be compressed using Oodle on the fly before being traced"));
static int32 CompressionMode = 2;
FAutoConsoleVariableRef CVarChaosVDCompressionMode(
TEXT("p.Chaos.VD.CompressionMode"),
#Associated Variable and Callsites
This variable is associated with another variable named bCompressBinaryData
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/ChaosVisualDebugger/ChaosVisualDebuggerTrace.cpp:42
Scope (from outer to inner):
file
namespace Chaos::VisualDebugger::Cvars
Source code excerpt:
namespace Chaos::VisualDebugger::Cvars
{
static bool bCompressBinaryData = false;
FAutoConsoleVariableRef CVarChaosVDCompressBinaryData(
TEXT("p.Chaos.VD.CompressBinaryData"),
bCompressBinaryData,
TEXT("If true, serialized binary data will be compressed using Oodle on the fly before being traced"));
static int32 CompressionMode = 2;
FAutoConsoleVariableRef CVarChaosVDCompressionMode(
TEXT("p.Chaos.VD.CompressionMode"),
CompressionMode,
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/ChaosVisualDebugger/ChaosVisualDebuggerTrace.cpp:563
Scope (from outer to inner):
file
function void FChaosVisualDebuggerTrace::TraceBinaryData
Source code excerpt:
// Handle Compression if enabled
const bool bIsCompressed = Chaos::VisualDebugger::Cvars::bCompressBinaryData;
TArray<uint8> CompressedData;
if (bIsCompressed)
{
CompressedData.Reserve(CompressedData.Num());
FOodleCompressedArray::CompressData(CompressedData, InData.GetData(),InData.Num(), FOodleDataCompression::ECompressor::Kraken,
static_cast<FOodleDataCompression::ECompressionLevel>(Chaos::VisualDebugger::Cvars::CompressionMode));