Different agents using different penalties

Hi Aron,

Thank you again for your amazing support of the package. As the title says I was just wondering what the best way to have different agent classes call paths that utilise different sets of penalties, eg agent A uses A penalties, and agent B for B penalties. Would you have to have multiple graphs or would there be a way to pass through the class of the agent into the pathfinding request?

This is a sort of roundabout way that I am trying to implement angular (turn) penalties to promote straighter or more (initially) visible paths in a agent based simulation, as I can precalculate multiple sets of (angular) penalties for a set of initial points.

Kind Regards,
Liam

Hi

Yes. The first option is to use tags. See https://arongranberg.com/astar/docs/tags.php.
You can mark an area with a tag and then on the Seeker component you can specify how high of a penalty each tag should give to that particular character.

For an alternative approach I recommend that you read the section called ITraversalProvider here https://arongranberg.com/astar/docs/turnbased.html#ITraversalProvider. It’s a bit more complex, but it’s more flexible.