RTS: need basic local avoidance, & pathfinding for all buildings created in game

Hi I am quite new to unity and game development.
Recently, I have begun an RTS game, and so far have most things implemented except path finding and local avoidance. I used the free version of this project, and tested it out. I was wondering though, if i did buy the pro version, would ,my units be able to avoid newly created buildings, and have some very basic local avoidance (even if it means groups of units walk around each other instead of through) while still getting a good frame rate?
And also if possible, how difficult would this be to implement with the pro version?

Aron Granberg will probably correct me if I’m wrong, but actually, there is a dilemma :

1/ a RTS with buildings added dynamically require a pathfinding graph updated dynamically. Grid graph is the best choice for that.

2/ Local avoidance is independent of pathfinding Graph choice, but to prevent agents to enter in static obstacles when avoiding other agents, you need to build RVOObstacles around obstacles detected by the pathfinding graph. In the current PRO version, the automatic creation of RVOObstacles is only provided for navmesh Graph.

Two possibles solutions :

  • Enhancing pathfinding : implementing dynamic update graph for Recast Navemesh (I’ve read somewhere that Aron plan to work on it), so you can use navmesh for a RTS.

-Enhancing local avoidance : implementing automatic creation of RVOObstacles for Grid Graph (I personally work on that subject and share my code with Aron and all A* Pro owners), so you can use Grid Graph.

There are probably some workaround, particularly if your buildings are small (they may be managed like some static agent for local avoidance). But if your buildings are bigger they need to be taken in account by both Local Avoidance and Pathfinding, else your agents may be stuck.

Hey pat thanks for the response.
So you think it would definitely be worth me buying pro for the local avoidance?
I might just do that then, the only thing I am worried about however, is that I’ll fork out $100 for it and have no idea how to implement it. Is there a guide, or any place that explains the local avoidance system thoroughly?

This A* Pathfinding Project is one of the best documented add-on available for Unity. The Pro version comes with additional examples and one of them is related to local avoidance. The online documentation is also very good :

HI Pat,
For the local avoidance ,I have a question about it .
In my game ,there are many characters which will find the target ,when they find it ,they will stop and attack the target .
I attached these characters with the script RVOController,then these characters can avoid other characters when they are finding the target.
but the problem is that :it will push away some characters which is stop and attacking the target.
this is obvious not what we need .
can you tell me how to solute it ?
thanks !

can you tell me how to fix it ?

i got it .
set locked = true

when a character is stop .I set its locked of rvoController true, but other characters can not walk arount it now ,what am i gonna do now ? so sad !


Everything Pat_AfterMoon has said is correct. (thanks!)
Locked = true works, the problem is that the RVO/ORCA algorithm used assumes that two agents will take equal responsibility for moving out the way, something locked=true prevents. The effect can be decreased by adding a small force based avoidance, this is something not included so far in the system, but can be as simple as ‘add force away from that other nearby unit’, or to work better with the rvo system, add it to the desired velocity of the agent so that it will move less straight on.

If you need to avoid a large group of units, local avoidance won’t help you much. Then you will need to either update the graph to make the area where the non-moving agents are unwalkable, or add a high penalty to that area (something I think is a better option since it prevents completely blocking all paths there, just make sure to add a high enough penalty).