Search Unity

Bug Internal Asset Naming Mode affects runtime Scene name

Discussion in 'Addressables' started by mike6502, Jun 22, 2021.

  1. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    49
    If a scene is loaded from an addressables group where the Internal Asset Naming Mode was set to either GUID or Dynamic, the name of the loaded scene will not be the original scene name. Instead, the name of the scene (via the Result of the AsyncOperationHandle) will be either a GUID or dynamically created asset name, which in my testing is usually something like "8" or "92" or "f". This incorrect scene name can also be seen in the Hierarchy in the editor when running with the Play Mode script "Use Existing Build".

    The Internal Asset Naming Mode setting does not appear to affect the runtime names of any other asset type, AFAIK. It appears to only affect the names of scenes.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Oh, does this mean the scenes should actually keep their original names? We've implemented numerous workarounds because we though we would just have to deal with the scene names being lost when using Addressables.
     
  4. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    243
    On builds, I have the following issue when trying to load two different scenes almost at the same time :
    The "second" scene I'm trying to load fails loading.

    We are on Unity 2021.3.9f1 and Addressables package version 1.19.19.

    The group for our scenes have the following settings :
    • Internal Asset Naming Mode : Dynamic
    • Bundle Mode : Pack Separately
    • Bundle Naming Mode : Use Hash of Filename
    Thanks to @mike6502, I was able to reproduce the issue on Editor via the "Use Existing Build" Play Mode Script.
    Indeed, scene names on the hierarchy have ultra basic names like "9" or "e".
    I believe we got out of luck, and two scenes got named the same.

    Setting the Internal Asset Naming Mode of the corresponding groups to "Full Path" or "Filename" solved the issue.

    Without this forum thread, I would have never found the issue and the potential fix.

    Did I miss anything in the Addressables documentation ?
    Nothing there for example : https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/GroupSettings.html#:~:text=Internal Asset Naming Mode
    I saw nothing about this kind of issue in the docs, or in this forum
     
    Last edited: Jun 29, 2023
    sl1nk3_ubi and mike6502 like this.
  5. robinfischerinnogames

    robinfischerinnogames

    Joined:
    Apr 7, 2017
    Posts:
    13
    Scene '1' from AssetBundle 'bbfe00efe6b1dec533624b963eec7ca4.bundle' is already registered with another AssetBundle '5e1142266a1d8da52c539fbd24fc0f35.bundle'.


    I have the exact same issue when using AssetNamingMode.Dynamic
    Checking through the Addressable code it seems that the Dynamic Id is only unique per Bundle?! That would somehow defeat the purpose of the Id.
    But it could also only be a problem with scenes. I am not aware of any other collisions with "regular" assets like Textures or AudioClips.

    The dynamic Id is always the first character of the GUID of the asset. If that first character was already taken then the first two characters are taken. But the check to see if the id is already used seems broken :/

    I also found this bug ticket which seems to say it is going to be fixed in version 2.0
    https://issuetracker.unity3d.com/is...rown-when-loading-scenes-from-an-asset-bundle
     
    Last edited: Aug 24, 2023