Search Unity

Question A way to optimize building times of a project with thousands of scenes

Discussion in 'Asset Bundles' started by wlad_s, Dec 18, 2021.

  1. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
    Hello all.

    My flying game has worlds that are 50km in length and width. Currently, I'm working on only one of those worlds. I've split the world into hundreds of chunks and each chunk resides in it's own scene. Those detailed chunk scenes are loaded and unloaded asynchronously as the player flies. I also have various types of terrain quality variants and those are also split into hundreds of scenes and chosen to be streamed depending on the quality settings. So, in the end, I'll have thousands of scenes added to build settings list. I've tested the build and got rid of any hiccups and I'm very impressed how smoothly it all works.

    But, my build times are really long, mainly because all those scenes need to be built each time again. So I thought about an idea that I remove the scenes from the build settings list and build them into asset bundle instead, with their terrain chunks and textures (as seen in this video). That way, I presume, once I build the bundle, it will only be added when building the game with all the scenes already built previously, not being built on each build again, making things faster.

    But, after reading about Asset Bundles, I really struggle to understand it all. So, I have a few concerns.

    - Is using Asset Bundles really the way to go for my case? To reduce build times.
    - Let's say I end up building asset bundles for each world and massively decrease build times. But does that mean that upon entering the world, and loading it's bundle, I'll actually load all the textures for the whole world into RAM? That doesn't really sound wise to me because sometimes players will have a mission only in, eg. southwestern part and leave. They will never need to load and display the northern textures.

    Please help me with any advice. My idea is that, once I'm done with one world, I somehow build its scenes and stuff and continue working on the new world without the first one hindering my build times.

    Thanks!


    Unity 2020 LTS, Built-in pipeline
     
    Last edited: Dec 18, 2021