Perception

Perception

#Overview

name: Perception

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 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Perception in the context of Unreal Engine 5’s AI module is to represent a specific AI resource related to perception capabilities. It is used to manage and track AI perception tasks within the engine’s AI system.

This setting variable is primarily used within the AIModule subsystem of Unreal Engine 5. Based on the provided callsites, it is referenced in the AI testing suite and core AI functionality.

The value of this variable is set in the AIModule’s AITypes.cpp file, where it is defined as a constant FAIResourceID with the string value “Perception”.

Perception interacts with other AI resource variables such as Movement and Logic. These resources are part of a broader system for managing AI tasks and priorities.

Developers should be aware that:

  1. Perception is one of the core AI resources in Unreal Engine 5.
  2. It is used in conjunction with FAIResourcesSet to manage AI tasks.
  3. The resource is registered automatically during engine initialization.

Best practices when using this variable include:

  1. Use it in conjunction with FAIResourcesSet when managing AI perception tasks.
  2. Be aware of its interaction with other AI resources like Movement and Logic.
  3. Utilize it in AI behavior trees or task systems to prioritize perception-related actions.
  4. When creating custom AI systems, consider how Perception fits into the resource management hierarchy.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3249, section: [GameplayDebuggerSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Developer/AITestSuite/Private/Tests/ResourceIdTest.cpp:98

Scope (from outer to inner):

file
function     virtual bool InstantTest

Source code excerpt:

		{
			const FAIResourceID& MovementResource = FAIResources::GetResource(FAIResources::Movement);
			const FAIResourceID& PerceptionResource = FAIResources::GetResource(FAIResources::Perception);

			FAIResourcesSet ResourceSet;
			ResourceSet.AddResource(PerceptionResource);
			AITEST_TRUE("Resource Set should contain added resource", ResourceSet.ContainsResource(PerceptionResource));
			AITEST_TRUE("Resource Set should contain added resource given by Index", ResourceSet.ContainsResourceIndex(PerceptionResource.Index));
			for (uint8 FlagIndex = 0; FlagIndex < FAIResourcesSet::MaxFlags; ++FlagIndex)

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Classes/AITypes.h:426

Scope (from outer to inner):

file
namespace    FAIResources

Source code excerpt:

	extern AIMODULE_API const FAIResourceID Movement;
	extern AIMODULE_API const FAIResourceID Logic;
	extern AIMODULE_API const FAIResourceID Perception;
	
	AIMODULE_API void RegisterResource(const FAIResourceID& Resource);
	AIMODULE_API const FAIResourceID& GetResource(int32 ResourceIndex);
	AIMODULE_API int32 GetResourcesCount();
	AIMODULE_API FString GetSetDescription(FAIResourcesSet ResourceSet);
}

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/AITypes.cpp:92

Scope (from outer to inner):

file
namespace    FAIResources

Source code excerpt:

	const FAIResourceID Movement = FAIResourceID(TEXT("Movement"));
	const FAIResourceID Logic = FAIResourceID(TEXT("Logic"));
	const FAIResourceID Perception = FAIResourceID(TEXT("Perception"));

	TArray<FAIResourceID> ResourceIDs;

	void RegisterResource(const FAIResourceID& Resource)
	{
		if (FAIResourceID::GetSize() > static_cast<uint32>(FAIResources::ResourceIDs.Num()))

#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/AITypes.cpp:143

Scope (from outer to inner):

file
function     FAIResourceSetup

Source code excerpt:

		FAIResources::RegisterResource(FAIResources::Movement);
		FAIResources::RegisterResource(FAIResources::Logic);
		FAIResources::RegisterResource(FAIResources::Perception);
	}
} ResourceSetup;

//----------------------------------------------------------------------//
// FAIRequestID
//----------------------------------------------------------------------//