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

Build only changed asset bundles

Discussion in 'Unity Build Automation' started by perholmes, Jan 11, 2020.

  1. perholmes

    perholmes

    Joined:
    Dec 29, 2017
    Posts:
    296
    Hi,

    I need some help in wrapping my head around how to distribute asset bundles, and specifically with Cloud Build. I'm new'ish to Unity, but otherwise an experienced developer.

    In my perfect world, I'm expecting to do be able to do the following:
    • Only changed asset bundles are built.
    • A new version of an asset bundle is only compatible with the version of the app it was built for, and subsequent versions of the app, until the asset bundle is updated again.
    • Asset bundles for multiple versions of the app will co-exist. Old versions of the app will keep loading old asset bundles. New versions will load new bundles.
    • Each version of the app might ship with a manifest of which asset bundles and versions it needs, and their URLs. So for "Road Scene", it might get version 4, and for "House Scene", it'll get version 2. An older app will keep loading older versions of assets until that version is discontinued.
    I'm perfectly happy rolling the versioning myself so that apps properly figure out which asset bundle to load.

    What I'm struggling to understand is:
    • How do you build only changed assets, especially in Cloud Build?
    • If Cloud Build can only build all assets, can I roll my own diff'ing to detect which asset bundles actually changed, only upload those to the CDN, and incorporate this into my manifest? Will an unchanged asset bundle have the same MD5 as a previous version if it's unchanged? Or are there enough timestamps in the asset that it's always different, even if it's the same?
    • If Cloud Build can only build all assets, and I have e.g. 10 GB of total assets, won't I hit some limits in Cloud Build? And won't I be hauling a LOT of data?
    • Is it worth building just the app in cloud build, but the assets locally? Pros/cons? I prefer single-click building in the cloud.
    Thanks in advance!

    Per
     
    SplenShepard and sabien_unity like this.