Search Unity

Question Are SpriteAtlas Variants not compatible with Addressables?

Discussion in 'Addressables' started by Dan_Kodable, Jun 5, 2021.

  1. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    I am trying to get a "low rez" set of my sprite assets into addressables for slower/older devices.
    I have addressables working, and I have everything on SpriteAtlases (2D only game) and I manually load/unload everything and it works fine.

    I made variants of my atlases, and set their scale to 0.5 and that works just fine, but when I assign them to their own groups ( normal group name + _LowRez) the bundles get created and they load/unload properly, but the atlases contain no sprite information.
    Looking at the docs it seems only the "Master" atlas gets the sprite information packed into the bundle.
    What is the correct workflow for this?
    I can put the atlas and variant in the same bundle and get things to work because the main (Master) atlas has the sprite information, but this defeats the purpose of having smaller bundles in the first place.

    Is this simply not possible?

    An alternative would be to make separate master atlases, but in this case I would need to override every serialized sprite/ui image in every scene/prefab with new sprite information at run-time, which would be a massive undertaking given the number of sprites/images in the game.
     
  2. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    I take it no one knows... Any way to get Unity to comment on this?
     
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Hey there, Dan! I'll bounce this off the team for some guidance.
     
  4. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    Hmm sounds like this may be a bug, or something with the project/Addressables settings, but I haven't been able to reproduce in my projects. Would you be able to submit a bug with the project?
     
  5. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    Hey there. I actually was able to make this work. I was able to make unique bundle categories and get that to work. I was able to confirm that it loads only the ones that I want.

    One issue I did spot is since I have 3 bundles (named differently bundle_HighDef/bundle_Standard/bundle_LowRes) that each have a unique sprite atlas in them (1 master and 2 are variants), but they all 'reference' the same sprite assets in the project folder, if I utilize the Addressables Analysis, under the "Fixable" rules there is an option to find and fix duplicate references. This will list every bundle as having duplicate references (which they technically do) and the fix portion will add all the sprites to each bundle as references to the sprite asset (not the texture2d) and then add a new bundle "duplicateassetsisolation_assets_all" and put all of the texture2d assets for all the sprites in there. In this case this isn't desired behavior.

    But so far other than the analysis issue, it seems to be working. I have upgraded unity several times since my original post, it's entirely possible that it was simply an issue with an earlier version. I can confirm I have had it working with 2020.3.11f1 & 2020.3.12f1.
     
  6. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    Thanks for the followup - I'll go ahead and create a ticket to investigate the issue you are seeing with the Analysis tools
     
  7. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @Dan_Kodable could you send a small project that reproduces the Analysis tools issue? I can't seem to reproduce it locally myself. Maybe there's some steps I'm missing :)

    I've created a master and 1 variant sprite atlas, and assigned them to different bundles but the duplicate dependencies rule doesn't detect any errors.
     
  8. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346