HighSpawnRateOrBurstThreshold

HighSpawnRateOrBurstThreshold

#Overview

name: HighSpawnRateOrBurstThreshold

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of HighSpawnRateOrBurstThreshold is to set a threshold for identifying particle systems with high spawn rates or burst counts in Unreal Engine 5. It is used as part of the particle system auditing process to flag potentially performance-intensive particle effects.

This setting variable is primarily used by the Unreal Engine Editor subsystem, specifically within the ParticleSystemAuditCommandlet. This commandlet is a tool used for auditing and analyzing particle systems in Unreal Engine projects.

The value of HighSpawnRateOrBurstThreshold is set in the constructor of the UParticleSystemAuditCommandlet class, with a default value of 35.0. It is defined as a UPROPERTY with the ‘config’ specifier, which means it can be modified through configuration files.

The HighSpawnRateOrBurstThreshold interacts with the particle system’s spawn rate and burst count values. It is used to compare against the constant spawn rate of UDistributionFloatConstant and the count of each FParticleBurst in the BurstList.

Developers should be aware that this variable is used for auditing purposes and does not directly affect the runtime behavior of particle systems. It’s a tool for identifying potentially performance-intensive particle effects during development.

Best practices when using this variable include:

  1. Adjusting the threshold value based on the specific needs and performance targets of your project.
  2. Using the ParticleSystemAuditCommandlet regularly during development to identify particle systems that may need optimization.
  3. Considering the context of your game when interpreting the results, as some high-intensity particle effects may be intentional and necessary for certain visual effects.
  4. Using this threshold as a guideline rather than a strict rule, and evaluating flagged particle systems on a case-by-case basis.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:322, section: [/Script/Engine.ParticleSystemAuditCommandlet]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Commandlets/ParticleSystemAuditCommandlet.h:39

Scope (from outer to inner):

file
class        class UParticleSystemAuditCommandlet : public UCommandlet

Source code excerpt:

	/** If a particle system has a spawn rate or burst count greater than this value, it will be reported */
	UPROPERTY(config)
	float HighSpawnRateOrBurstThreshold;

	/** If a particle system has an LODDistance larger than this value, it will be reported */
	UPROPERTY(config)
	float FarLODDistanceTheshold;

	/** The folder in which the commandlet's output files will be stored */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ParticleSystemAuditCommandlet.cpp:28

Scope (from outer to inner):

file
function     UParticleSystemAuditCommandlet::UParticleSystemAuditCommandlet

Source code excerpt:

	: Super(ObjectInitializer)
{
	HighSpawnRateOrBurstThreshold = 35.f;
	FarLODDistanceTheshold = 3000.f;
}

int32 UParticleSystemAuditCommandlet::Main(const FString& Params)
{
	if (!FParse::Value(*Params, TEXT("AuditOutputFolder="), AuditOutputFolder))

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/ParticleSystemAuditCommandlet.cpp:195

Scope: file

Source code excerpt:

										if (UDistributionFloatConstant* ConstantDistribution = Cast<UDistributionFloatConstant>(SpawnModule->Rate.Distribution))
										{
											if (ConstantDistribution->Constant > HighSpawnRateOrBurstThreshold)
											{
												bHasHighSpawnRateOrBurst = true;
											}
										}

										for (const FParticleBurst& Burst : SpawnModule->BurstList)
										{
											if (Burst.Count > HighSpawnRateOrBurstThreshold)
											{
												bHasHighSpawnRateOrBurst = true;
											}
										}
									}
								}