Pathfind to neighbours of custom shaped objects

Hello,

I am using a grid graph for a rimworld like game and need to pathfind to neighbour tiles of objects (for example if a furniture is beeing build the character needs to stand adjacent to the object).

So i would like to be able to pass a set of graphnodes (neighbours) to the pathfinding while making it search for a path to the objects main tile and as soon as it gets to one of the neighbours it should stop and return the path for my character (and behave like its found its destination).

I would be glad if someone could give me a hint where to start.

Also pardon my english please, im not a native speaker.

Hi

Sorry for the late answer.

This is possible using the MultiTargetPath. How to calculate which nodes are “neighbours” to a give object is something very game specific however. Presumably you have some interaction points which you can use as targets?

See https://arongranberg.com/astar/docs/seeker.html#StartMultiTargetPath

Hey,

I managed to solve this by setting the flag1 bools in ABPath for the graphNodes I need and so far the asset seems to behave exactly like I want it to.

I am very happy with it btw, the performance is just great. Thank you very much for the good work!

1 Like