Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to use addressable to download dynamic content ?

Discussion in 'Addressables' started by Hash-Buoy, Nov 11, 2020.

  1. Hash-Buoy

    Hash-Buoy

    Joined:
    Jan 4, 2014
    Posts:
    33
    I need help in understanding the best practice for my current situation.
    To simplify it a bit, I'll take the example of a racing car game.
    Let's say we have a racing game, we have built the whole game and also has a car script and it's shipped.
    Now I need to add a new car to the existing game which is already shipped. It won't have new scripts.
    Just a new model of car with custom variables and animator(it won't be just a static mesh, need to have a prefab to set all components properly.)
    How do we add new content dynamically without shipping a new game?
    Sorry, it might be a total noob question, but the tutorials which I have gone thru are not exactly pointing towards the solution. Or maybe it's hiding in clear sight.
    Thanks for hearing me out.
     
  2. Kultie

    Kultie

    Joined:
    Nov 14, 2018
    Posts:
    48
    When you built the addressable did you enable the Build Remote Catalog in Addressable settings?
    upload_2020-11-12_17-15-3.png

    If you've done this then there will be 2 files. 1 is .hash and 1 is .catalog these files will be in charge of what content is update and will try to download the content you have updated

    And also when you build addressable bundle choose "Update a Previous Bulild" then choose right "addressable_content_state" inside the right platform you build
    After all of this upload all file include the .hash and .catalog to your remote server.

    Edit: I'm using Addressable 1.13.1
     

    Attached Files:

  3. Hash-Buoy

    Hash-Buoy

    Joined:
    Jan 4, 2014
    Posts:
    33
    Hello thanks for answering, but I still feel that my problem is something different. Or maybe I have not understood the working of Addressable :)

    So the user downloads the game without any car, but only with the car script.
    When he starts the game he has an option to unlock a car. (This will trigger the remote download)
    I don't want to bundle all the cars into one package as there will be more than 300 or so and will be growing in the future.
    I was planning to have all the cars as a separate bundle so that the download time is minimum , and a content update to one car does not force download the whole package of 300 cars.

    Is this possible to achieve? Adding new bundles after the initial game is published? As I understand the content update is only updating the current bundles and not adding new ones to the existing game.
     
  4. LucasHehir

    LucasHehir

    Joined:
    May 7, 2020
    Posts:
    74
    I've been using Addressables in this way for a while now, yes it's absolutely possible. You're right about the way it would work, each car sounds like it would be its own bundle (with models, materials, textures, etc) but the code is already present in the app/player.

    My current understanding is that you can add new bundles after your initial content build; the updated catalog json and hash files will act as the index for those new assets. As long as you are only performing content updates (not a fresh content build) then it should be fine.
     
    Hash-Buoy likes this.
  5. Hash-Buoy

    Hash-Buoy

    Joined:
    Jan 4, 2014
    Posts:
    33
    Cool!!! thanks for the info :)