Search Unity

Asset Bundles created outside the core project.

Discussion in 'Addressables' started by RWatling, Jul 16, 2018.

  1. RWatling

    RWatling

    Joined:
    Mar 21, 2018
    Posts:
    9
    Hi,

    So is it possible to use addressables to load and manage Asset Bundles that weren't built within the primary project.

    We're currently manging thounsands of asset bundles and due to this scale we have a completely seperate project which we use for the whole content management and creation of these assets. They then get pushed to a remote service where we download on startup and consume at Runtime.

    Does this sound like a viable situation for addressables?

    Thanks!
     
  2. mKosta

    mKosta

    Joined:
    Mar 16, 2018
    Posts:
    5
    Having the same problem here. Except that we don't even have a system yet to load the asset bundles that were built in other projects. So were are on the decision to either write our own Asset Bundle Manager or somehow use Adressables for that.

    @RWatling Can you give me a short hint on how you currently manage the assetbundles built in other projects? Did you built upon the AssetBundleManager provided by unity or developed a completely custom one yourselves?
     
  3. RWatling

    RWatling

    Joined:
    Mar 21, 2018
    Posts:
    9
    Hey,

    Essentially we have a requirement to pre-process a lot of our assets and then generate the asset bundles for them with their dependencies. After that we then have a post process stage that does some renaming and encryption of the asset bundles.

    Wrote it from scratch as I had some experience prior but it was still a learning curve.
     
  4. mKosta

    mKosta

    Joined:
    Mar 16, 2018
    Posts:
    5
    OK, thank you.

    So what about Addressables then? Can they be used for external Asset Bundles?
     
    Last edited: Jul 20, 2018
  5. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I'm also interested in this

    @unity_bill
    Any any ideas?

    edit:
    Actually, looking into the way everything related to addressables is designed, it looks like this is more like a sort of extension to asset-bundles, and not intended to completely replace them.

    Addressables are using plain old asset bundles under the hood, so they won't be removed anytime soon, right?
     
    Last edited: Jul 26, 2018
  6. s-vovik

    s-vovik

    Joined:
    Mar 24, 2017
    Posts:
    15
    I'm looking for solution too.

    For now I've found how to replace addressable bundles, with same names from different projects

    It's all about making correct catalog_1.json file that contains sources from both projects.
    Lets say we have 2 projects: Game & Editor. Make some addressables and give tham same names and put to equal named remote groups. In the Game project assets are simple primitives boxes and spheres and in the Editor we put some nice meshes with materials. Build both projects.

    Now comes the tricky part.
    1) Copy *.bundles from Editor to Game
    2) Edit catalog_1.json (look at screenshot http://take.ms/6YKek)
    3) Calc MD5 of catalog_1.json and replace value in catalog_1.hash
    4) Upload all to the web server
    Now if we run build of the Game - we see our nice meshes from the Editor project

    I'm looking for how to add catalog_1.json completly new bundles from Editor if Game don't know names of addressames. I think we need to edit "m_bucketDataString" and "m_entryDataString" somehow. Any ideas?
     
  7. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    Addressables.InitializeWithAdditionalData can be used to additively load runtime data (settings.json files) in order to support split projects. You can divide the data up as you need and then copy all of the settings.json files into your project (with unique names). Once the addressables initialization is complete, call Addressables.InitializeWithAdditionalData to load your additional catalogs.
     
    andywatts, s-vovik, Guerro323 and 2 others like this.
  8. s-vovik

    s-vovik

    Joined:
    Mar 24, 2017
    Posts:
    15
    Thanks Paul. That's awesome solution. Unfortunatly I get StackOverflowException every time when I call Addressables.InitializeWithAdditionalData (Unity 2018.2.2f1, Addressables System 0.2.1 preview)

    Looks like there is unlimited recursion at Packages/Addressables System/Runtime/Addressables.cs (ln: 187)
    Code (CSharp):
    1. public static void InitializeWithAdditionalData(string runtimeDataPath)
    2.         {
    3.             if (!InitializationOperation.IsDone)
    4.                 InitializationOperation.Completed += (op) => InitializeWithAdditionalData(runtimeDataPath);
    5.             else
    6.                 InitializeWithAdditionalData(runtimeDataPath);
    7.         }
     
    RedRory likes this.
  9. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    good catch - I'll try to get a fix for that in the next release.
     
    s-vovik likes this.