#include <MortarProAIController.h>
AI Controller Class . Mind Of AI contains logic for detecting actors using AI Perception
◆ AMortarProAIController()
AMortarProAIController::AMortarProAIController |
( |
| ) |
|
◆ BeginPlay()
virtual void AMortarProAIController::BeginPlay |
( |
| ) |
|
|
overrideprivatevirtual |
◆ DrawTextAtDetectedTargets()
void AMortarProAIController::DrawTextAtDetectedTargets |
( |
TArray< AActor * > & |
TargetActors | ) |
|
|
private |
Draws Debug Text At Detected Targets.
- Parameters
-
[in] | TargetActors | TArray containing actors sorted according to priority |
◆ FilterTargetActors()
void AMortarProAIController::FilterTargetActors |
( |
TArray< AActor * > & |
OutFilteredActors | ) |
|
|
private |
This will filter and select those actors only which are target of current actors If we select friends as target then this function will return only friends target If we select enemy target then this will return enemy target only
- Parameters
-
[out] | OutFilteredActors | Tarray of Actors which are filtered means actors that needs to be targetd. We initially pass detected actors |
◆ GetBestTarget()
void AMortarProAIController::GetBestTarget |
( |
TArray< AActor * > & |
OutDetectedActors | ) |
|
|
protected |
This Returns Array which is sorted according to some condition could be distance etc This Function is Blueprint Native Event Allowing User to override the functionality in Blueprints
- Parameters
-
[out] | OutDetectedActors | Tarray of Actors Detected by AI. This will sort The detected actors |
◆ GetBestTarget_Implementation()
virtual void AMortarProAIController::GetBestTarget_Implementation |
( |
TArray< AActor * > & |
OutDetectedActors | ) |
|
|
protectedvirtual |
◆ GetEnemyKey()
FName AMortarProAIController::GetEnemyKey |
( |
| ) |
const |
Getter Function To get the name of key that will be used in Blackboard
- Returns
- Name of Key as FName
◆ GetShouldTargetEnemies()
bool AMortarProAIController::GetShouldTargetEnemies |
( |
| ) |
const |
Getter Function To get whether to select enemy as target in behavior tree or not
- Returns
- Boolean flag denoting whether to select enemy or not
◆ GetShouldTargetFriends()
bool AMortarProAIController::GetShouldTargetFriends |
( |
| ) |
const |
Getter Function To get whether to select Friends as target in behavior tree or not
- Returns
- Boolean flag denoting whether to select friends or not
◆ GetShouldTargetNeutrals()
bool AMortarProAIController::GetShouldTargetNeutrals |
( |
| ) |
const |
Getter Function To get whether to select Neutrals as target in behavior tree or not
- Returns
- Boolean flag denoting whether to select Neutrals or not
◆ GetTeamAttitudeTowards()
ETeamAttitude::Type AMortarProAIController::GetTeamAttitudeTowards |
( |
const AActor & |
Other | ) |
const |
|
override |
Returns Behavior our AI Pawn towards a detected pawn
- Parameters
-
[in] | Other | Actor for which we want to evaluate attitude towards |
- Returns
- Attitude of Current owner towards Other
◆ IsValidTarget()
bool AMortarProAIController::IsValidTarget |
( |
const AActor * |
Target | ) |
|
Returns whether actor passed is target or not.Target depends on flags bShouldTarget Enemies/NEutrals/Friends. If we select target friends then in the case friends will be enemies :(
- Parameters
-
[in] | Target | Actor for which we will check whether it is valid or not |
- Returns
- True if target found False otherwise
◆ OnDeathDelegate()
void AMortarProAIController::OnDeathDelegate |
( |
| ) |
|
|
private |
Event Called On Death. Here we generally like to disconnect Controller which then can be deleted
◆ OnPauseDelegate()
void AMortarProAIController::OnPauseDelegate |
( |
| ) |
|
|
private |
Event Called When AI Dies and in future would want to resume
◆ OnResumeDelegate()
void AMortarProAIController::OnResumeDelegate |
( |
| ) |
|
|
private |
Event Called When AI Respawns after Death
◆ OnTeamChanged()
Callback Function When Team is changed
- Parameters
-
[in] | PreviousTeam | Details of Previous Team |
[in] | CurrentTeam | Details of Current Team |
◆ SenseAllActors()
virtual void AMortarProAIController::SenseAllActors |
( |
const TArray< AActor * > & |
ActorsDetected | ) |
|
|
privatevirtual |
Function to be called on Perception Updation
- Parameters
-
[in] | ActorsDetected | Tarray of Actors Detected by AI |
◆ SetEnemyKey()
void AMortarProAIController::SetEnemyKey |
( |
const FName & |
Key | ) |
|
This function sets the name of key that will be used in Blackboard
- Parameters
-
[in] | Key | Name of key that will be used in blackboard |
◆ SetPawn()
virtual void AMortarProAIController::SetPawn |
( |
APawn * |
InPawn | ) |
|
|
overrideprivatevirtual |
Sets Pawn and Register for events
- Parameters
-
◆ SetShouldTargetEnemies()
void AMortarProAIController::SetShouldTargetEnemies |
( |
const bool & |
bSelect | ) |
|
This function sets whether to choose enemy as target in behavior tree or not
- Parameters
-
[in] | bSelect | Boolean flag whether to select enemy or not |
◆ SetShouldTargetFriends()
void AMortarProAIController::SetShouldTargetFriends |
( |
const bool & |
bSelect | ) |
|
This function sets whether to choose Friends as target in behavior tree or not
- Parameters
-
[in] | bSelect | Boolean flag whether to select Friends or not |
◆ SetShouldTargetNeutrals()
void AMortarProAIController::SetShouldTargetNeutrals |
( |
const bool & |
bSelect | ) |
|
This function sets whether to choose Neutrals as target in behavior tree or not
- Parameters
-
[in] | bSelect | Boolean flag whether to select Neutrals or not |
◆ Tick()
void AMortarProAIController::Tick |
( |
float |
DeltaSeconds | ) |
|
|
overrideprotected |
◆ ActorsObject
Pointer To actors Object containing detected actors to be used in blackboard
◆ AIPerception
class UAIPerceptionComponent* AMortarProAIController::AIPerception |
|
protected |
AI Perception Event for detecting senses
◆ BehaviorTree
UBehaviorTree* AMortarProAIController::BehaviorTree |
|
protected |
Behavior Tree to run that will be setup in Blueprint
◆ BlackboardComponent
UBlackboardComponent* AMortarProAIController::BlackboardComponent |
|
protected |
Contains Blackboard all keys
◆ BlackboardData
UBlackboardData* AMortarProAIController::BlackboardData |
|
protected |
Blackboard to use Path Has to be setup in blueprint
◆ bTargetEnemy
uint32 AMortarProAIController::bTargetEnemy |
|
private |
Whether to Select Enemies i.e with diff team id . Detection by Affilation should be configured accordingly in AI Controller
◆ bTargetFriends
uint32 AMortarProAIController::bTargetFriends |
|
private |
Whether to Select Members of same team id . Detection by Affilation should be configured accordingly in AI Controller
◆ bTargetNeutrals
uint32 AMortarProAIController::bTargetNeutrals |
|
private |
Whether to Select Neutral Members i.e. of team id = 0. Detection by Affilation should be configured accordingly in AI Controller
◆ EnemyKey
FName AMortarProAIController::EnemyKey = "DetectedEnemies" |
|
private |
Key Name That Will be set in BehaviorTree By this keyname ai controller will set the values which will be later used Change Carefully need to change in behavior tree also
◆ HearingConfig
class UAISenseConfig_Hearing* AMortarProAIController::HearingConfig { nullptr } |
|
private |
◆ MortarProPawnRef
class AMortarProPawn* AMortarProAIController::MortarProPawnRef { nullptr } |
|
private |
◆ OwnerTeamID
FGenericTeamId AMortarProAIController::OwnerTeamID |
|
private |
Team ID of the owner of this AI Controller
◆ SightConfig
class UAISenseConfig_Sight* AMortarProAIController::SightConfig { nullptr } |
|
private |
Sight Sense. This is the dominant sense. we are having two senses only can add more from blueprint and also can change existing settings from there
◆ TargetActors
TArray<AActor*> AMortarProAIController::TargetActors |
|
private |
Contains Reference To Target Actors detected view AI perception and are valid targets
The documentation for this class was generated from the following file:
- Public/AI/MortarProAIController.h