Best way to select groups of nodes?

There are situations in my game where I need to select multiple grid cells at the same time based on a central point (ex: moving multiple units to an area, visualizing all of the grid cells that will be affected by an ability, etc.). Right now I’m using GetConnections to get the surrounding nodes from a single point but is it possible to extend that?

Like if GetConnections gets 1 layer of surrounding nodes, how would I go about getting 2 or 3 layers around that node?

I’ve been looking around the docs and forms and haven’t seen anything about this but sorry if I missed anything. (Using nodes, GraphNode)

Update: it looks like PointKDTree could be what I’m looking for but I can’t find any examples of how to put it into practice and suck too much to figure it out without a tiny bit of guidance. :grinning:

Hi

You might be interested in PathUtilities - A* Pathfinding Project
or ConstantPath - A* Pathfinding Project depending on your needs (BFS the number of nodes as a distance metric, while the ConstantPath takes penalties and tags into account).

1 Like

This is fantastic, thank you! Nearly everything in PathUtilities - A* Pathfinding Project has been incredibly useful.

1 Like