I have the pathfinding system working pretty well in my game for one type of mob, but I need some advice on how to support different path abilities. I have some mobs that are larger than others so their valid path points are different (they can’t fit through a doorway, etc.). I’m using the build-in Seeker/AIPath scripts and a single A* Path object.
Should I create multiple grid graphs, one for each sized mob, and reference them in the AI scripts? If so, how?
Thanks
Hi
If you are using a grid graph, you can try using erosion and enabling “Erosion Uses Tags”. Then on your seekers you can specify which tags can be traversed and thus being able to get support for units of a different size.
See http://arongranberg.com/astar/docs_dev/class_pathfinding_1_1_grid_graph.php#af156f09628f08d32091ea67e48e42b71 for more information.
For navmesh based graphs, you have to use multiple graphs. When calling StartPath from the movement script, there is an optional parameter that you can specify which is called gridMask, it is a bitmask which tells the script which graphs it is allowed to search on.
So setting it to e.g (1<<0) will search only the first graph and setting it to (1<<1) will search only the second graph.