Let's say I have a 2d grid. Pathfinding is a secondary step in my problem.
My thing is, lets say I have a unit in the middle of the grid. I want to be able to tell the user "These are all your available destinations.".
Based on how many squares the unit can walk, I want to show the user, "these are all the squares you can reach." and then pathfind the destination the user picks.
What's the best way to do the first search to show the reachable destinations?
The terrain can also have limits och bonuses depending on terrain.
I don't know what this is called so pointers on where to look or what to google would be greatly appreciated.
Cheers! :)
/E
The best way would probably be depth first search (http://en.wikipedia.org/wiki/Depth_first_search) with a limit on how far away you can go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With