A* and Dijkstra's pathfinding algorithms work by navigating a node map. In a tile-based 2D environment, these nodes could easily be inferred to be the literal x,y
positions of the map.
For example, the agent is at (0,0)
, an obstacle is at (0,1)
, and the agent wants to go to (0,2)
.
However, in a 2D environment where locations are represented using floating point variables float x, float y
, agents and obstacles can exist between the traditional style nodes (0,0)
and (0,1)
.
How do you create a node map from such an environment?