p.Chaos.GC.RemovalTimerMultiplier
p.Chaos.GC.RemovalTimerMultiplier
#Overview
name: p.Chaos.GC.RemovalTimerMultiplier
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Multiplier for the removal time evaluation ( > 1 : faster removal , > 1 slower
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.GC.RemovalTimerMultiplier is to control the speed of removal for Geometry Collection components in Unreal Engine’s Chaos physics system. It acts as a multiplier for the removal time evaluation, where values greater than 1 result in faster removal, and values less than 1 result in slower removal.
This setting variable is primarily used by the Geometry Collection subsystem within the Experimental GeometryCollectionEngine module of Unreal Engine. Based on the callsites, it’s specifically utilized in the GeometryCollectionComponent.cpp file.
The value of this variable is set through the FAutoConsoleVariableRef system, which allows it to be modified at runtime via console commands. It’s initialized with a default value of 1.0f.
The p.Chaos.GC.RemovalTimerMultiplier interacts directly with the GeometryCollectionRemovalMultiplier variable. They share the same value, with GeometryCollectionRemovalMultiplier being the actual variable used in the code logic.
Developers must be aware that this variable affects the removal speed of Geometry Collection components. A higher value will cause faster removal, which might be useful for performance optimization but could affect visual fidelity. Conversely, a lower value will slow down removal, potentially improving visual quality at the cost of performance.
Best practices when using this variable include:
- Carefully balancing performance and visual quality when adjusting the value.
- Testing thoroughly with different values to ensure desired behavior across various scenarios.
- Considering the impact on gameplay and user experience when modifying this value.
Regarding the associated variable GeometryCollectionRemovalMultiplier:
The purpose of GeometryCollectionRemovalMultiplier is to directly implement the removal time multiplier in the code logic. It’s the variable that’s actually used in calculations within the GeometryCollectionComponent class.
This variable is used in the TickComponent function of the UGeometryCollectionComponent class. It’s applied to adjust the delta time used for incrementing sleep and break timers, which are likely part of the removal process for Geometry Collection components.
The value of GeometryCollectionRemovalMultiplier is set through the p.Chaos.GC.RemovalTimerMultiplier console variable.
It interacts with the DeltaTime parameter in the TickComponent function to create an AdjustedDeltaTime value.
Developers should be aware that this variable directly affects the timing of sleep and break processes in Geometry Collections. Changes to this value will impact how quickly or slowly these processes occur.
Best practices for using GeometryCollectionRemovalMultiplier include:
- Ensuring it’s not set to extremely low values (a minimum of 0.0001f is enforced in the code) to prevent division by zero or other numerical issues.
- Monitoring its impact on performance and visual behavior when modified.
- Considering its effects in conjunction with other timing-related variables in the Geometry Collection system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:122
Scope: file
Source code excerpt:
float GeometryCollectionRemovalMultiplier = 1.0f;
FAutoConsoleVariableRef CVarGeometryCollectionRemovalTimerMultiplier(TEXT("p.Chaos.GC.RemovalTimerMultiplier"), GeometryCollectionRemovalMultiplier, TEXT("Multiplier for the removal time evaluation ( > 1 : faster removal , > 1 slower"));
// temporary cvar , should be removed when the root event is no longer no necessary
bool GeometryCollectionEmitRootBreakingEvent = false;
FAutoConsoleVariableRef CVarGeometryCollectionEmitRootBreakingEvent(TEXT("p.Chaos.GC.EmitRootBreakingEvent"), GeometryCollectionEmitRootBreakingEvent, TEXT("When true send a breaking event when root is breaking"));
bool GeometryCollectionCreatePhysicsStateInEditor = false;
#Associated Variable and Callsites
This variable is associated with another variable named GeometryCollectionRemovalMultiplier
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:121
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarMaxGeometryCollectionAsyncPhysicsTickIdleTimeMs(TEXT("p.Chaos.GC.MaxGeometryCollectionAsyncPhysicsTickIdleTimeMs"), MaxGeometryCollectionAsyncPhysicsTickIdleTimeMs, TEXT("Amount of time in milliseconds before the async tick turns off when it is otherwise not doing anything."));
float GeometryCollectionRemovalMultiplier = 1.0f;
FAutoConsoleVariableRef CVarGeometryCollectionRemovalTimerMultiplier(TEXT("p.Chaos.GC.RemovalTimerMultiplier"), GeometryCollectionRemovalMultiplier, TEXT("Multiplier for the removal time evaluation ( > 1 : faster removal , > 1 slower"));
// temporary cvar , should be removed when the root event is no longer no necessary
bool GeometryCollectionEmitRootBreakingEvent = false;
FAutoConsoleVariableRef CVarGeometryCollectionEmitRootBreakingEvent(TEXT("p.Chaos.GC.EmitRootBreakingEvent"), GeometryCollectionEmitRootBreakingEvent, TEXT("When true send a breaking event when root is breaking"));
bool GeometryCollectionCreatePhysicsStateInEditor = false;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:3470
Scope (from outer to inner):
file
function void UGeometryCollectionComponent::TickComponent
Source code excerpt:
{
InitializeRemovalDynamicAttributesIfNeeded();
const float AdjustedDeltaTime = FMath::Max(GeometryCollectionRemovalMultiplier, 0.0001f) * DeltaTime;
// todo(chaos) : move removal logic on the physics thread
IncrementSleepTimer(AdjustedDeltaTime);
IncrementBreakTimer(AdjustedDeltaTime);
}
// if there's no more decaying pieces, we can disable tick component
if (!BrokenAndDecayedStates.HasAnyDecaying())