Search Unity

Using multiple assetbundle manifests in one application

Discussion in 'Scripting' started by nilsk123, Jul 19, 2017.

  1. nilsk123

    nilsk123

    Joined:
    Dec 13, 2016
    Posts:
    19
    For the past months i've been developing a content distribution solution for Unity. It's working just fine, our current setup consists of a server and a Unity client. The server provides an API which offers a version of the application content based on the version number of the Unity client which requests it.

    The part of the Unity client which takes care of downloading and caching is based on the assetbundlemanager which is provided by Unity and maintained (sort of) here https://bitbucket.org/Unity-Technol...10/demo/Assets/AssetBundleManager/?at=default

    The problem we are currently facing is that in all examples we can find online there is only one main manifest, which enlists all content in the application. That means that who ever wants to generate new content for the application will need a unity project with all previous content in it aswel, as the newly generated content can't jus be added, it will replace the content as a whole.

    To enable incrementaly adding content we'd like to develop a solution which can instantiate multiple manifest files from a remote location. Does anyone have any thoughts on this? Technically it shouldn't be too difficult, just wonder if there's any real downsides to this approach.

    The second problem we have is caching. App cache can't be cleared selectively, meaning you have to either delete everything or keep everything, which creates a lot of overhead. The last discussions I can find about this are from 2015 or so. Is there any update on this?
     
  2. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I'm also interested in these questions. @nilsk123 what did you decide to do? I'm about to embark on modifying my own custom version of the AssetBundleManager to allow for a list of manifests.

    As for caching, I'm not quite there yet, but the question is certainly looming on the near term horizon. What did you decide to do?
     
  3. nilsk123

    nilsk123

    Joined:
    Dec 13, 2016
    Posts:
    19
    Hi Arcanor, I didn't follow up on this too much, currently our use case isn't too pressing. One thing I ran into is having multiple manifests loaded at the same time doesn't seem possible. If you're loading a second one it will complain about a manifest already being loaded. You can however unload one and then load another, if you don't need them simultaneously. If I had to develop something as complex as this I'd probably forget about the manifest al together and build my own system to keep track of bundles / dependencies and hashes.

    As for the caching, the API has been improved since I asked this question. You no longer have to clear the entire cache, theres functions like clearAllOtherVersions or clearAllCachedVersions which allows for more fine-grained control over specific asset bundles, which helps a lot and is enough for our use case. Let me know / send me a dm if I can be of any help.
     
  4. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I find it amazing that I'm not finding others who have wanted to use multiple manifests. It seems natural to me that creating assetbundles should be done from several different projects. The unity editor becomes unwieldy quickly when faced with the sheer size of many asset packs available these days.

    I'm not giving up on the possibility of loading multiple manifests at once. Still working on it here.

    But I'd love to hear more from others who have insights.