I would like to know if I should use Grid Graph, Nav Mesh or Point Graph. Currently I am using Grid Graph but I would like to know which one is the best for RTS games.
I chose Grid Graph because of its description:
Grid Graphs for flexability, ease of use and fast updating. Perfect for TD games for example.
Grid Graphs are, as the name implies, built by arranging nodes in a grid like pattern. Nodes are sampled at grid coordinates and placed in the world. Grid Graphs allows for fast updating due to their regular structure. For TD or RTS games, or any other games which require frequent updating of the graphs to account for e.g user placed buildings, this graph is really useful.
If you have the pro version I am pretty sure the Recast graph is almost always the best option given its performance and scalability over large areas, it also has a lower memory footprint.
I think in one of the latest changes it has also been made so you can do partial updates on the graph rather than updating the entire thing, this way you can do quicker runtime updates rather than re-scanning the whole tree.
For an RTS type of game. Grid graphs can actually be better. In RTS type games you often want to place new buildings and you want to prevent placing buildings on top of other buildings and on slopes. This is easier to to with a grid graph. You can do it with a recast graph too, but it is trickier.
A recast graph would be better for performance though.
Hi Aron thanks a lot. It has been working really great although my units sometimes get stuck trying to pass over another unit that is not moving at all. I am not sure how to make units avoid other units that aren’t moving. I think the solution would be like that of buildings. May I ask how can I achieve it without affecting much the performance?
Yes, using graph update objects for immovable units can work. However make sure that you remove those obstacles before the units start to move again.
I would also recommend that you add a penalty instead of making the nodes unwalkable, that way they can still pass through each other if really necessary.
PS: Sorry for the late answer, I have been away for a while