- Home /
Navmesh carving and agent avoidence.
I want to create an rts based game, where the playing field is a 2d area. I am using A* right now, but want to have a more varied pathfinding system, and figured navmeshes would give me that. My problem with A* is that it is based off of nodes, and I want a volume based pathfinding system, so my agents don't go for predefined nodes.
My current test scene has agents being able to move, and I am able to carve out the navmesh with obstacles that move and the agents change paths based on this. What I want to happen is, when I have agents interrupting a path, I want them to try and find another way around, and if they can't, then default to waiting behind or close to the unit blocking the path.
I attached a navmesh obstacle to each agent, and enabled carving. I specified the radius to match my agent size. When I bake, the navmesh removes large areas from my navmesh and my agents just jump around and freak out. Is there any way to ovverride this behavior when a valid path cannot be found, and have agents wait or get as close to a goal as possible, but only if a path doesn't exist around other units?
The best example is if I have 4 or so units on one side of a wall, and 2 doors in the wall. I want units to choose a door that they can get into, where a unit isn't currently blocking the door, and if both doors are blocked, to then go to the nearest door and wait until it isn't. How can I accomplish this?
I believe it is called "local avoidence" or "RVO pathfinding". How can I achieve this effect with a navmesh?