UCC agent can't get closer to nearby target - recommended AIPath values ?

Cheo

Active member
Hello, I'm having new difficulties with Astar and UCC : my objective is to create a simple tree ordering an agent to pursue another agent with the Seek task and to start using his weapon when inside of a small range, until the target is dead. The agent usually succeeds in approaching the target and dealing 2 blows, but the target often gets pushed back a little and the agent gets stuck in position, the Seek task highlighted in green in the tree but apparently unable to start, unless the attack range is increased (but since the agent is using a knife, he needs to be at a slightly smaller distance to hit his target).
There are no issues with a NavMesh agent using the exact same tree, and I can usually order my Astar UCC characters to move to a point right next to their feet with no problem. Reducing the "End Reached Distance" value from the AIPath component does help the agent starting the necessary movement, but it usually ends up with him turning in circles or maintaining his walking animation when reaching his destination (after all, the default value 0.2f seems already small).
This leads me to ask 2 questions : first, has anyone successfully created an Astar-UCC agent as I described chasing and attacking a target with a small range weapon ? And what values do you recommend for the AIPath component - or would you recommend leaving the default values ?
 
I am hoping somebody else has had this problem and can share what values they used. Unfortunately I have really only used the NavMeshAgent extensively.
 
This leads me to ask 2 questions : first, has anyone successfully created an Astar-UCC agent as I described chasing and attacking a target with a small range weapon ? And what values do you recommend for the AIPath component - or would you recommend leaving the default values ?

1. These are my values for A*. My capsule is radius .4 and height 1.8. My rotation speed might be too high, still. I had raised it a bunch awhile back when I was trying to write a custom rotation ability. Note: "End Reached Distance" is like a global stop point. You may have to lower it more than 2, but that can cause running into things that are also moving, like the player. The stopping distance on the ability is additive to that, I believe.
1628617375498.png

2. I would recommend that before attacking, you determine the distance to the target, and if it more than a certain amount, first activate a "lunge" ability for like .1f and then it calls attack after lunge is finished. The simplest way to do "lunge" would be to a generic ability, and on the a* movement, have a state override that sets stopping distance to 0. The more advanced way would be with an actual animation.
 
Hello, thanks for your answer ! I must say I don't understand how you can give a value of 2 to End Reached Distance, it is far too much, the default value of 0.2 is actually fine in my opinion. I'm also giving a very high rotation speed to my characters for the moment ! I did not try your suggestion as I found another solution last night : lowering the End Reached Distance value to something really small if necessary like 0.075 when giving an attack order, and then reverting to the default value once the enemy dies as well as sending an event to set isStopped to true on the AIDestinationSetter.
 
Hello, thanks for your answer ! I must say I don't understand how you can give a value of 2 to End Reached Distance, it is far too much, the default value of 0.2 is actually fine in my opinion. I'm also giving a very high rotation speed to my characters for the moment ! I did not try your suggestion as I found another solution last night : lowering the End Reached Distance value to something really small if necessary like 0.075 when giving an attack order, and then reverting to the default value once the enemy dies as well as sending an event to set isStopped to true on the AIDestinationSetter.
It probably depends on the graph's resolution for A*. I did increase mine because it was having trouble connecting some tunnels in my map, otherwise.
 
Top