Getting an AI to clear their Target after killing them (simulating physics to ragdoll) using AIPerception?

Kami822
Tue, 25 Sep 2018 03:56:03 +0000
World Creation

I just recently started learning AIPerception and using it with Blackboard to make an AI capable of team vs team fighting -

I’m using On AI Perception Updated and Sight as the primary sense within the AI Controller. Upon an actor successfully sensed, that sensed Actor is set as a blackboard key called TargetActor and I made sure that the AI only sets a new target only if they don’t have a TargetActor set. Because my characters Simulate Physics when they “die” instead of using Destroy Actor, I set the dead Actors as “Downed” using Tags. Back inside the AI Controller where the AIPerception is, I then put a condition - if the sensed Actor has the “Downed” tag, they will set their TargetActor to None.

What I realized was wrong with that was that, instead of removing that specific “Downed” TargetActor, it caused my AI to wander around in Idle ignoring perceived enemy actors because they constantly sensed “Downed” enemies who were laying around. Thus, I don’t know how to remove the specific “Downed” enemy as TargetActor and get them to switch to a new TargetActor.

I am currently stuck on trying to make an Array that adds perceived enemy actors and removes “Downed” enemies of that each side uses to store TargetActors so they can switch targets to another perceived enemy once they kill their TargetActor. This is difficult for me because I don’t know how to integrate an Array into Blackboard and have that information communicated across all teammates.

I ask about arrays in blackboard here:

Epic Developer Community Forums – 25 Sep 18

How to set up a custom BP to put an Array into Blackboard Key?

In this post: Mieszko mentions that arrays aren’t supported as a blackboard key and recommends making a custom blueprint to store the information and then use Blackboard to store that. I have just in the past few days learned about Arrays and...

I want to ask - Are there any other methods I can use to clear the specific TargetActor with the actors using “Downed” tag? I’m not sure how to approach this at this moment so some tips would be greatly appreciated.

I based my scripts off of the Advanced AI Tutorial provided by Epic.

Setting Up Advanced AI | Live Training | Unreal Engine

Thanks!!

9 posts - 5 participants