Search Unity

Bug Addressables is downloading unrelated bundles with Scene load.

Discussion in 'Addressables' started by JJRivers, Dec 7, 2022.

  1. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    In short i'm in a bit of a pickle with Addressables. Issue at hand:
    • Player starts by loading a scene via addressables from a local bundle
    • Player remotely configures the remote bundle locations (overriding the resource URI via a tag) after the first scene is loaded.
    • Yet on the first scene load via addressables is trying to access the remote bundles which obviously fails since the remote configuration has not been done yet
    • Why i don't do that address translation first is for client bootup speed + if i did that the first thing would be a download of addon content that isn't needed and costs players and publisher money which completely defeats our use case for addressables.
    Anyone have any ideas what's going wrong?
    • The first scene has been checked via both AssetDB dependency check and CalculatePlayerDependencies and the Dependency Viewer to not refer to any assets in the remote bundles
    • Only Update Catalogs Manually is enabled
    • We do have a manual catalog update call but that is never reached due to it being called from the first scene which doesn't load
    This project is supposed to ship the second this thing stops downloading random bundles so it would be greatly appreciated if any help is available.
     
  2. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
  3. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    Version was 1.20.5 i believe, i used the preview Search packages dependency viewer, buildlayout report is how i knew something fishy was going on due to all bundles cross referencing each other
    My issue was that there indeed were dependencies in the scenes, contrary to what i stated above:

    • The cause of the crossreferences was that prefabs inside nested prefabs need all of their dependencies regardless of whether their dependencies are overridden in a particular prefab or not. Problem arises when you realize the tools you think can get you the dependency list weren't quite clear as to which one does what.

    • The reason i didn't realize this was that AssetDatabase.GetDependencies and EditorUtility.CalculatePlayerDependencies and the Dependency Viewer all show you the dependencies of the object you are viewing as is meaning overridden dependencies are not shown this results in bundles getting dependencies to other bundles that contain those overridden dependencies since you still need those assets as well to use the prefab even if a particular nested prefab doesn't use it.
    • BuildLayoutReport can be useful to detect an issue exists but as an actual analysis tool it is somewhat hard to follow as to what the actual root cause was.
    • The correct tool for finding dependencies that also includes overridden dependencies of prefabs is to use the EditorUtility.CollectDependencies.
    • The differences between these three tools is not indicated clearly in the XML summaries and quite poorly in the documentation as well.
    • Take away from the issues we had i believe is that it is absolutely critical that this information be added to the Addressables documentation in a far more clear and noticeable manner (if it even is there, if it is it's easy to miss)
     
    Last edited: Jan 9, 2023
  4. unity_shane

    unity_shane

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    106
    @JJRivers, Hi there - I'm glad to see you were able to fix the issue, and sorry about the inconsistencies in the documentation. We plan on doing some relatively large scale documentation updates soon, and to that end I will make sure that the subtleties you've described in your post are accounted for in the docs update to ensure that issues like this don't happen in the future. Thank you for your in depth feedback!
     
  5. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    You're welcome and thank you as well!