p.SerializeSQsOverlapEnabled
p.SerializeSQsOverlapEnabled
#Overview
name: p.SerializeSQsOverlapEnabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If disabled, p.SerializeSQs will not consider overlaps
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.SerializeSQsOverlapEnabled is to control whether overlap scene queries (SQs) are considered for serialization in the Unreal Engine’s collision system. This setting is part of the debugging and performance analysis toolkit for the physics and collision subsystems.
This setting variable is primarily used by the collision system within Unreal Engine’s physics module. It specifically affects the scene query (SQ) serialization process, which is used for debugging and analyzing collision performance.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.
The p.SerializeSQsOverlapEnabled variable interacts directly with the EnableOverlapSQCapture variable. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable is part of a larger set of debug options for scene queries. It works in conjunction with other variables like p.SerializeSQs, p.SerializeSQsRaycastEnabled, and p.SerializeSQsSweepEnabled. Enabling this variable may have performance implications, as it allows for the capture and serialization of overlap queries, which can be resource-intensive.
Best practices when using this variable include:
- Only enable it when necessary for debugging or performance analysis.
- Be aware of the performance impact when enabled, especially in production environments.
- Use it in combination with other scene query serialization options for comprehensive debugging.
- Consider the implications on memory usage, as serializing scene queries can consume significant memory.
Regarding the associated variable EnableOverlapSQCapture:
The purpose of EnableOverlapSQCapture is identical to p.SerializeSQsOverlapEnabled. It’s an internal representation of the console variable used within the engine’s C++ code.
This variable is used directly in the LowLevelOverlap function to determine whether to capture and serialize overlap scene queries. It’s checked in conjunction with the SerializeSQs variable to decide if the OverlapSQCaptureHelper should be called.
The value of EnableOverlapSQCapture is set by the console variable system, mirroring the value of p.SerializeSQsOverlapEnabled.
Developers should treat EnableOverlapSQCapture as an internal variable and interact with it through the p.SerializeSQsOverlapEnabled console variable. Direct manipulation of EnableOverlapSQCapture in code should be avoided unless absolutely necessary.
Best practices for EnableOverlapSQCapture align with those of p.SerializeSQsOverlapEnabled, as they are essentially the same setting represented in different ways within the engine.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Collision/SceneQueryLowLevel.cpp:28
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarSerializeBadSweeps(TEXT("p.SerializeBadSQs"), SerializeBadSQs, TEXT("If enabled, we create a sq capture whenever chaos and physx diverge"));
FAutoConsoleVariableRef CVarSerializeSQsRaycastEnabled(TEXT("p.SerializeSQsRaycastEnabled"), EnableRaycastSQCapture, TEXT("If disabled, p.SerializeSQs will not consider raycasts"));
FAutoConsoleVariableRef CVarSerializeSQsOverlapEnabled(TEXT("p.SerializeSQsOverlapEnabled"), EnableOverlapSQCapture, TEXT("If disabled, p.SerializeSQs will not consider overlaps"));
FAutoConsoleVariableRef CVarSerializeSQsSweepEnabled(TEXT("p.SerializeSQsSweepEnabled"), EnableSweepSQCapture, TEXT("If disabled, p.SerializeSQs will not consider sweeps"));
#else
constexpr int32 SerializeSQs = 0;
constexpr int32 ReplaySQs = 0;
constexpr int32 SerializeSQSamples = 0;
constexpr int32 EnableRaycastSQCapture = 0;
#Associated Variable and Callsites
This variable is associated with another variable named EnableOverlapSQCapture
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Collision/SceneQueryLowLevel.cpp:20
Scope: file
Source code excerpt:
int32 ReplaySQs = 0;
int32 EnableRaycastSQCapture = 1;
int32 EnableOverlapSQCapture = 1;
int32 EnableSweepSQCapture = 1;
FAutoConsoleVariableRef CVarSerializeSQs(TEXT("p.SerializeSQs"), SerializeSQs, TEXT("If enabled, we create a sq capture per sq that takes more than provided value in microseconds. This can be very expensive as the entire scene is saved out"));
FAutoConsoleVariableRef CVarSerializeSQSamples(TEXT("p.SerializeSQSampleCount"), SerializeSQSamples, TEXT("If Query exceeds duration threshold, we will re-measure SQ this many times before serializing. Larger values cause hitching."));
FAutoConsoleVariableRef CVarReplaySweeps(TEXT("p.ReplaySQs"), ReplaySQs, TEXT("If enabled, we rerun the sq against chaos"));
FAutoConsoleVariableRef CVarSerializeBadSweeps(TEXT("p.SerializeBadSQs"), SerializeBadSQs, TEXT("If enabled, we create a sq capture whenever chaos and physx diverge"));
FAutoConsoleVariableRef CVarSerializeSQsRaycastEnabled(TEXT("p.SerializeSQsRaycastEnabled"), EnableRaycastSQCapture, TEXT("If disabled, p.SerializeSQs will not consider raycasts"));
FAutoConsoleVariableRef CVarSerializeSQsOverlapEnabled(TEXT("p.SerializeSQsOverlapEnabled"), EnableOverlapSQCapture, TEXT("If disabled, p.SerializeSQs will not consider overlaps"));
FAutoConsoleVariableRef CVarSerializeSQsSweepEnabled(TEXT("p.SerializeSQsSweepEnabled"), EnableSweepSQCapture, TEXT("If disabled, p.SerializeSQs will not consider sweeps"));
#else
constexpr int32 SerializeSQs = 0;
constexpr int32 ReplaySQs = 0;
constexpr int32 SerializeSQSamples = 0;
constexpr int32 EnableRaycastSQCapture = 0;
constexpr int32 EnableOverlapSQCapture = 0;
constexpr int32 EnableSweepSQCapture = 0;
#endif
namespace
{
void FinalizeCapture(FPhysTestSerializer& Serializer)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Collision/SceneQueryLowLevel.cpp:342
Scope (from outer to inner):
file
function void LowLevelOverlap
Source code excerpt:
if constexpr(bGTData && FAccelerationContainerTraits<TAccelContainer, bGTData>::IsPhysScene())
{
if(!!SerializeSQs && !!EnableOverlapSQCapture)
{
OverlapSQCaptureHelper(Time, SQAccelerator, Container, QueryGeom, GeomPose, HitBuffer, QueryFlags, Filter, QueryFilterData, QueryCallback, DebugParams);
}
}
}
}