I have set up erosion using tags to prevent movers from trying to get through places that are too narrow. When they try to path to the destination and there is no room, the path calc fails (path.error == true). What I want them to do is go as far as they can to the destination (they are pursuing a target). Is there a way to tell if the reason the path calc failed was tag mismatch? Does IsPathPossible() take tags into account when determining reachability? Is there any way to find the closest point the pathfinding reached before it gave up because of the tag mismatch?
IsPathPossible does not take that into account.
Do you really need to use tags or could you just use normal erosion? Do you have several different agents of different sizes?
Yes, there are agents with very different sizes - all spaceships. We want the larger ships to find a different path through tight spaces or, if there is none, position themselves at the opening through which the player has gone and stand guard.
I’m having this same issue now.
I would love to be able to have a function like “IsPathPossible()” that will take tags into account. Currently I’m wanting to allow players to build walls in my game. With this, they will create entirely enclosed spaces (i.e. areas that are not reachable from the outside, but can be walked around in on the inside. Using tags, the path is always seen as possible, even when it’s a path into an enclosed area that should not be possible.
Well, to know for sure if the reason the path failed was because of tags, then you have to request two paths, one with the tag constraint and one without the tag constraint.
Possibly what you could do is assign the tags a huge penalty so that they will be avoided, then you can process the path so that it only moves along the waypoints which have correct tags and stops when it finds a waypoint it cannot traverse.