Howdy;
I would like my AI to have two different movement styles;
- Optimal path: do normal pathfinding, respecting tags & node.penalty
- “As the crow flies”: respect tags BUT ignore penalties
Can I create a TraversalProvider to ignore node.penalties?
Howdy;
I would like my AI to have two different movement styles;
Can I create a TraversalProvider to ignore node.penalties?
Yes.
public static class DefaultITraversalProvider {
public static bool CanTraverse (Path path, GraphNode node) {
return DefaultITraversalProvider.CanTraverse(path, node);
}
public static uint GetTraversalCost (Path path, GraphNode node) {
// Ignore node.Penalty
return path.GetTagPenalty((int)node.Tag); // + node.Penalty;
}
}
Above and beyond, much obliged!