A* Pathfinding Project

GraphNode indicate surface type from texture?


#1

I’m using the red channel to indicate WalkablePenalty but it would be helpful if I could also indicate terrain type in some way, such as a value on the blue channel with 0 for snow, 1 for grass, and so on. Is there way to do this?

pathfindingMap3


#2

If i understand correctly you want to generate a graph based on the above picture. Similar to the level selection in the Mario games where the player follows a line to different level entrances.

If so point graph would make most sense for this use case.
However getting data from the texture, like snow 0 grass 1, would require customization of the generator.

Take a look at the documentation page about using tags.


#3

Hi

There is no such option out of the box. However you can write a script that modifies the graph in any way you like. See this example: https://arongranberg.com/astar/docs/graph-updates.php#direct