Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | alket | |
Old Version | Published before Godot 3 was released. |
I am having problem understanding the new AStar node
I want to translate this grid to AStar
var map = [
[1,1,1,1,1,1],
[1,0,0,0,0,1],
[1,1,1,1,0,1],
[1,0,0,0,0,1],
[1,0,1,1,1,1],
[1,0,0,0,0,1],
[1,1,1,1,1,1]]
1 = Not walkable
0 = Walkable
I want to to find the path from map[1][1] to map[5][4] .
I assume that if every cell has its on index starting from 0, it could be:
print(get_id_path(7,35))
I think you have to add every cell to the graph and tell what connections are. There is not much concept of a grid. Otherwise it sounds better to use the Navigation
node if you plan to do that on a Tilemap.
At the moment I don’t really see the point of using the AStar class in tile-based games, especially with big grids, because if you use a TileMap, pathfinding is already provided by the Navigation node. I’d be curious to know why you need it
Zylann | 2016-09-24 13:40