Advice and help on RTS based pathfinding

Hello,

I am currently using your asset to work on an RTS game and am currently using the latest beta version in UPM to do experiments.

The Local avoidance is much better in the beta and I still have work to do experimenting to find the best way to set it up. But for the rest of pathfinding I have a couple questions, referencing the Image

1- I am using the “ReachedDestination” check for many AI actions to determine if they have reached the enemy for melee or their end position, but I am having a bit of trouble finding the best values to set in the AIPath configuration, for the Slowdown distance and End Reached Distance. Considering that the unit radius is 0.6 in that image, any advice on those settings?

2- To move a unit to a building I use GetNearest with the Default constraint and I have 2 questions a) the path found is not the closest to the path start, am I confusing the use of GetNearest? b) I use the Simple Smooth Modifier and as you can see in the image, the path chosen goes through an unwalkable region, which is causing that single unit to get blocked 80% of the time in that corner. I do have constrain inside graph enabled.

3- Is it possible to get a little more info on how you achieve the “Firing squad” formation on your AI in the beta example? I would like to use that for my ranged units as well as possibly use it so that Melee units can better position themselves.

Thanks,
Ed

Also, is it possible to know when an AI has concluded that the destination is crowded? ReachedDestination doesn’t get set to true, DestinationIsCrowded does but as far as I am aware, it isn’t accessible in code.

  1. Not really, it all depends on your game. Usually I use something like 0.5radius for the end reached distance and 2radius for the slowdown distance, but it varies.

  2. If you request a path to a point the path will go from the closest point on the graph to the start point to the closest point on the graph to the end point.

  3. See your other thread.

  4. You can use ai.rvoDensityBehavior.reachedDestination. I’ll probably introduce a nicer API for this in the future.

Note that your simple smooth modifier is what is causing the path to pass through the building. It is smoothing the path too much.

2 Likes