• Godot Help
  • Godot 3.5 Navmesh bake via script extremely slow.

I have a procederul crawler game where the world is made up of normally a few hundred to a few thousand cells. When I try and run the bake command via script after the world is loaded it takes up to 3 minutes even on worlds only consisting of 20~ cells. I am running a ryzen 5900x so I don't think its a performance bottle neck. Is this expected behaviour of baking the nav mesh? Any help would be awesome TIA!

  • smix8 replied to this.
  • smix8 Sorry for the late reply, ended up just switching to godot 4 which fixed all of my speed issues with the nav mesh

    ZachAR3 You will find the source of your issue in the NavigationMesh baking properties or in your source geometry. The speed of the baking depends on your cell size (larger == faster), the sampling mode (watershed has quality but slow, layers bad quality but fast) and the complexity of your source geometry as all the mesh data from the entire source geometry needs to be parsed and loaded for baking. If you have a few hundred cells that sound like to much for runtime baking and if you have a few thousand that sounds like complete overkill and that you need to split your procedual map into multiple navigationregions for runtime baking to avoid lag. There is also the chance that your source geometry is just way to large in size and scaled. The baking creates a voxel representation of your source geometry and if it is to much for the internal data types and memory it can lead to an near endless loop (aka 3 min waiting for a thing that should be done in less than 3 seconds).

      smix8 The thing is even with something small thats only comprised of 20 or less cells it takes takes to up to a minute. Also godot 3.5 doesn't have navigation regions that's only godot 4 from what I can find. I tried playing around with the navmesh settings and what method it uses but it doesn't change the speed which leads me to believe it's something else being weird.

        ZachAR3 Godot 4.0 NavigationRegion3D <-> NavigationMeshInstance in Godot 3.5. NavigationMesh baking for a normal scene only takes a few seconds so if it takes you minutes something is wrong with settings or the complexity of the source geometry. If you cannot figure it out you might want to share a testproject or open an issue on the Godot github.

          4 months later

          smix8 Sorry for the late reply, ended up just switching to godot 4 which fixed all of my speed issues with the nav mesh