Tag penalties and errosion\seeker radius?

Hello,

Is there any way to accounting seeker radius\errosion tags when using tag penalties? For example, whe i use tag penalties on some zone seeker find path on border of these zone but my seeker is big, so i want to step away from border.

Thanks.

Hi

Yes, simply set high penalties for the first tags in the Seeker component if you have erosion tags enabled.
See http://arongranberg.com/astar/docs/class_pathfinding_1_1_grid_graph.php#af156f09628f08d32091ea67e48e42b71

Thank you. Ok, may be also there is an easy way to check node (I use grid graph with “Erosion uses tags enables”) have they erosion layer, anf if so - which one? Basicaly i want to check is there posible to reach this node by squad with some width or no, for some other stuff. May be is there another way to achive this?

Hi

You can check the tag of a node using

var myNode = AstarPath.instance.GetNearest(transform.position, NNConstraint.Default).node;
var tag = myNode.Tag;

However that doesn’t necessarily mean it is possible to reach that node. It could be that it was blocked earlier. You can use the PathUtilities.IsPathPossible method (the overload which takes a tag mask) to check if some nodes can be reached from some other nodes while taking into account tags, however you should know that doing that is just as slow as a regular path request.