Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Navmesh baking taking a long time

Discussion in 'Navigation' started by Tovrin, Aug 20, 2015.

  1. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    I'm attempting to bake the navmesh for four large procedurally generated terrain tiles. So far, the bar hasn't moved from the "Exporting Tiles" starting position and it's been at it for a couple of hours. As it's the first time I've baked a navmesh on a terrain like this, I'm not sure if this is normal. How long should it take?
     
    darkAbacus247 likes this.
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    I've only got one reference point, but for a 64X64 level it takes ~1 seconds with a voxel size of .05. With the minumum voxel size (.01), it takes about 10-15 seconds. Agent radius is .55 and height is 1.

    Testing on a freshly made terrain with some mountains painted in, it takes about 20 seconds with default navmesh settings.

    How large is your map? If it's many times larger than the default, or you've set the voxel size way down, it might be a problem. Hours should not happen unless you're making your games on an N-Gage.
     
    DBarlok likes this.
  3. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    The bar actually moved not long after I initially posted this, but only to about the 10% mark. Each tile is 4k x 4k. I let it run overnight and it did finish. Considering this is only my prototype area and eventually I'm going to be constructing over 2000 tiles, I'm worried about how long it's going to take.
     
    marcospgp, darkAbacus247 and DBarlok like this.
  4. lizardman06

    lizardman06

    Joined:
    Feb 14, 2020
    Posts:
    8
    I had the same Issue recently I was able to fix it, I made sure my static objects(That I didnt want the agent to walk on) didnt have Navigation static checked. I also disabled all other objects that didnt need baking
     
  5. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,726
    @Tovrin 2000 tiles at 4k x 4k?, good luck, baking will take days...
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Shouting into the void there, pal:

    upload_2022-12-30_9-21-58.png
     
  7. Paul210132

    Paul210132

    Joined:
    May 19, 2021
    Posts:
    2
    Hi folks ! trying my luck here on the offchance the topic isn't dead yet : I have tried to recreate the famous SebLague tutorial on Procedural Terrain Generation, and I'm now sitting back watching my navmesh bake, but I have not yet had the patience to let it run its course to completion, since everytime it seems to run for a long time. I'm mentionning the tutorial because I'm having a hard time understanding how distances are measured in Unity, I have this procedurally generated mesh that is defined by its vertices, triangles and uvs, and the empty Gameobject carrying the script component has a transform with a scale of (10,10,10) on the inspector. It would seem that the mesh is around 240 vertices per side. What does that make my map ? Do you think it's going to bake before my beard goes white ?
     
  8. Deleted User

    Deleted User

    Guest

    In case somebody searching for a solution ends up here like me, I was using an enormous plane for water and baking with "All Game Objects" was basically not progressing at all. With "Volume" or "Current Object Hierarchy" in "Object Collection -> Collect Objects" it basically became instantaneous.
     
  9. cheriedavy

    cheriedavy

    Joined:
    Jul 21, 2023
    Posts:
    1
    The time it takes to bake a navmesh for large procedurally generated terrain tiles can vary depending on factors like complexity and hardware. However, if it's been stuck at the starting position for a couple of hours, it's likely taking longer than usual. Consider optimizing the process or checking for potential issues.