Limit pathfinding by length

What I’m trying to do is display what locations a unit can reach on it’s turn, think new x-com or any turn based strategy game.

Now I found the GetReachableNodes methods in the utilities class, which is great! However, I need to find a way to limit which nodes the seeker can find a path too, based on the length of the path. EG If the next node’s total distance from the seeker is greater than 500 remove it from list of possible nodes.

Anybody have any suggestions on how to do that?

Right so I figured everything out and patched the bugged BFS method to do it. Here’s the patch if you need it: https://github.com/DataRogue/BFS-Patch-For-Aron-Granberg-A-Star

Hi

Sorry for the bugged BFS method.
What you could also use if you will be using penalties on your graph is to use the ConstantPath class (see the “Path Types” example scene if you have the pro version) which actually works and works even with different weights and tags.

I would suggest that you just restrict what nodes the player can issue an order to and then simply pathfind to that point without any length restrictions on the path (since you already know it will be short enough).

Any luck getting this to work?

@waffles

The BFS method has been fixed in the latest beta.
Not sure about the progress that @kabuto202 has had.