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

Option to only build parts of addressables

Discussion in 'Addressables' started by jmilsonneau, Aug 30, 2019.

  1. jmilsonneau

    jmilsonneau

    Joined:
    Apr 24, 2019
    Posts:
    6
    Hi,

    Is there a way or plans to add more control over addressables build, as far as I can tell we can only build all groups currently but I think it would be useful to be able to only build a group. For example if we pack levels in a group we could only build one group and reduce our build time.
     
    saarg likes this.
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Nice feature to have, or incremental build in general.
     
  3. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    we sorta have that, but may not quite what you want.

    Each bundled group has an "include in build" checkbox. With that off, we won't build that group. This is intended for quick iteration when working on a small portion of the game. If that's your situation, great. If you were hoping this feature would allow you to build some stuff, then later build others, and it all work together, that won't be the case without some hoop jumping. You'd have to save and load all your catalogs from each build. And you'd have to be very careful about the bundle layout.
     
  4. jmilsonneau

    jmilsonneau

    Joined:
    Apr 24, 2019
    Posts:
    6
    The include in build checkbox would work when we want to work on a subset of the world and don't want to build other scenes that`s cool but what if we have a bundle for localized strings that we want in remote on a server, can we use this to build only this bundle and deploy it to the server? I'm guessing we'd have to disable Crc and name the bundle without a hash right?
     
  5. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Hi!

    I have a few questions about this:
    - If you can detect some of the dynamic asset groups are changed but not the others, is it not possible to rebuild only those groups ? (all of them are dynamic).
    - If I set a group static and then press the build content button, that group will be built so for fast iterations on consoles, how do you expect us to reduce the build content time when you cannot rely on the "include in build" checkbox because you need all of the content ?

    That's basically our usecase where we are working on console, change a small part of the content and it feels like it's rebuilding everything everytime, in theory it should be able to make incremental updates to the content no ?

    Thanks!
     
  6. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    That's why the fast mode is introduced at the first place. However as said, incremental build is a nice feature to have. And seems quite possible, by parsing the generated .bin file to detect which groups are *dirty*.
     
  7. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    Fast mode is useful only in editor, my usecase is about console builds which cannot benefit from this feature.
     
    jmilsonneau likes this.
  8. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Two things.

    1. addressables bundle builds (which use scriptablebuildpipeline package) already has a very extensive incremental build system. You can even connect it to a cache server to get the benefits across multiple machines. https://docs.unity3d.com/Packages/c...xamples.html#cache-server-integration-example Even without the cache server though, builds with only small changes will only rebuild what had the small change. Those builds should be much quicker.

    2. back to the original topic of unchecking some groups. The thing to note if you're trying to do this during a real build is that you have to correct for other missing data. For one, we create the catalog during the build. So partial builds will only have a partial catalog, that you then have to deal with. Second, dependency inclusion may not be totally correct. Such as common shaders between the checked and unchecked groups. This part can get fairly complicated.
     
    dzamani likes this.
  9. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    122
    I see so from what I understand, I should use 2 caches servers (one for assets and one for build artifacts).
    The main issue that I'm seeing right now is that I would need to inherit from BuildScriptPackedMode and override the DoBuild method in order to add the cache server, will we have something better than that in the next updates ?

    Thanks!
     
  10. jmilsonneau

    jmilsonneau

    Joined:
    Apr 24, 2019
    Posts:
    6
    I didn't know about the cache server for the build system, that should solve some of my concerns, thanks
     
  11. DrPoole

    DrPoole

    Joined:
    Oct 20, 2022
    Posts:
    8
    I hate to bring back a post from a long time ago, but I searched the forums to find a topic that somewhat addresses my question, so it seemed better than opening a new thread.
    Regarding this part, this usage example seems to be for Asset Bundles, unless I am misunderstanding. I know Addressables build bundles, but to build Addressables, I'm not calling this directly:
    Code (CSharp):
    1. ContentPipeline.BuildAssetBundles
    Instead, I'm calling
    Code (CSharp):
    1. AddressableAssetSettings.BuildPlayerContent
    So how does one benefit from the cache server in this case? Should I be using ContentPipeline.BuildAssetBundles instead? If so, how do I use that with Addressables?
    I know you can add the Cache Server v1 in the Editor Preferences. Should we not use it that way?
    There is also this documentation page: About the Cache Server Client | Scriptable Build Pipeline | 1.5.10 (unity3d.com)
    Would doing it manually like this be a possibility? If so, how would I find the hash of the bundle, as shown in the beginning of the example code?

    To put it simply, a better example or explanation of how to integrate the cache server v1 with the use of Addressables is what I'm looking for. I don't wish to criticize that the example is not sufficient, but I am not understanding it, one way or another.