Search Unity

Level DLC with Addressables

Discussion in 'Addressables' started by LoftySky, Sep 24, 2018.

  1. LoftySky

    LoftySky

    Joined:
    Mar 30, 2015
    Posts:
    13
    Hello,

    I'm planning the DLC system for our next game. We'd like to be able to distribute new levels after the game is released. Unfortunately I am unable to conceive of how one might do this with the systems Unity provides. I'm hoping someone can address my lack of understanding.

    Initially AssetBundles seemed like the 'correct' way to do level DLC.
    Level with DLC Asset Packages.png
    AssetBundles let us download an individual level file after the player has purchased it, but the need to include all the dependencies limits the number of levels we can practically distribute. This system seems more suited to additional weapons or outfits.

    Investigating Addressables seemed promising, as it circumvented the issue of bundles not being able to leverage common assets in the game.

    Level DLC Addressables.png
    This gives us the desired small level files, leveraging common assets, but with the limited API there is no apparent way to gate specific content, or tell if an addressable is local or remote, of how much of it is downloaded. I'd like to be able to present of list of levels available to the user, and clearly indicate if they are ready to play, but the addressables seem to 'automagically' hide those details.

    Is my understanding of these systems correct? Is there a 'correct' way to do DLC for levels?

    Thanks
     
    FlightOfOne likes this.
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Addressables are built on top of asset bundles. Either will do what you need, as you can bundle the common dependencies of your levels onto a separate asset bundle.
     
  3. LoftySky

    LoftySky

    Joined:
    Mar 30, 2015
    Posts:
    13
    I'd love to see a sample of how you can detect that an Addressable package has been cached and is available locally.
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    As already mentioned, Addressalbes or AssetBundles can be used to pull dependencies out of bundles such that you either ship with common assets, or have them as their own unique download.

    As to the issue of knowing which levels are "available", we don't have an immediate solution to that just yet. I'd recommend keeping a list of "played" levels. Seed that with the ones you know are local, then as a user selects a remote one, and you download it, add it to the list. We have on our to-do to add some kind of "IsReady/Local/Cached/Something" but haven't gotten to it yet.
     
  5. mocerezo

    mocerezo

    Joined:
    Jan 21, 2013
    Posts:
    8
    Any news about if there is a way to know if a package or level is available locally or cached?
     
    FlightOfOne likes this.
  6. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I am very interested in seeing a practical example of the addressable for a DLC (or mod) as well.
     
  7. zaki_unity217

    zaki_unity217

    Joined:
    Jan 4, 2021
    Posts:
    1
    Is there any update on this?
     
  8. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    I'll check with the team @zaki_unity217 and pass along any updates!
     
  9. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    So, the way to ensure everything is downloaded/cached is by using Addressables.DownloadDependenciesAsync(...). This will download anything that isn't already cached. If it is already cached then the operation should complete synchronously and you can continue with your load/instantiation.

    If there are problems with this pattern let us know and we'll see what we can work out to help.