Search Unity

Handling multiple remote content catalogs.

Discussion in 'Addressables' started by earlGrey_, Jan 30, 2020.

  1. earlGrey_

    earlGrey_

    Joined:
    Jan 30, 2020
    Posts:
    6
    I'm thinking about splitting the content across many remote catalogs. The reason is that having all content tied to one catalog would make the size of this catalog too big for clients to load (few thousands of assets), and most likely not necessary, since each client would probably never have all the DLC content.

    Currently I'm thinking about writing some editor script that would build different content catalogs for given amount of assets at a time (split all of them across many catalogs). So then I'll be able to load needed catalog on a client before loading needed asset.

    Is it something that I could do in this case or it's a complete non-sense and I should do something else? Which workflow would you recommend to work with relatively big number of assets? The documentation now leaves many questions..

    And another question about catalog remote load path. Why do I need to specify its location in settings before building an app if I could specify it when I call following method at run time?
    Code (CSharp):
    1. await Addressables.LoadContentCatalogAsync(path).Task;
     
  2. tylervezinarelish

    tylervezinarelish

    Joined:
    Apr 25, 2017
    Posts:
    3
    I'm looking for the same thing - we'd like each section of the app (let's call them DLC) to have its own catalog, so that they can be updated individually. Would this require a custom Addressables build script? The API (CheckForCatalogUpdates, UpdateCatalogs, etc) already expect a list of catalogs, but I can't find anything about generating or working with more than one for the whole app.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    I'm fairly certain we want you to set that path on the settings object before building so we know where to get the base set of catalogs for initialization.

    Typically I think the idea when we implemented LoadContentCatalog was that some people had their project split into multiple Unity projects (ie there was a project for certain major levels/assets and a main project with all the code, and whatever else) to help cut down on intense import times. These satellite projects would build addressables content and then the main project would keep a store of the path for that catalog.

    If you're wanting to create multiple catalogs in one project you'd definitely need your own custom build script where you handle the content catalog location injection. This means making sure that you don't separate assets from their dependencies into different catalogs or creating some system that make sure an IResourceLocation knows it has a dependency on a given catalog.

    We've discussed supporting building to multiple catalogs in the past and it may be something that gets visited again in the future but for now you'll likely have to implement your own script or use the multiple project strategy. (or something else that you think of)
     
    yoloom and ggzerosum like this.
  4. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    89
    +1 for allowing us to build into multiple catalogs
     
    joanpescador likes this.
  5. AndreyD

    AndreyD

    Joined:
    Oct 8, 2013
    Posts:
    8
    In case anyone interested, I was able to build/load multiple catalogs in a way @davidla_unity suggested but with one project. I does require modifying Addressables package but instead of relying on just separate catalog override it extends Unity's implementation by allowing multiple settings instead of 1 static. That come with the whole list of benefits and you can cycle through those different settings in the Settings window, have different profiles, addressables assets and categories all referenced and used safely.
     
    Epsilon_Delta and yoloom like this.
  6. yoloom

    yoloom

    Joined:
    Dec 30, 2015
    Posts:
    1
    I also need this kind of function, because I merge use RemoteBuild and localbuild, but only one catalog file, after I upload it to the server, if the localbuild part is wrong, after I re-build, the new catalog file points to the new localbuild, But old catalog file can not find local file,So I need to separate local catalog and remote catalog
     
  7. game-dev333

    game-dev333

    Joined:
    Jan 11, 2014
    Posts:
    7
    Can you share more details..or code snippet? I am searching for functionality(building multiple catalog) exactly like this.
     
    Last edited: Mar 27, 2022
  8. AndreyD

    AndreyD

    Joined:
    Oct 8, 2013
    Posts:
    8
    Here is the code for reference, you can follow the commits in there as well. https://github.com/andreydobrikov/com.unity.addressables
     
    Epsilon_Delta likes this.
  9. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    This is a key feature I thought addressables handle, but to my suprise they do not. So if I want to have multiple catalogs (let's say to easily support DLC) I need multiple projects? How cumbersome.
    I submitted feature request for multi-catalog support here https://unity.com/roadmap/unity-platform/pipeline-integrations