Training Stream - Making Game Ready AI, Part 5 - Dec 1st, 2015

I have a related question…

What’s the best practice for using AI behavior trees in coordination with Animation blueprints?

For example, let’s say I have a monster who performs a grab attack. If the grab attack collides with an actor, I want to continue with the animation. If the grab attack fails to grab a character, I want to abort the animation and the AI behavior should try to do something else (such as moving closer or trying again). Currently, I’m using an anim notify event in the animation blueprint. When its triggered, the animation blueprint calls a method within the creature blueprint, such as “bool TryGrab()” which returns either true or false. If the grab succeeds, the animation proceeds. If it fails, it has to inform the Behavior tree by setting a behavior tree value to “aborted”. Otherwise, the behavior tree task is continuously waiting for the animation blueprint to set a blackboard key to “animation complete”, so that it can report “End Execute - Success” and move on to the next task.

One of the problems I’m finding with this setup is that this is very dependent on the animation blueprint to actually fire its anim notify events. For some unknown reason, in some cases, the anim notify events don’t get triggered. This causes the behavior tree to not get the “all good!” signal and it just continuously polls a task, waiting for it to complete when it never will.

I’ve tried to look at other content examples, but none seem to have a deeply complicated animation blueprint system or AI system for me to learn from. Am I doing all of this the wrong way?