p.GeometryCollectionAlwaysRecreateSimulationData

p.GeometryCollectionAlwaysRecreateSimulationData

#Overview

name: p.GeometryCollectionAlwaysRecreateSimulationData

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.GeometryCollectionAlwaysRecreateSimulationData is to control the recreation of simulation data for Geometry Collections in Unreal Engine’s experimental GeometryCollectionEngine module. This setting is primarily used for debugging and troubleshooting purposes within the editor.

This setting variable is used in the GeometryCollectionEngine module, which is part of Unreal Engine’s experimental features for handling complex geometry simulations, such as destruction and fracturing.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through the console. By default, it is set to false.

The associated variable bGeometryCollectionAlwaysRecreateSimulationData directly interacts with this console variable. They share the same value and are used interchangeably in the code.

Developers must be aware that enabling this variable can have performance implications in the editor. As the comment suggests, it should only be used as a last resort if the default behavior is causing issues. When enabled, it forces the recreation of simulation data even if it’s not marked as dirty, which can be computationally expensive.

Best practices for using this variable include:

  1. Keeping it disabled by default for optimal performance.
  2. Only enabling it temporarily for debugging purposes when issues with Geometry Collection simulation data arise.
  3. Disabling it immediately after resolving the issue to avoid unnecessary performance overhead.

Regarding the associated variable bGeometryCollectionAlwaysRecreateSimulationData:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:64

Scope: file

Source code excerpt:

bool bGeometryCollectionAlwaysRecreateSimulationData = false;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysRecreateSimulationData(
	TEXT("p.GeometryCollectionAlwaysRecreateSimulationData"),
	bGeometryCollectionAlwaysRecreateSimulationData,
	TEXT("always recreate the simulation data even if the simulation data is not marked as dirty - this has runtime cost in editor - only use as a last resort if default has issues [def:false]"));

namespace Chaos
{
	namespace CVars

#Associated Variable and Callsites

This variable is associated with another variable named bGeometryCollectionAlwaysRecreateSimulationData. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:62

Scope: file

Source code excerpt:

	TEXT("Enable generation of convex geometry on older destruction files.[def:true]"));

bool bGeometryCollectionAlwaysRecreateSimulationData = false;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysRecreateSimulationData(
	TEXT("p.GeometryCollectionAlwaysRecreateSimulationData"),
	bGeometryCollectionAlwaysRecreateSimulationData,
	TEXT("always recreate the simulation data even if the simulation data is not marked as dirty - this has runtime cost in editor - only use as a last resort if default has issues [def:false]"));

namespace Chaos
{
	namespace CVars
	{

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:1361

Scope (from outer to inner):

file
function     void UGeometryCollection::CreateSimulationDataIfNeeded

Source code excerpt:

void UGeometryCollection::CreateSimulationDataIfNeeded()
{
	if (IsSimulationDataDirty() || bGeometryCollectionAlwaysRecreateSimulationData)
	{
		CreateSimulationData();
	}
}