Move through but not stop on other entities


I’m using a point graph for a turn-based tactics game (the grid graph’s hex mode wasn’t playing nice with me, so I generate it using points instead).

In the case of an entity wanting to move adjacent to another entity, but there is already an entity on the closest node, how would I get a path to the nearest node that isn’t occupied (while still allowing to move through occupied nodes if necessary)?


Depends on how you mark the node. But for the most general approach you could subclass the NNConstraint class and override the Suitable method to return false for any nodes that are already occupied by other entities. Then add that as a parameter to an call.