A* Pathfinding Project

RTS game pathfinding


#1

Hello,

Bought your asset but now I’m kind of confused because I can’t find anywhere in the documentation very clear explanations on how to achieve this kind of basic use case.
I want units to pathfind around each other. Like if one ranged units stop to shoot, then melee units pathfind around them.
And also, when you order units go to a position I want them to go to that position but not take the same path.

What are the best scripts for this?
Is grid graph best?


#2

No answer I bought an 100€ asset? Really?


#3

Hi

Currently there is no example of this built in to the package. I am however working on a demo for rts functionality that also includes some nicer local avoidance specifically for rts games.

You can find this beta if you go to the download page (https://www.arongranberg.com/astar/download) and click the ‘Show Older Versions’ button and download the RTS beta (note that it requires Unity 2019.1 to run).
Here is a video of how it looks: https://www.youtube.com/watch?v=wBUdMXeeej0&feature=youtu.be

This really depends on what kind of behavior you want. Usually you just want local avoidance for this. If one uses SC2 as an example, that is doable with only local avoidance.

A grid graph is usually pretty good for rts games if you are going to be building buildings and your map is not too large. A recast graph could be an option otherwise.


#5

Thanks I’ll check it out. If it works well I might use the beta branch in my project.


#6

kuva

I downloaded the RTS beta as you suggested but in the example scene all the meshes for the units are missing. It seems they are not included in the package.


#7

Hi

I think that beta version requires a relatively recent version of Unity. Try it with Unity 2019.1. Hopefully it should work better.


#8

Hello Aron!

The behavior shown in your RTS demo is very relevant to the project that I’m currently working on. Do you have an estimate on when these additions will be included as an official release (e.g. non-beta)?

Thank you!