Search Unity

30 Minutes To build.... How long does yours take?

Discussion in 'Editor & General Support' started by infinitypbr, Mar 1, 2015.

  1. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    My computer isn't super old -- the first Retina MBP.

    But from the time I load my game on an iOS device to check a single thing ,fixing it (quickly) and then rebuilding, it's about 30-40 minutes.

    Rebuilding takes the longest chunk of the time.

    It's a pretty big game...but man, I'm bored. There's only so much internet, you know?
     
    dogzerx2 and illustir like this.
  2. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,440
    15 seconds on my 2008 Windows Vista laptop but I only have 6 scenes and around 1,200 game objects total in those scenes.
     
    infinitypbr likes this.
  3. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    Yep, i've got a S*** ton of objects and stuff.
     
  4. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    This super slow process makes it feel like I'm getting nothing done -- been sitting here for maybe 4 hours now, and have done 5 or 6 iterations, each one so tiny since I'm still unable to pinpoint the exact issue. BOOOORRRRIRNNNNNNGGGGG :D
     
  5. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,440
    I think that would drive me insane. Can you split out the scenes into their own separate projects including whatever prerequisite scenes and Don'tDestroyOnLoad objects and such are needed? Then you could make updates to just that scene (or you know maybe you have 50 scenes now and each of the smaller projects might have only 10 scenes) and testing should be much faster. Than when done copy it back into the main project folder updating the original scene(s).

    Not sure if it would work. I have never tested it but geesh I would certainly try it.
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    Maybe try unity cloud build so at least it's always building in the background. Also report a bug just in case.
     
    Ryiah and angrypenguin like this.
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Either you are talking about something different than the OP is or clearly I need to consider giving Winders a shot. ;)
     
  8. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    30 mins is pretty long. My laptop is almost the same (same year but not retina). Even a huge project on mine takes under 10 mins. You aren't doing a platform switch when you build are you?
     
  9. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    I'll time it, just started a build.
     
  10. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    Somehow I think I have access to cloud build -- I think through the Unity 5 preorder? Or the student version? Or, not sure. Somehow someone said I have that at some point, but I've not set it up. I thought that was for making switching between platforms faster. (Which, this morning, took 5 hours to do).
     
  11. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    Ok, so 18 or 19 minutes :)
     
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,138
    Well, yeah, he's not building for iOS. ;) Desktop builds are for sure much faster. That said, do you really need to be making builds to the device so much? I do most of my testing in the editor.

    --Eric
     
    wccrawford, ramand, Ryiah and 2 others like this.
  13. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,440
    It might be an apples to oranges thing. Mine is just building on my laptop for Windows. Not sure if it is a different kind of build process for iOS. I have only built to Windows and Web targets so far and it never takes longer than 15 seconds for the actual building process. If it took even a few minutes I'd think something must be very wrong.
     
  14. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    @Eric5h5 Yeah, unfortunately. ACTUALLY, you're kind of the smartest person in the room. I'm dealing with frame resolution issues. I had built my game to auto-resize the resolution when frame rate when too low, saving it per level to basically get the "Best" quality per level without the player having to do much. It worked great on the iPhone, but on the iPad Air 1 it would cause crazy graphics issues w/ the 4.6 UI system, eventually crashing due to memory overload.

    So I couldn't use that, so now I'm testing other ways of switching resolution (not automatically, unfortunately) while avoiding the graphics issues. So generally I do one change, test, one change, test etc.

    And of course it can't be done in the editor :(
     
  15. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    791
    Like I said in another topic, Unity should allow for some simple way to update only the executable and not rebuild and upload everything.
    I think the best way to handle large project is to handle the loading of the scene internally and minimize the project to the code only, then keep the resources in an external folder from the main app, so that they don't get built and upload every time you modify some simple thing then either upload them manually or retrieve them with some sort of www request from a local server.
     
  16. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Yea, building for iOS builds a xcode project (about the same as a normal build), launches xcode, cleans/builds and deploys to device. waiting on the xcode deploy is the longest part. (though at this point you can continue to work in Unity.)
     
    GarBenjamin likes this.
  17. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    You can, they are called AssetBundles, it is a very common practice. You can use them locally as well.
     
    karl_jones likes this.
  18. Ali-Nagori

    Ali-Nagori

    Joined:
    Apr 9, 2010
    Posts:
    138
    keep your assets in AssetBundle because the unity will eventually will be creating those bundels any way at building times , all my sounds , animations , and pre-baked assets are bundled in separate files , this way the building process time reduced by 90% 'in my case' , the only assets i did not bundle them are the gui elements and the scripts in the main project file, for bundling i have entire separate project .
     
    zombiegorilla likes this.
  19. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    This exactly.

    We go a bit further and have separate projects for asset types, game assets, sounds, ui/textures, fx, etc. For same reasons you point out. We rarely add sounds or some things, but others we add a lot. separating the projects reduces the bundling time as well. Your point is spot on.

    Also, in regards to what the OP said about switching to lower res assets for device, using AssetBundles works great for that as well. We have separate asset bundles for low end devices.
     
    Ali-Nagori likes this.
  20. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    Oh, I"m not switching to lower resolution assets -- I've already lowered those as far as they can really go before looking terrible (RAM issues). I'm lowering the Screen.resolution -- The iPad Air 1 is Retina but it's graphics card can't really deliver all those pixels with full shadows etc.

    So I give the player options. For shadows: Blob shadows, 1 light (sun or torch) only, or all lights. For resolution, 50%, 60%, 70%, 80%, 90% and 100%.

    If a player loves the shadows but is on the iPad Air 1, they can lower resolution to 50% and the game still looks great -- often it's not noticeable too much . Or if they want that resolution, they can lower the shadows to blob shadows and get 30fps with full resolution and shadows from all the lights.

    Or somewhere in the middle.

    Something about maybe the A7 chip doesn't like switching resolutions during the game, though. I *think* I solved it by having the player choose the new resolution then "restart" the game -- a button that will load a "resolution" level that does nothing (displays nothing) but change the resolution, then reloads the "Loading" scene which actually loads the level again. It takes 5-8 seconds, but doesn't seem to mess up the graphics.
     
  21. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Ah gotcha. Nifty idea. Yea, the iPad is an odd duck, with the great resolution and not quite the horsepower to support it.

    During your 20min builds, what part is taking the longest?
     
  22. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    The longest is exporting from Unity. It takes a good 4-5 minutes just to get the process started, with the status circle in the icon (mac, not sure what it's like on windows). The the build takes a few minutes too (maybe that parts the longest, I really don't know), starting on Xcode takes maybe 3 minutes, 4 minutes.

    Once the game is on the device it's pretty fast to load, however.
     
  23. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,585
    In my slow building experiences it came down to large textures that were read write enabled and "pixel perfect" quality 32 bit format that was causing problems. I built out to android and this meant coverting to a different format like just 4 different 2048 x 2048 textures (doesn't seem like that much? ) and this somehow would drag on for almost ten to fifteen minute build times. Ultimately I "solved" this by reducing those into many smaller textures tiled to appear to be one single texture. I have no idea why processing the same amount of stuff in smaller chunks helped... but it does in my case.

    Not sure any of that applies to your situation, but there's my input for ya.
     
  24. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    I have no idea -- it doesn't change the format of anything during the build, I think. It just slowly started getting longer and longer the bigger the game got.

    What's more curious to me is the amount of time it takes to start the game in the editor. It used to take FOREVER. Almost like making a build. Then all of a sudden in 4.6 bXX, one of the betas, it started playing right away.

    Now it seems to take forever under most cases, except (And I haven't nailed this down yet) when it's a mac build and it's already been built out once -- after that, the editor will start quickly.

    No idea what's going on. I'm not quite an under-the-hood user.
     
  25. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Hmmm.. for me that is the shortest part. The xcode side is like 80-90% of it. Does it play quickly when you hit play in the editor? Also, do you have your platform switched to iOS? (not just when you build, but in editor)?
     
  26. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    Mostly it takes a long time to play in the editor. It's switched to iOS at the moment.
     
  27. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    247
    I'm building for desktop platforms so it's not really comparable, but my project is big enough that attempting to change platforms takes about 2-3 hours. It's horrible. :(
     
  28. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    So a lot of what people are calling build times is actually not build time but switching editor to a different target platform (which build will do if you've set it to windows).
     
  29. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Yea, that can happen. As MD_Reptile pointed out, if you convert your textures to 100% and get rid of unused stuff that will help. Our model project (just handles 3d assets) takes for ever to switch, and when we build assetbundles it will cycle though several targets at a time. Right-sizing the textures really saved time.
     
  30. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,460
    Cache server is supposed to fix these issues (if used).
     
  31. PerfectlyInsane

    PerfectlyInsane

    Joined:
    Aug 9, 2013
    Posts:
    74
    There is a asset in the assetstore that lets you have a debug window in your app..

    https://www.assetstore.unity3d.com/en/#!/content/12047

    I've been looking at it have not tried it yet as current built, push and launch time to Android is ~ 1 minute (Running Q9550 project on SDD, unity installed on standard drive.)

    Some parts of my app must be built to android to be tested.

    Actually its kind of annoying so i been using in-game sliders to fine tune variables. Then rebuild with the settings that seem to work well.
     
  32. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    791
    In Unity4 the way they are handled is kind of a nightmare, so much I would rather write my own version. I saw it is changed in Unity 5 luckily.

    I also read some bad things about how they are uncompressed, that they are completely allocated in RAM. Does anybody know if it is still the same in Unity 5?
     
  33. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    They are pretty straight forward and simple to use in 4. 5 adds new features and functionality. Assets for bundles can now be marked in the editor, but the usage isn't significantly different. (apart from some great new features)

    in 4, Assetbundles are compressed. You can set them to be uncompressed if you want. And yes, of course they are in ram. First since they are compressed, they will need to be loaded in to ram do be decompressed. And second, since you are using them in the game, they are going to be in ram. After you have loaded them once, and if they are unchanged, they will be in cache, so they don't reside in ram all the time, on the first time they are loaded, and after that only when they are called.
     
  34. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    247
    There's no good case for using cache server for a one-man or distributed team project though. It would be great if unity could just store cached assets if they don't change between platform changes. A bit off topic though...
     
  35. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    297
    It`s iOS, so if you are building it on different operating system it WILL take much longer hen it would take to build on windows.
     
  36. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,773
    If you are building the IL2CPP version then the 30 minutes is not uncommon at all and it's known "issue".
     
  37. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    496
    We have a Jenkins CI server (two actually) set up to run builds of KSP and deploy them... IIRC, the avg build time for us is about 8-10 mins... the rest of the time is deployment, which involves a lot of file transfer, and even using rsync to upload files, from build start to a complete deployment, we usually have a 35-45 minute wait.

    Ofc, that is much improved by the existence of the build servers themselves. Because they're separate machines, nobody has to actually sit and wait for a build to complete. You can fire it off and check on it in about an hour.

    This 8-10 minutes to build is also only possible because we keep separate working copies for each platform we export to. There are separate copies of KSP's project folders for windows, OSX and Linux, so Unity never has to rebuild the library (unless we choose to wipe it). If it did, then build times are usually nearly an hour long. (40+mins to import all assets, plus the 8-10 to run the build... if the asset importer doesn't crash somewhere along the way, which usually does happen).

    My suggestion is to set up a build machine if you can... it doesn't have to be a particularly powerful computer... as long as it can handle running a build. Long build times shouldn't matter as much if you don't have to sit and watch the progress bar move. :)

    The Jenkins software is free, btw, and cross-platform: http://jenkins-ci.org/

    Cheers
     
  38. toddh

    toddh

    Joined:
    Apr 7, 2013
    Posts:
    10
    OP, why aren't you using Cloud Build? It's free and you can get started in 5 minutes.

    We built it to solve exactly this problem.

    https://build.cloud.unity3d.com/
     
  39. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,585
    Is this pro only or full blown free for everybody?
     
  40. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,823
    About 2-5 minutes (bearing in mind, Sara the Shieldmage is in pre-alpha, and I have little actual content.)
     
  41. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,020
    There are at least two good cases for using the cache server for a one man band. First is what Hippo said, second is what you said just then - running a local cache server will let you do exactly that.
     
    AndrewGrayGames likes this.
  42. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    247
    Well I guess it's less of an issue today now that Unity 5 doesn't require you to buy the team license, but you still need a dedicated box to run the cache server on, and it also needs to have more ram than your project is big. That's a pretty sizable barrier.
     
  43. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,020
    You don't need either a dedicated machine or more RAM than the size of your project. Or, at least, you didn't when I gave it a go. Both of those things will of course make it run better, but I found it pretty useful even without them.
     
  44. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    947
    Is there a place to read what are the differences between the pro and free version of the cloud build?

    P.S. Found it. I was already logged in, so I had to click my e-mail in the top-right corner, and then go to "My Plan"
     
    Last edited: Mar 4, 2015
  45. S3dition

    S3dition

    Joined:
    Jan 6, 2013
    Posts:
    252
    2 objects in scene, not much code. Prior to beta took about 3 - 10 seconds to compile. It's been running for almost 30 minutes now. Two other people on my team have the same issue.

    I think something is up with the beta.
     
  46. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    4,630
    30 minutes to build in Unity, or 30 minutes from Unity to Running on Device? How much in Unity how much in XCode?
     
  47. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,842
    It was taking 30 minutes to build, it would also take many many minutes to start playing in Unity. That was over a year ago. Updates to Unity fixed it.
     
  48. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    4,630
    (hah sorry didn't see the 2015)
     
    infinitypbr likes this.
  49. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,790
    Why not you can change the resolution in the editor
     
  50. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,440
    Since this came back up... wow I must say I can start to feel the pain now. My desktop and "old" Webplayer builds are still super fast but testing the new WebGL build good grief it seems terribly inefficient. So much so that I switched back to webplayer.