Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Addressable assets defined in scene hierarchy included in build

Discussion in 'Addressables' started by d_wayne1, Jul 18, 2018.

  1. d_wayne1

    d_wayne1

    Joined:
    Jul 18, 2018
    Posts:
    3
    I am testing with Unity Editor 2018.2 and the Addressabes System 0.1.2 Preview.

    I have assets that I have marked as Addressables in my default Remote Packed Content group. I am compiling them to WebGL and they are correctly being compiled into an asset bundle in StreamingAssets.

    The, however, are also compiled as part of the game. These assets are also in my scene object hierarchy as prefabs.

    Should objects marked as addressable in the Remote Packed Content group automatically be excluded from game builds even if they are defined in the scene hierarchy? Is there anyway to exclude them?

    Thanks
     
  2. Deleted User

    Deleted User

    Guest

  3. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    If a scene is in the build (in Build Settings window), putting it in an asset bundle will duplicate it. If assets are referenced by a scene in the build, and put in an asset bundle, those assets will be duplicated. We have code in our upcoming release (0.4.x-preview) that will make sure you don't have a scene in both addressables and the scenes list. We do not, however, scan all built-in scenes to ensure they aren't referencing anything you have marked as addressable. That may be a feature we could add later, but it would be quite costly.

    Of note as well, the fact that the group is called "Remote" does not actually force it to build to a remote location. If it builds to StreamingAssets, then that content will be with the build.
    -Bill
     
    Xarbrough likes this.
  4. Deleted User

    Deleted User

    Guest

    Hi Bill. May I ask ETA for 0.4x? And is it possible to split ResourceLocators by Key and Values, but not add them into 1 key storage like you do. Because there is kinda a mix of addresses and hashes:



    It would be nice to have a separate dictionary to Get Asset hash by knowing its address.

    Thank you.
     
    Last edited by a moderator: Oct 8, 2018
  5. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I've been working with Addressables for a couple of weeks now, but I'm still pretty unsure about how to deal with this topic of scenes vs assets. In our game, all of our scenes are built-in (in the editor build settings), most of our content is in Addressables (multiple remote groups). A lot of assets are shared between all remote groups, but also references directly in the scene. This leads to duplicated assets. However, if I simply mark all scenes as addressable and remove them from the editor build settings, the total size of the player + bundles increases compared to the duplicated version of player + bundles. This makes no sense to me.

    Or should I leave all scenes in the editor build settings and remove all direct references to assets instead and replace them with AssetReference?
     
  6. Adrien_Danglard

    Adrien_Danglard

    Joined:
    Nov 4, 2019
    Posts:
    18
    Did you check the analyse tool if there are assets that are duplicated between scenes (that are now themselves bundled)? If so, you can use the tool to create a "duplicate asset isolation" bundle, into which it will put all the assets that more than one scene depends on. If I understood your question right.
     
  7. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Yes, I've tried this and also marked the scenes as addressable, however, the total size of the built content is now larger than it was before, although the fix should have improved the size, I'm doing some more tests to try and find out what exactly is changing.
     
    Adrien_Danglard likes this.