Capable for RTS

Hello,

I am a beginner at developing using Unity. For my first project I am working on an RTS style game.

I understand Unity has a build in pathfinding system. Is it adequate for RTS pathfinding. It seems, that with a good deal of units, pathfinding can get much more complicated.

I hope this question is not too general. But I would just like to get general opinions on the matter from more experienced developers.

Unity’s pathfinding system is not very good in my opinion, and I’m sure they are working in a new version with many of its lacking features, but it will still be enough for a simple RTS.

In a different note, I wouldn’t recommend an RTS as your first project, I’d rather start with a simpler and shorter project.

Edit: Also if you are interested in a good pathfinding solution I highly recommend: A* A* Pathfinding Project
There’s a free version that’s even better that what you can get with unity pro’s solution.

I have seen this A* popping up everywhere when I read about pathfinding. What are the benefits of it of Units pathfinding?

I think at most I would need 40 agents in a scene at once. More like 20 though. So if both perform similar in less demanding situations, I would opt for the one that is more streamlined to develop with.

Here you can compare Unity’s (PRO) with A*:
http://arongranberg.com/astar/freevspro

A* is pretty simple to implement.

Thank you for the link. This comparison uses Unity Pro. The navmesh pathfinding system has since been made available on Unity free. Can I assume that I could substitute in unity free for Unity Pro in this comparison sheet? Or are there still certain pathfinding features exclusive to Unity pro?

Things like navmesh carving (really useful) are still Unity Pro only :frowning:

Ok. Just wondering when that would be really useful? Would it not only be useful when your map actually changes shape?

“Adding movable obstacle for navmesh agents to avoid” is not the same as having navmesh agents avoiding other navmesh agents, is it? Because technically a blod of navmesh agents moving around is a “movable obstacle for navmesh agents to avoid”.

If you have a room with a door and you want an agent to go to the room it will try to go to the room through the door when it is blocking its path, instead of maybe going through the window or something, when you remove the door the agent can now freely go to the room through the new passage where the door was.
If you have navmesh carving, the door can create a “hole” in the mesh, so the agent won’t try to get through the door colliding indefinitely, instead it will find another way to go.

You see if your map is completely static, no moving obstacles, no disappearing/appearing buildings/obstacles carving isn’t needed, but in many cases there are dynamic obstacles especially in RTS.
Imagine Age of Empires, with carving, it behaves like it normally does now, without carving when you build a house and try to move a villager from one place to another, the path that he will take will go straight through the house, so the villager will collide with the house, never arriving to its destination because for the navmesh, nothing is there.

Wow so basically you can not use Unity free for RTS pathing :S. Sad panda…

EDIT: But wait? Don’t agents avoid each other? Couldn’t I just place a building down and make it an agent that never sends any movement commands? Then the other agents will avoid it no?

Aren’t doors supposed to be handled via Navmesh Links (you just turn them active/inactive depending on door state) and not really via carving (which is a heavier operation).

Though if it’s a multiplayer RTS using traditional lockstep, none of the traditional navigation libraries are usable because of their dependence on floating point.

I’m seeing A* pop up in this thread as if it is a product. A* is just the most common pathfinding algorithm used. The A* “product” linked is Aron Granberg’s pathfinding solution which uses the A* algorithm for pathfinding. Just wanted to make that clear in case it wasn’t already.

Thanks for not contributing at all. The project is not called “Aron Granberg’s pathfinding solution” like you insisted. It is called “A* Pathfinding project”. Regardless of if the name is named after an existing algorithm, that is the name.

Wow. Just wow.

I never insisted “Aron Granberg’s pathfinding solution” was the name of the product. That’s simply what it is. I wanted to clarify what exactly A* is because of this post:

So that you (and future readers) could understand that “seeing this A* popping up everywhere” could likely be in reference to the algorithm, not Aron Granberg’s “A* Pathfinding Project”.

It was in case people didn’t already realize. I don’t know your past or your experience, but I guess in the future I should just sit and expect that everyone in the thread (and everyone in the future looking at this thread trying to figure out RTS pathfinding) knows every fact in the world.

You’re very welcome for my non-contributing post.

I prefer Unity’s Navigation system, as it is quite good and easy solution even for large scale RTS games. I used built-in navigation into my free uRTS asset:

where I easily get multiple thousands of agents moving along their paths on the map at 40-50 FPS. In free version of Aron’s solution I was able to get only few hundreds agents at reasonable FPS.

Unity 5 personal now brings off-mesh links for free. It also became more precise and more naturally looking navigation than in 4.x cycle. However, it came at the cost that it’s a bit heavier for large number of agents than in 4.x :slight_smile:

For a single player RTS, Unity Navigation will be perfect. It works well for up to 400 units with reasonably complex maps.

Is there some reason it would not be sufficient for multiplayer?