pathfinding in procedural terrain

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ceayo

Hey, i’m using qodot to create a downloaded map at runtime (in 3d), and i need my enimies to pathfind to a place on that terrain. I read that pathfinding requires to bake something, but the map needs to be generated at runtime…

:bust_in_silhouette: Reply From: placroix74

What you need for pathfinding is a directed graph, in which nodes are spots on the map you can get to, and edges specify the cost of getting from each node to its neighbors.

Since your map is generated at runtime, it’s only a matter of generating the graph along with it.

@ceayo: I didn’t know, but it seems Godot already has what you need to do pathfinding: https://forum.godotengine.org/121075/am-i-wasting-my-time-with-gdscript?show=121122#c121122

placroix74 | 2022-10-07 12:35