AIIgnorePlayers
AIIgnorePlayers
#Overview
name: AIIgnorePlayers
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AIIgnorePlayers is to toggle a setting that determines whether AI controllers should ignore players in the game world. This is primarily used for debugging and testing AI behavior without player interference.
AIIgnorePlayers is part of the AI Module in Unreal Engine 5. It is specifically used within the AISystem, which is a core component of the engine’s artificial intelligence framework.
The value of this variable is not directly set as a traditional variable. Instead, it’s a function that toggles a state within the AI system. The actual toggling occurs in the AAIController class, as evidenced by the call to AAIController::ToggleAIIgnorePlayers() in the AISystem.cpp file.
This variable (or rather, function) interacts with the AI perception system. When toggled, it affects how AI controllers perceive and respond to player characters in the game world.
Developers must be aware that this is primarily a debugging tool. It should not be used as a gameplay feature in a production environment unless there’s a specific design reason for doing so. Toggling this setting can significantly alter AI behavior, which could lead to unexpected results if not properly managed.
Best practices when using this function include:
- Use it only during development and testing phases.
- Ensure it’s turned off before building for release.
- If used in gameplay, document its usage clearly and consider its implications on game balance and player experience.
- Be aware that it affects all AI controllers globally when toggled.
- Use in conjunction with other AI debugging tools for comprehensive AI behavior testing.
Remember that this function is part of the engine’s exec commands, meaning it can be called from the console during runtime, which can be useful for on-the-fly debugging but should be secured in a shipping build.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Classes/AISystem.h:193
Scope (from outer to inner):
file
class class UAISystem : public UAISystemBase
Source code excerpt:
//----------------------------------------------------------------------//
UFUNCTION(exec)
AIMODULE_API virtual void AIIgnorePlayers();
UFUNCTION(exec)
AIMODULE_API virtual void AILoggingVerbose();
/** insta-runs EQS query for given Target */
AIMODULE_API void RunEQS(const FString& QueryName, UObject* Target);
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/AISystem.cpp:162
Scope (from outer to inner):
file
function void UAISystem::AIIgnorePlayers
Source code excerpt:
}
void UAISystem::AIIgnorePlayers()
{
AAIController::ToggleAIIgnorePlayers();
}
void UAISystem::AILoggingVerbose()
{
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/AISystemExec.cpp:32
Scope (from outer to inner):
file
function bool FAISystemExec::Exec_Dev
Source code excerpt:
if (AISys != NULL)
{
if (FParse::Command(&Cmd, TEXT("AIIgnorePlayers")))
{
AISys->AIIgnorePlayers();
bHandled = true;
}
else if (FParse::Command(&Cmd, TEXT("AILoggingVerbose")))
{
AISys->AILoggingVerbose();
bHandled = true;