SignificanceManagerClassName

SignificanceManagerClassName

#Overview

name: SignificanceManagerClassName

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 SignificanceManagerClassName is to specify the game-specific significance manager class that should be instantiated by the Significance Manager system in Unreal Engine 5. This variable is crucial for customizing the behavior of the Significance Manager, which is responsible for managing the significance of various game objects and optimizing performance.

The SignificanceManagerClassName is primarily used by the Significance Manager subsystem, which is part of the SignificanceManager plugin in Unreal Engine 5. This plugin is designed to help developers optimize game performance by managing the level of detail and update frequency for game objects based on their significance to the player.

The value of this variable is set in two ways:

  1. It can be configured globally through project settings, as indicated by the UPROPERTY macro with the “globalconfig” specifier.
  2. It is also set in the USignificanceManager constructor to default to the current class.

This variable interacts with other components of the Significance Manager system, particularly in the FSignificanceManagerModule::OnWorldInit function, where it’s used to load the appropriate SignificanceManager class.

Developers must be aware of the following when using this variable:

  1. It should point to a valid USignificanceManager subclass.
  2. Changing this value will affect the behavior of the entire Significance Manager system in the game.
  3. It’s a FSoftClassPath, which means it can be dynamically loaded at runtime.

Best practices when using this variable include:

  1. Only modify it if you need to implement custom significance management logic.
  2. Ensure that the class specified exists and is properly implemented before setting this variable.
  3. Consider the performance implications of your custom SignificanceManager class, as it will be used throughout the game.
  4. Use the project settings to configure this value rather than hard-coding it, to allow for easier changes and maintenance.
  5. Document any custom implementation thoroughly, as it affects a critical performance optimization system.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:292, section: [/Script/SignificanceManager.SignificanceManager]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/SignificanceManager/Source/SignificanceManager/Private/SignificanceManager.cpp:125

Scope (from outer to inner):

file
function     void FSignificanceManagerModule::OnWorldInit

Source code excerpt:

		if (*SignificanceManagerClass == nullptr)
		{
			SignificanceManagerClass = LoadClass<USignificanceManager>(nullptr, *GetDefault<USignificanceManager>()->SignificanceManagerClassName.ToString());
		}

		if (*SignificanceManagerClass != nullptr)
		{
			const USignificanceManager* ManagerToCreateDefault = SignificanceManagerClass->GetDefaultObject<USignificanceManager>();
			if ((ManagerToCreateDefault->bCreateOnServer && !IsRunningClientOnly()) || (ManagerToCreateDefault->bCreateOnClient && !IsRunningDedicatedServer()))

#Loc: <Workspace>/Engine/Plugins/Runtime/SignificanceManager/Source/SignificanceManager/Private/SignificanceManager.cpp:173

Scope (from outer to inner):

file
function     USignificanceManager::USignificanceManager

Source code excerpt:

	: Super()
{
	SignificanceManagerClassName = FSoftClassPath(GetClass()); 

	bCreateOnClient = true;
	bCreateOnServer = true;
	bSortSignificanceAscending = false;
}

#Loc: <Workspace>/Engine/Plugins/Runtime/SignificanceManager/Source/SignificanceManager/Public/SignificanceManager.h:198

Scope (from outer to inner):

file
class        class USignificanceManager : public UObject

Source code excerpt:

	// Game specific significance class to instantiate
	UPROPERTY(globalconfig, noclear, EditAnywhere, Category=DefaultClasses, meta=(MetaClass="/Script/SignificanceManager.SignificanceManager", DisplayName="Significance Manager Class"))
	FSoftClassPath SignificanceManagerClassName;

	// Callback function registered with HUD to supply debug info when ShowDebug SignificanceManager has been entered on the console
	void OnShowDebugInfo(AHUD* HUD, UCanvas* Canvas, const FDebugDisplayInfo& DisplayInfo, float& YL, float& YPos);

	// Friend FSignificanceManagerModule so it can call OnShowDebugInfo and check 
	friend class FSignificanceManagerModule;