- Home /
The question is answered, right answer was accepted
Pathfinding movable area on a grid with varying movement costs
In my 2D grid turn based project, during his turn a player moves from tile to tile, and for each tile of a certain type that he walks onto, I deduct a certain amount of 'move points' from his 'turn move power'.
I want to highlight the area in which the selected character can move during the current turn. Problem is, everything I was able to find only explains different ways on how to calculate the shortest path between Points A and B.
My question is: is there no other way to accomplish this, other than to check every single tile of my map (or those in the vicinity), and highlight the ones to which the cheapest path costs less than the player currently has 'move power left', or is there some more popular/effective way to do this? My concern is, that if a player's 'turn move power' reaches higher numbers, I will be making my game calculate a hundred shortest path algorythms. Any ideas on how should I go about making the highlighting happen would also be appreciated. Thanks!
Right now the best candidate looks to be Dijkstra's algorythm, since my tiles would have a 'weight', but is that really the way to go?
Answer by · Feb 14, 2018 at 06:39 PM
Follow this Question
Related Questions
Find a path with specific steps (moves) on a grid 0 Answers
PATHFINDING in a grid game 2 Answers
Grid-based path-finding, similar to Legend of Grimrock/Eye of the Beholder... 2 Answers
ai pathfinding project getting started scene problems 1 Answer
Accessing a nested list of gameobjects not working quite right 1 Answer