p.Chaos.GC.NetAwakeningMode
p.Chaos.GC.NetAwakeningMode
#Overview
name: p.Chaos.GC.NetAwakeningMode
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Changes how GC components ensure that their owner is awake for replication. 0 = ForceDormancyAwake, 1 = Use Flush Net Dormancy
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.GC.NetAwakeningMode is to control how Geometry Collection components ensure that their owner is awake for replication in networked environments.
This setting variable is primarily used in the Geometry Collection Engine module, which is part of Unreal Engine’s Chaos physics system. It specifically affects the networking behavior of Geometry Collection components.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands. By default, it is set to 1.
The associated variable GeometryCollectionNetAwakeningMode directly interacts with p.Chaos.GC.NetAwakeningMode. They share the same value and purpose.
Developers must be aware that this variable affects how Geometry Collection components handle network replication. It has two possible modes: 0 = ForceDormancyAwake 1 = Use Flush Net Dormancy
The best practice when using this variable is to understand the implications of each mode on network performance and choose the appropriate one for the specific use case. It’s also important to note that invalid values will default to ForceDormancyAwake mode.
Regarding the associated variable GeometryCollectionNetAwakeningMode:
This integer variable directly represents the mode set by p.Chaos.GC.NetAwakeningMode. It is used within the UGeometryCollectionComponent class to determine the desired net awakening mode.
The GetDesiredNetAwakeningMode function uses this variable to return an ENetAwakeningMode enum value. If the value is outside the valid range (0-1), it will log an error and default to ForceDormancyAwake mode.
Developers should be cautious when directly modifying GeometryCollectionNetAwakeningMode, as it’s preferable to use the console variable p.Chaos.GC.NetAwakeningMode for changing this setting. This ensures consistency across the engine and allows for runtime adjustments.
Best practices include using the GetDesiredNetAwakeningMode function when needing to check the current mode, rather than directly accessing GeometryCollectionNetAwakeningMode, as it provides error checking and proper enum conversion.
#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:138
Scope: file
Source code excerpt:
int32 GeometryCollectionNetAwakeningMode = 1;
FAutoConsoleVariableRef CVarGeometryCollectionNetAwakeningMode(TEXT("p.Chaos.GC.NetAwakeningMode"), GeometryCollectionNetAwakeningMode, TEXT("Changes how GC components ensure that their owner is awake for replication. 0 = ForceDormancyAwake, 1 = Use Flush Net Dormancy"));
DEFINE_LOG_CATEGORY_STATIC(UGCC_LOG, Error, All);
DEFINE_LOG_CATEGORY_STATIC(LogGeometryCollectionComponent, Warning, All);
extern FGeometryCollectionDynamicDataPool GDynamicDataPool;
#Associated Variable and Callsites
This variable is associated with another variable named GeometryCollectionNetAwakeningMode
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:137
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarGeometryCollectionUseReplicationV2(TEXT("p.Chaos.GC.UseReplicationV2"), GeometryCollectionUseReplicationV2, TEXT("When true use new replication data model"));
int32 GeometryCollectionNetAwakeningMode = 1;
FAutoConsoleVariableRef CVarGeometryCollectionNetAwakeningMode(TEXT("p.Chaos.GC.NetAwakeningMode"), GeometryCollectionNetAwakeningMode, TEXT("Changes how GC components ensure that their owner is awake for replication. 0 = ForceDormancyAwake, 1 = Use Flush Net Dormancy"));
DEFINE_LOG_CATEGORY_STATIC(UGCC_LOG, Error, All);
DEFINE_LOG_CATEGORY_STATIC(LogGeometryCollectionComponent, Warning, All);
extern FGeometryCollectionDynamicDataPool GDynamicDataPool;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:7247
Scope (from outer to inner):
file
function UGeometryCollectionComponent::ENetAwakeningMode UGeometryCollectionComponent::GetDesiredNetAwakeningMode
Source code excerpt:
constexpr int32 MaxNetAwakeningMode = 1;
ENetAwakeningMode Mode;
if (GeometryCollectionNetAwakeningMode < MinNetAwakeningMode || GeometryCollectionNetAwakeningMode > MaxNetAwakeningMode)
{
ensureMsgf(false, TEXT("Invalid NetAwakening mode configured, falling back to the default mode"));
Mode = ENetAwakeningMode::ForceDormancyAwake;
}
else
{
Mode = static_cast<ENetAwakeningMode>(GeometryCollectionNetAwakeningMode);
}
return Mode;
}
Chaos::FPhysicsObject* UGeometryCollectionComponent::GetPhysicsObjectById(Chaos::FPhysicsObjectId Id) const