I am making a turn based game with tiles, much like Final Fantasy Tactics. I am trying to develop an algorithm for mapping out a list of available tiles to walk on. So for example, I am at (0,0) and I have a range of 2 - ie I can walk to any tiles that within two tiles away from me.
Things to account for:
- I have a set number of steps I can take - which was 2 in the example above
- There may be enemies or walls that will block my path
- The tiles are hex-based so I have 6 possible places to move to
The plan is basically to
- determine the places I can walk to
- if the tile is available, add it to a list of walkable tiles from this location - so that I can use it in a pathfinding algorithm and so that I don't have check this location again
Basically I need an algorithm to map possible paths from a location. I thought of the A*,dijkstra, bfs,dfs but I think they require knowing the nodes beforehand.
Any help would be appreciated, thanks!
P.S. Path-mapping would be a better tag but I can't make a new one.