Search Unity

Build is on hour 34 and counting

Discussion in 'Editor & General Support' started by Todd-Wasson, Jul 3, 2018.

  1. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    Unity version: 5.6.5.p4

    I'm building my project with a single scene that has taken 34 hours to build so far and is still sitting on 7/11 light transport with 49 jobs left to go. I don't understand why this occasionally happens. Usually it takes a matter of seconds, but occasionally it does this whole light mapping thing if I change a model which, by the looks of it, takes literally DAYS for Unity to build.

    This is not some amazing AAA scene extending over the entire planet Earth, it's just a simple race track from a race track creator in the asset store. One that normally takes no time at all to build and starts within seconds when pressing play in preview mode most of the time. Why does it occasionally do this? I'm sure it all comes down to lighting settings, but I didn't change any of those. It just seems to randomly decide now and then to take eternity.

    What settings in the lighting window can I use that are actually useful and won't take days to build the most simple scene? I don't understand what kind of precomputation could possibly take 34 hours and still not be even close to finished after so long.
     
  2. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Unity will usually only rebake lighting if you change any static things in the scene.

    Have you tried manually rebaking the lighting for your scene, to see if that is indeed the issue? It sounds like you might have problem with your light mapping settings in your scene. Could be too high resolution for large things (e.g. terrains), unnecessary light mapping of many small objects etc.
     
  3. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
  4. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    This was during a manual bake. After I shut it down some 36 hours later, Unity did it again in the background without building. It ended with an out of memory error. I've got 32GB RAM and an enormous hard drive so don't know what that's about.

    The dumb thing is I don't have anything in this scene that I haven't used before. It's a simple race track generated with a Unity asset which never took more than a couple seconds before. I only changed lighting settings in an attempt to speed it up after it looked like it was going to take forever the first time.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Building and light baking aren't the same thing. If light baking is triggering in the background it is because you have that setting enabled in the lighting window. If you don't want it to do that, untick the appropriate Auto Generate box and do it manually as needed.

    https://docs.unity3d.com/Manual/GlobalIllumination.html

    Until you figure out why your light baking process is far more complex than you indend, you could just go into the Lighting window and switch to real time lighting. That effectively disables all baked lighting and calculates everything as your game is running. Quality is lower, and game performance takes a hit, but it may still be just fine for your game and will let you continue working on other things and come back to the lighting issue later.