Search Unity

Build time has skyrocketed when adding navmesh

Discussion in 'Android' started by Corva-Nocta, Dec 11, 2018.

  1. Corva-Nocta

    Corva-Nocta

    Joined:
    Feb 7, 2013
    Posts:
    801
    I'm not 100% sure if this post belongs here or the navmesh forum, but since I don't have this problem when building for pc I thought it best to put it here.

    Anyway, I am working on a fairly simple game for android (think Asteroids but with 3d models) but my build time has rapidly increased. I have only 2 scenes, 1 being the main screen and the other being the first level.

    When I was building just the first scene it took about 2 minutes at most to compile and send to my phone, no issues. As soon as I added my first playable level with navmesh, my compile time has shot all the way to 20 minutes minimum! It is often even longer, I've seen it estimate well over an hour!

    I see this when the build progress bar hits the "Baking" section. From what I understand this is baking the navmesh, and probably also baking the lighting as well. The level is extremely bare bones, 1 plane, 1 slightly angled plane, and 3 building objects. The navmesh has maybe 10 different sections that I can see, vut none of them are very large or complicated at all.

    I feel like I am doing something wrong here. It shouldn't take 20 min to bake a single level that has barely anything in it. Or am I totally wrong and its going to take hours upon hours to compile a the game every single time I want to test it?

    Any help at all in this area would be greatly appreciated!
     
  2. Corva-Nocta

    Corva-Nocta

    Joined:
    Feb 7, 2013
    Posts:
    801
    I took a look at the Static button in the top right of transform in the Inspector as well as the Objects tab in the Navigation window. I set things that needed to be unwalkable and just static. Basically set things up how they should be as far as static is involved. That brought the Baking process down to about 8min, which isn't too bad. But if I want to have about 25 to 30 levels, that is going to make my compile tile extremely high still.

    I also notice in the bottom right of Unity there is sometimes a bar saying that the scene is baking. Is this the same baking that it does in the compiler? If so, why is it building outside the compiler then also when it compiles? That sounds super pointless.
     
  3. Corva-Nocta

    Corva-Nocta

    Joined:
    Feb 7, 2013
    Posts:
    801
    So it looks like my issue is less to do with navigation amd more to do with lightmapping. I guess I need to look at optimizing my lighting.

    I'll google a bunch but if anyone has any places I should look into feel free to send your suggestions my way
     
  4. Corva-Nocta

    Corva-Nocta

    Joined:
    Feb 7, 2013
    Posts:
    801
    I think I foxed my problem. For anyone who is also having this problem here's the fix I used.

    In the lighting window you can turn off auto generate lighmapping. You have to manually press the button to build a lightmap, which will still take several minutes (just like when building) Building your game will fly by however since all the lightmapping is already finished