AISystemModuleName

AISystemModuleName

#Overview

name: AISystemModuleName

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 AISystemModuleName is to specify the name of the module responsible for spawning the AI system in Unreal Engine 5. It is used to define which module should be used to create and manage the AI system within the game engine.

This setting variable is primarily relied upon by the AI system and the core Engine module. Based on the provided callsites, it is used in the UAISystemBase class, which is part of the Engine’s AI framework.

The value of this variable is set through the Unreal Engine’s configuration system. It is declared as an UPROPERTY with the ‘globalconfig’ specifier, meaning it can be set in the project’s configuration files or through the editor’s project settings.

AISystemModuleName interacts with the bInstantiateAISystemOnClient variable, which determines whether the AI system should be created on client instances. It also works in conjunction with the AISystemClassName property to fully define the AI system’s setup.

Developers must be aware that:

  1. This variable needs to reference a valid module that implements the IAISystemModule interface.
  2. If left empty, it may result in no AI system being created.
  3. The module specified here is responsible for spawning the entire AI system, so choosing the correct module is crucial for AI functionality.

Best practices when using this variable include:

  1. Ensure the specified module exists and is properly implemented before setting this variable.
  2. Coordinate the setting of this variable with the AISystemClassName to ensure compatibility.
  3. Consider the implications for networked games, especially in relation to the bInstantiateAISystemOnClient setting.
  4. Document any custom AI system modules used in the project to maintain clarity for the development team.
  5. Test AI functionality thoroughly after changing this setting to ensure the desired AI system is correctly instantiated and functioning.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3229, section: [/Script/Engine.AISystemBase]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/AI/AISystemBase.h:58

Scope (from outer to inner):

file
class        class UAISystemBase : public UObject

Source code excerpt:

	/** Name of a module used to spawn the AI system. If not empty, this module has to implement IAISystemModule */
	UPROPERTY(globalconfig, EditAnywhere, Category = "AISystem", noclear, meta = (MetaClass = "/Script/AIModule.AISystem", DisplayName = "AISystem Module"))
	FName AISystemModuleName;

	FDelegateHandle OnMatchStateSetHandle;

	/** Whether the AI system class should be spawned when connecting as a client */
	UPROPERTY(globalconfig, noclear)
	bool bInstantiateAISystemOnClient;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/World.h:2411

Scope: file

Source code excerpt:

	/** AISystem getter. if AISystem is missing it tries to create one and returns the result.
	 *	@NOTE the result can be NULL, for example on client games or if no AI module or AISystem class have not been specified
	 *	@see UAISystemBase::AISystemClassName and UAISystemBase::AISystemModuleName*/
	UAISystemBase* CreateAISystem();

	/** AISystem getter */
	FORCEINLINE UAISystemBase* GetAISystem() { return AISystem; }
	/** AISystem const getter */
	FORCEINLINE const UAISystemBase* GetAISystem() const { return AISystem; }
	
	/** Avoidance manager getter */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AI/AISystemBase.cpp:14

Scope (from outer to inner):

file
function     FName UAISystemBase::GetAISystemModuleName

Source code excerpt:

{
	UAISystemBase* AISystemDefaultObject = Cast<UAISystemBase>(StaticClass()->GetDefaultObject());
	return AISystemDefaultObject != NULL ? AISystemDefaultObject->AISystemModuleName : TEXT("");
}

FSoftClassPath UAISystemBase::GetAISystemClassName()
{
	UAISystemBase* AISystemDefaultObject = Cast<UAISystemBase>(StaticClass()->GetDefaultObject());
	return AISystemDefaultObject != NULL ? AISystemDefaultObject->AISystemClassName : FSoftClassPath();