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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Addressables - Sprite Atlases, Groups and best practice?

Discussion in 'Addressables' started by lastlevel, Dec 1, 2020.

  1. lastlevel

    lastlevel

    Joined:
    Mar 26, 2013
    Posts:
    9
    Hello, here's my situation: I am moving a game that has been previously built the traditional "Unity Way", you know, MonoBehaviours and GameObjects all over the place, all prefabs and resources linked in the scenes so at runtime everything gets loaded. Fair enough, no problem.

    For purposes of scale, I am looking into Addressables and I've got the following working:
    1. Loading Prefabs over the local networking to my test iOS device. Prefab gets loaded and instantiation works.
    2. Packing: As a test, I packed all the prefabs that I am targeting into a single group. Fine, but this results in a 21MB size for the packed group when the on disk file total is around 14MB (quick and dirty comparison)
    I noticed I can pack the Atlas defs into their own group, but the pack size of the prefabs remains the same. If I pack all images (that are in atlases and used by these objects) the Prefab package size deflates to 4MB

    Goals:
    1. Have prefabs loaded via Addressables to remove some of the initial startup load
    2. Reduce our overall memory footprint and give us easy load/unload ability when switching between different parts of the game.
    3. Prepare the game for OTA updates for a later date.
    So, I get why it is doing this, it is dragging in all the currently linked dependencies, atlases and all.
    1. How to best manage this? Excluding concerns about memory for the moment, how to make sure the package sizes aren't too large? My assumption is that this my require OTA delivery at some point.
    2. When dragging the individual images into groups how does this work with atlases? Seems like it'd be too much to ask for it to resolve these images for atlas use as those have to be built ahead of time and then packed. No magic here?
    This is all likely a symptom of our current project structure with all sorts of items being dragged into different bundles do to the many links in Monos. It may just make sense to create the relevant packages to allow loading right now and sort this problem out later as we change more and more concrete references to assets to AssetReferences in Monos.

    But I am not 100% on that workflow yet, so looking for advice! Unity devs?
     
  2. lastlevel

    lastlevel

    Joined:
    Mar 26, 2013
    Posts:
    9
    So, through experimenting and observation I believe I now understand that Atlases, when included into Groups does indeed include the image into the package. This is good, as it means the AssetReference (or the Atlas version) works to load the imager in asynchronously and the size of the atlases can be managed.