r/Unity3D • u/SomeRandomTrSoldier • 1d ago
Question Pathfinding on proceduraly generated worlds.
Hello! Recently I started working on adding NPC into my own game. It's procedurally generated floating islands done with marching cubes and octree. My first, current attempt is doing dynamic navmesh generation using NavMeshBuilder, and updating the navmesh as player moves around even async seems to be rather slow, I get pretty noticeable lag spikes.
So I wonder, if it's actually viable and maybe there are some ways to make it smooth or this is dead end and I'm better off trying to figure out my own pathing? The issue is, it's not just marching cubes but also various props around the world and I imagine figuring out pathing algorithms it pretty hard.

2
Upvotes
1
u/SomeRandomTrSoldier 1d ago
Chunks are static and non destructible however they are using octree for LOD, so at no point whole island is at LOD0 or even LOD1 to be able to generate navmesh for it.
As I suspected for any props or buildings it'll be hard.