Search Unity

Question Is it possible to use Addressables with Integrated Scene Management?

Discussion in 'Netcode for GameObjects' started by Valerion, Mar 7, 2023.

  1. Valerion

    Valerion

    Joined:
    May 30, 2014
    Posts:
    5
    Hey,

    I have a project that's using NGO and it's really great to work with so far. However, I encountered the following problem (either in my understanding or it's really a limitation):
    • I have multiple level scenes that are designed in the editor (and contain terrain, some prefabs, etc.)
    • I want to load dynamic stuff. Since Resources.Load is not recommended anymore, I would like to use Addressables.
    • I added some prefabs to Addressables and found out that this leads to duplicated assets when using "regular scenes" in the build (e.g. shaders are in addressables and in the scene as well)
    • Then, I tried to move all scenes to Addressables as well which worked as well - until I wanted to load the scene using the NetworkSceneManager. Because you can only load the scene by name, which uses the "old" (?) scene loading system, not addressables.
    Therefore, my question is: Is there a way to use Addressable Scenes without having to write my own Scene Management? (which is something I would like to avoid if possible)
    Or, other question: What is the intended way to use Addressables together with NGO? (or more broadly: how should I dynamically instantiate prefabs that share some properties - e.g. shaders - with objects in the scene, using NGO)
     
    hyunwookimbob likes this.
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
  3. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    I'm facing the same problem as Valerion of not being able to load "dynamic scenes". I'm using UMod to load them, Valerion uses Addressables...however I would assume the issue is the same - they are not in the buildindex, so NetCode dont' work.

    The sample you link to doesn't show any sample of loading a scene that is not in the buildindex as far as I can see?

    I still haven't found any good guide to do more advanced stuff like this. What I can see, amoung other things is that you need to disable "Enable Scene Management" on the NetworkManager... but then in-scene networkobject doesn't event work anymore.

    Anyway, any guide/sample of loading scenes that is NOT in buildindex, I think would be really nice to have.
     
    sampenguin likes this.
  4. ViViKo_W

    ViViKo_W

    Joined:
    Jan 7, 2023
    Posts:
    8
    Does anyone have solutions to this problem?
     
  5. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Not a solution, but I flagged this need internally and asked the team for guidance. I'll keep you posted!
     
    sampenguin likes this.
  6. Proxy42-it

    Proxy42-it

    Joined:
    Jun 12, 2014
    Posts:
    2
    A ping as this is extremely important for liveops/devops. Netcode is great, addressables are great, but can't easily add new multiplayer levels/arenas without republishing the wholegame.
     
    sampenguin likes this.
  7. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    Seconding the above... I've hit a huge roadblock here. This is a critical need for any networked game that will continue to add content post release. How are NGO and Addressables not integrated already??
     
    NatureRaph likes this.
  8. makcimbx

    makcimbx

    Joined:
    Aug 29, 2017
    Posts:
    12
    With a little extra writing in the Package, I was able to make the addressable scenes work, but only the scenes that were already in build, which is basically what I needed. I hope Unity Team release an update as soon as possible, because it's really hard without it.
     
  9. NatureRaph

    NatureRaph

    Joined:
    Aug 13, 2021
    Posts:
    8
    So is there a way to do that? I mean like Addressables is especially for bigger game a must do.
     
  10. NatureRaph

    NatureRaph

    Joined:
    Aug 13, 2021
    Posts:
    8
    Did you find a solution for that?
     
  11. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    I have created this issue on the NGO Github page and have gotten some input and are in dialog with Unity via that.

    However, I have only tried the suggested solution briefly as I'm deep into some other part of the game right now. But I have to make dynamic scenes and inscene networkobjects to work, so I will get back to this in the not to far future.

    https://github.com/Unity-Technologies/com.unity.multiplayer.docs/issues/1053
     
  12. NatureRaph

    NatureRaph

    Joined:
    Aug 13, 2021
    Posts:
    8
    Ok thank you very much, I´ll have a look into that, I think it´s a bit sad that the downloadable Package doesn´t include Addessable Support at all
     
  13. Valerion

    Valerion

    Joined:
    May 30, 2014
    Posts:
    5

    No, I just ignored the duplication problem (at least for now), and have the shaders duplicated: once in the Addressable and once in the integrated scene. I hope that it may be possible to just load an addressable scene in the future, but my project is far away from release anyway (and it "works" for now, even if it's suboptimal), so I didn't spend much time trying to find a workaround yet.
     
    NatureRaph likes this.
  14. hyunwookimbob

    hyunwookimbob

    Joined:
    Mar 10, 2023
    Posts:
    8
    Is there a solution or workaround available for the current issue, or do I need to temporarily avoid using Addressables for managing scenes?
     
  15. DW79

    DW79

    Joined:
    Apr 10, 2017
    Posts:
    2
    Bumping this thread.
     
  16. manchinolik

    manchinolik

    Joined:
    Sep 16, 2020
    Posts:
    10
  17. P0rwen

    P0rwen

    Joined:
    Oct 6, 2021
    Posts:
    2
    This is very important for us. Hoping Unity can intergrate scene management solution for NGO and Addressables ASAP.
     
    d2king10 likes this.
  18. ViViKo_W

    ViViKo_W

    Joined:
    Jan 7, 2023
    Posts:
    8
    For users with this problem in NGO 1.8.1 was presented some userful functions. Now we can write our SceneManager using addressables or something else and networked prefabs from NetworkPrefabsList will work correctly, so replacing all of in-scene-placed objects on simillar prefabs should work.