p.KinematicDeferralLogInvalidBodies
p.KinematicDeferralLogInvalidBodies
#Overview
name: p.KinematicDeferralLogInvalidBodies
This variable is created as a Console Variable (cvar).
- type:
Var - help:
If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update.
It is referenced in 6 C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.KinematicDeferralLogInvalidBodies is to control logging of invalid bodies during kinematic updates in the Unreal Engine’s physics system, specifically in the Chaos physics engine.
This setting variable is primarily used in the physics engine subsystem of Unreal Engine, particularly in the Chaos physics implementation. It is referenced in the FPhysScene_Chaos class, which is part of the core physics simulation.
The value of this variable is set through the Unreal Engine’s console variable system. It’s defined as a boolean and initialized to false by default.
This variable interacts closely with another variable called GKinematicDeferralCheckValidBodies. It only takes effect when GKinematicDeferralCheckValidBodies is true.
Developers should be aware that enabling this variable will cause the engine to log warnings when invalid bodies are encountered during kinematic updates. This can be useful for debugging physics-related issues but may impact performance if left enabled in a release build due to the additional checks and potential log spam.
Best practices for using this variable include:
- Use it primarily during development and debugging phases.
- Disable it for release builds to avoid potential performance impacts.
- When enabled, monitor the logs for any recurring issues with invalid bodies, which may indicate underlying problems in the physics setup.
Regarding the associated variable GKinematicDeferralLogInvalidBodies:
This is the actual boolean variable that stores the state controlled by the console variable p.KinematicDeferralLogInvalidBodies. It’s used in the same context as the console variable, within the FPhysScene_Chaos class.
The purpose of GKinematicDeferralLogInvalidBodies is identical to p.KinematicDeferralLogInvalidBodies - it controls whether invalid bodies are logged during kinematic updates in the Chaos physics engine.
This variable is checked in several places within the UpdateKinematicsOnDeferredSkelMeshes() function of FPhysScene_Chaos. When true, it triggers warning logs for invalid FBodyInstance and FPhysicsActorHandle objects.
Developers should treat this variable the same way as p.KinematicDeferralLogInvalidBodies, as they are directly linked. The same awareness points and best practices apply to both.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:57
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVar_KinematicDeferralUpdateExternalAccelerationStructure(TEXT("p.KinematicDeferralUpdateExternalAccelerationStructure"), GKinematicDeferralUpdateExternalAccelerationStructure, TEXT("If true, process any operations in PendingSpatialOperations_External before doing deferred kinematic updates."));
bool GKinematicDeferralLogInvalidBodies = false;
FAutoConsoleVariableRef CVar_KinematicDeferralLogInvalidBodies(TEXT("p.KinematicDeferralLogInvalidBodies"), GKinematicDeferralLogInvalidBodies, TEXT("If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update."));
float GReplicationCacheLingerForNSeconds = 3.f;
FAutoConsoleVariableRef CVar_ReplicationCacheLingerForNSeconds(TEXT("np2.ReplicationCache.LingerForNSeconds"), GReplicationCacheLingerForNSeconds, TEXT("How long to keep data in the replication cache without the actor accessing it, after this we stop caching the actors state until it tries to access it again."));
bool bGClusterUnionSyncBodiesMoveNewComponents = true;
FAutoConsoleVariableRef CVar_GClusterUnionSyncBodiesCheckDirtyFlag(TEXT("p.ClusterUnion.SyncBodiesMoveNewComponents"), bGClusterUnionSyncBodiesMoveNewComponents, TEXT("Enable a fix to ensure new components in a cluster union are moved once on add (even if the cluster is not moving)."));
#Associated Variable and Callsites
This variable is associated with another variable named GKinematicDeferralLogInvalidBodies. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:56
Scope: file
Source code excerpt:
bool GKinematicDeferralUpdateExternalAccelerationStructure = false;
FAutoConsoleVariableRef CVar_KinematicDeferralUpdateExternalAccelerationStructure(TEXT("p.KinematicDeferralUpdateExternalAccelerationStructure"), GKinematicDeferralUpdateExternalAccelerationStructure, TEXT("If true, process any operations in PendingSpatialOperations_External before doing deferred kinematic updates."));
bool GKinematicDeferralLogInvalidBodies = false;
FAutoConsoleVariableRef CVar_KinematicDeferralLogInvalidBodies(TEXT("p.KinematicDeferralLogInvalidBodies"), GKinematicDeferralLogInvalidBodies, TEXT("If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update."));
float GReplicationCacheLingerForNSeconds = 3.f;
FAutoConsoleVariableRef CVar_ReplicationCacheLingerForNSeconds(TEXT("np2.ReplicationCache.LingerForNSeconds"), GReplicationCacheLingerForNSeconds, TEXT("How long to keep data in the replication cache without the actor accessing it, after this we stop caching the actors state until it tries to access it again."));
bool bGClusterUnionSyncBodiesMoveNewComponents = true;
FAutoConsoleVariableRef CVar_GClusterUnionSyncBodiesCheckDirtyFlag(TEXT("p.ClusterUnion.SyncBodiesMoveNewComponents"), bGClusterUnionSyncBodiesMoveNewComponents, TEXT("Enable a fix to ensure new components in a cluster union are moved once on add (even if the cluster is not moving)."));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:1859
Scope (from outer to inner):
file
function void FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMeshes
Source code excerpt:
if (GKinematicDeferralCheckValidBodies && (BodyInst == nullptr || !BodyInst->IsValidBodyInstance()))
{
if (GKinematicDeferralLogInvalidBodies)
{
UE_LOG(LogChaos, Warning, TEXT("\n"
"Invalid FBodyInstance in FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMesh - Gathering Proxies\n"
"SkeletalMesh: %s\n"
"OwningActor: %s"),
*SkelComp->GetName(),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:1874
Scope (from outer to inner):
file
function void FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMeshes
Source code excerpt:
if (GKinematicDeferralCheckValidBodies && (ActorHandle == nullptr || ActorHandle->GetSyncTimestamp() == nullptr || ActorHandle->GetMarkedDeleted()))
{
if (GKinematicDeferralLogInvalidBodies)
{
UE_LOG(LogChaos, Warning, TEXT("\n"
"Invalid FPhysicsActorHandle in FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMesh - Gathering Proxies\n"
"SkeletalMesh: %s\n"
"OwningActor: %s"),
*SkelComp->GetName(),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:1944
Scope (from outer to inner):
file
function void FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMeshes
lambda-function
Source code excerpt:
if (GKinematicDeferralCheckValidBodies && (BodyInst == nullptr || !BodyInst->IsValidBodyInstance()))
{
if (GKinematicDeferralLogInvalidBodies)
{
UE_LOG(LogChaos, Warning, TEXT("\n"
"Invalid FBodyInstance in FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMesh - Add to Teleport Pool\n"
"SkeletalMesh: %s\n"
"OwningActor: %s"),
*SkelComp->GetName(),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:1959
Scope (from outer to inner):
file
function void FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMeshes
lambda-function
Source code excerpt:
if (GKinematicDeferralCheckValidBodies && (ActorHandle == nullptr || ActorHandle->GetSyncTimestamp() == nullptr || ActorHandle->GetMarkedDeleted()))
{
if (GKinematicDeferralLogInvalidBodies)
{
UE_LOG(LogChaos, Warning, TEXT("\n"
"Invalid FPhysicsActorHandle in FPhysScene_Chaos::UpdateKinematicsOnDeferredSkelMesh - Add to Teleport Pool\n"
"SkeletalMesh: %s\n"
"OwningActor: %s"),
*SkelComp->GetName(),