Search Unity

Addressables and dependencies

Discussion in 'Addressables' started by Allan-Smith, Jul 15, 2018.

  1. Allan-Smith

    Allan-Smith

    Joined:
    Feb 7, 2012
    Posts:
    57
    Hi,

    On another project we had to take a HUGE amount of time to organize the whole project into using asset bundles properly, to completely avoid asset duplication while building the asset bundles and stuff like that. The demos you guys show basically have you putting prefabs as addressables and you leave it at that. Would this mess up assets the same way as asset bundles would? Say prefab1 and prefab2 both use texture1, would texture1 be copied to both asset bundles, if both prefabs are marked "addressable" but the texture is not? In this scenario, do I just mark the texture as addressable as well, generate 3 bundles, and I leave the dependency downloading/checking/etc to the addressable system? By the way... I assume that if texture1 is not flagged as addressable, it will inevitably be in the main build, even if it is only referenced by addressables?

    Would be nice to understand these mechanics so I can plan my content separation properly as to have super small builds and efficient downloading of content, only fetching whats strictly necessary, and never fetching the same thing twice, doubling memory and bandwith usage for the same stuff (as textures).

    Thanks!
     
    s-vovik likes this.
  2. Allan-Smith

    Allan-Smith

    Joined:
    Feb 7, 2012
    Posts:
    57
    Sorry, I made the above post before realizing that in the Preview tab I could see what the asset bundles look like in reality. So yes, just for reference for other people, if you have the case above (prefab1 and prefab2 referencing texture1), you would end up with two copies of texture1, one in each bundle. When those prefabs are loaded into memory, you would end up with two copies of texture1 in the memory too, so this can be quite fatal for mobile, but you can manager your assets through the Preview tab.

    Actually... if that is the case, what would be the right way to go to solve this problem? Making every dependency addressable? Like... creating thousands of addressables just for the sake of it? I mean, in my other project we have about 800 asset bundles and they have been very carefully assembled into groups to minimize number of downloads and completely remove asset duplication... if I make everything pack in separate groups, we would wind up with literally 10000 asset bundles... and with the current Addressables window, it seems pretty though to organize a huge amount of assets, I mean, from what I noticed the only way to achieve the same goal would be to have 800~ groups, and set them all to pack together, so we can keep stuff separate with groups and together with packing... but damn... would that be a hard to manage window lol...
     
    Last edited: Jul 15, 2018
    HiddenTess, chrismarch and s-vovik like this.
  3. Allan-Smith

    Allan-Smith

    Joined:
    Feb 7, 2012
    Posts:
    57
    Yet on another asset bundle related question... the most useful thing of the previous asset bundle tool was the "!" to tell us that we were screwing something up cause we had duplicated assets in different bundles. Any changes these will be coming for the Addressables manager window?
     
    chrismarch likes this.