Why doesn't my AI reach its goal destination?
I've some AI that have a behavior tree. They run about picking different targets and use a "simple Move to location" to navigate to them. I have a raycast for debugging that draws a line from their location to their target move location. The moves can move them around 20,000 unreal units in both directions. The terrain is relatively simple. Just a few gentle hills. no crazy angles. After they have moved around for a moment they tend to get stuck. It generally happens around completing one full move to 4-5 moves. But eventually they just stop. I can see in the behavior tree that the move branch is firing. I can see the blackboard value reading "moving" and I can go frame by frame watching the behavior tree seeing that it is in fact firing the correct branch and they should be trying to finish their move. However based on all of their path traces that I trace draw. I can see they have just stopped mid-move and loop this branch of the behavior tree. Now I'm sure I can just throw in a condition that will jump start them when they breakdown but I've explored what preciously is causing this and I cannot figure it out. I've also tried using Move to location over the "simple" version and it also produces the same effect. Again, I can see by the traces that their targets are perfectly sitting on top of the nav mesh and they should just continue to walk towards their target. But they just stop after a few goes. It looks like they just run out of rope. Is there something about long moves that causes this to happen?
I believe I have found the problem with this. Simple Move To Location must have built in "Pathfinding", because when I switch that node for "Move to Location" and disable "use pathfinding" on the node my problem goes away. I'm guessing that by teathering the AI to a point out in front that blended either slightly to the left, or slightly to the right. I think it would square up with what the pathfinding was wanting to do and essentially lock or clamp as they opposed one another.
answered Apr 29 '14 at 08:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here