BD + TPC + Astar: AI agent doesn't stop animation movement after "Seek"

Stormi

Member
Hey guys,

I am having some trouble with getting my test AI Agent to stop after seeking a target. I am using Behavior Designer incl. addons and the Third Person Controller together with Astar Pathfinding. So far I did:
  • Install Integration Packages TPC/Astar, BD/Astar (incl. those for the addons) and BD/TPC.
  • Create an AI Agent via Character Manager
  • Add the Astar AI Agent Movement Ability
  • Add Astar components (RichAI, Seeker)
  • Bake the Recast Navmesh
  • Add Behavior Tree Agent and Behavior Tree components
  • Define the behavior tree below and put the Player as target for both "Can See Object" and "Seek".
1609374707854.png

If I move the player in view, the AI correctly chases him and stops at the defined distance but only to keep walking in place. In regards to the behavior tree the seek task apparently is completed properly but the Animator Controller keeps looping the Movement Blend Tree which means neither Exit

A: Moving = False && AbilityIndex != 7
B: AbilityIndex == 12

gets triggered when "Seek" is ending. Is this correct and I am missing to add something? I would expect to have seek also stop the movement animation considering that the agent stops moving forward, which already indicates it does want to stop movement alltogether.

Thanks a lot for the help here.

PS: In regards to the distance the AI is supposed to stop at, what value does take priority here since the Seek Task has an "Arrive Distance", the Astar RichAI component an "End Reached Distance" and the TPC Astar Movement Ability a "Stopping Distance"?
 
Hi Justin,

unfortunately it does not. The same problems remain. But to make sure this is not because of a missing component / faulty setup:

When using the Recast Graph and RichAI from Astar, does this still require the AI Agent to have a Navmesh Agent Component? Currently I do not have this considering the character is moving just fine. The problem in my case is for the Animator to recognize, when to stop.

I checked the individual changes happening a bit more closely and as far as I can see the following does occur:
  • The AI Agent is correctly in Idle at start
  • Moving the Player in sight activates the "Can See Object" properly
  • "Seek" gets activated correctly and the Animator parameters ForwardMovement (0 -> 1), Speed (0 -> 1) and Moving (False -> True) change
  • When the AI Agent reaches the pre-defined acceptable distance to it's target the Seek Task returns success, even though I still dont know, which of the three values actually defines it:
    • "Arrive Distance" in the Seek Task
    • "End Reached Distance" in the Astar RichAI component
    • "Stopping Distance" in TPC Astar Movement Ability
When "Seek" returns success is where I would expect everything to stop. But all three changed animator parameters remain the same while only the actual movement in the world stops. So the AI Agent is continuing to walk on the spot as it never ends it's movement animation. Now I could write a few lines to take care of this without many problems, but I don't want to hotfix something that might just be a faulty setup or something else not done properly in the first place.
 
If you use a different graph type does it work? The Seek task will return success as soon as it gets within the Arrived Distance. You could try lowering that value to be less than the Stopping Distance/End Reached Distance to see if that helps.
 
A lower value for the seek arrived distance didn't do the trick either unfortunately. I'll just handle it via a combination of custom script / additional tasks considering the agent isn't supposed to just stand still after arriving at the seek target anyway. Thanks for the support.
 
Top