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

Question Simulate Asset Bundles - Why are there so many "assets_all" bundles?

Discussion in 'Addressables' started by KingKRoecks, Oct 13, 2021.

  1. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    145
    I'm trying to optimize my asset groups right now. When I analyze my asset groups, it looks like it shouldn't have that many dependencies.
    I have the 3 explicit things that I've declared in the same asset bundle "scene-01_title", and then a handful of implicit dependencies

    upload_2021-10-12_19-31-36.png

    When I actually go to download it, it seems like it's downloading 160mb worth of data and takes forever.
    (the 159718 is the original size / 1000)

    upload_2021-10-12_19-32-47.png

    And then the event viewer looks like this:

    upload_2021-10-12_19-9-28.png


    It's really hard to read this information and actually take away any meaningful insights. Can someone help me figure out what I'm looking at? Why does it need to download so much to switch scenes?

    My scene asset bundle clearly isn't that large.
    upload_2021-10-12_19-34-31.png

    How do I figure out what all these other dependencies are and why isn't the Analyze window giving me the same results?
     
  2. LilMako17

    LilMako17

    Joined:
    Apr 10, 2019
    Posts:
    43
    when you build an asset group that has both scenes and assets that is set to pack together (the default setting), scenes need to be split out into their own bundle. So the naming convention Addressables uses is "[group name]_scenes_all" and "[group name]_assets_all".

    When loading a scene file, unity will also all the other bundles that have asset that are marked as addressable that are dependency assets that are serialized in the scene. I.e. any of the assets that are under the "implicit references" in your first screenshot. For example, if CrystalNexus_02.fbx is marked as addressable and lives in another asset group, because you scene file uses that mesh somehow (disabled game objects count), the scene-01_title asset bundle will not include a copy of CrystalNexus_02 information, but will record a link to the asset bundle that does have it. when you request to load scene-01_title, Addressables will also (partially) load the bundle that has CrystalNexus_02, and use that copy of the asset as part of the scene.

    I run into these kinds of issues a lot, to debug them, I've used two external tools:

    This one is a generic Asset bundles tool, not built for Addressables. It works for most cases, but requires a fair amount of time/ external tooling to get it running.
    https://github.com/faelenor/asset-bundle-analyzer

    This one is better and more recent, provides slightly less information but in an easier to digest format. It leverages some debugging options that Unity has provided in a more recent version of Addressables
    https://github.com/pschraut/UnityAddressablesBuildLayoutExplorer

    I'm curious if anyone else has any tips on how to deal with debugging these kinds of problems, because mine relies a lot on "guess and check" mentality, which is very time consuming and messy. It would be nice to have a tool that could check for this kind of stuff without having to build bundles first.