For those of you new to thread, video below and the description explains one of the core aspects of what I’ve been doing with AI in UE4, which is setting up targeting system and completely automated behavior where a human player is not even involved!
Here below you see my RTS units going and attacking RTS buildings, picking paths and spreading out to cover more surface area!
[FONT=Comic Sans MS] AI Blows Stuff Up
https://youtube.com/gjCDA_FiVxk
Everything you see in the video is completely dynamically calculated by me in the C++!
Nothing is pre-scripted!
I do not even tell the AI units what to target when they are spawned!
Everything you see is my own AI system at work
-
all the pathing is my own pathing system, from scratch
-
I set up an Alignment system so the AI units know who is friendly and which structures to attack
-
The AI is told by me to spread out, and keep track of which structures other friendly units are attacking.
maximizes their usefulness to each other, as they cover maximum building surface area!
Meaning, if a new AI unit is trying to pick a target, my AI will try to pick a target that no other friendly in the area is attacking yet.
- Each AI unit is keeping track of all nearby friendly units during runtime, dynamically updating its personal list of friendlies every few moments.
means each AI unit is aware of all friendlies at all times, as well as all nearby structures
-
When a structure is destroyed, each AI unit tries to find a new target
-
Apex destructibles block the AI pathing, so they try to get around using my dynamic physics pathing system.
-
Each AI unit is consciously deciding how far to position itself away from the target building for ideal melee range.
-
Each AI unit is deciding when it is close enough to the surface area of its target structure and then stops moving and begins attacking.
-
As I said, nothing is pre-arranged, as you saw I ran multiple tests! The AI is spreading and and performing to all my specifications listed above!
-
Yay! Victory!!!
PS: the sparks are created at the precise point in the animation sequence that I specify, using an anim notify.
anim notify then calls my C++ AI function for doing damage.
So the visual appearance of doing damage is indeed triggering my C++ AI system !
The visual appearance and the C++ are linked together completely!