Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How well do addressables work with ECS system?

Discussion in 'Addressables' started by RKFabio, Sep 8, 2019.

  1. RKFabio

    RKFabio

    Joined:
    Feb 9, 2016
    Posts:
    10
    I have some questions about how the addressables system is supposed to interact with the ECS system:
    1. Where are loaded assets to be stored? Systems are supposed to be behavior only, and entities data only, so it makes sense to store assets in entities but currently that would be a 16kb chunk allocation per asset, and assets are usually classes which aren't storable in entities
    2. How well does async work with the systems? Since I saw it stated somewhere that they didn't want to use callbacks with ECS, I assume task/await/async is going to be chosen for it. Will system OnUpdate or OnCreate just wait for an async function to complete, or will it move on and do other system calls while waiting?
    3. Do addressables follow the same "performance by default" philosophy? Are they as fast and efficient as the ECS, or are they more like the slower but more intuitive gameobject workflow?
    4. Are addressables going to be a permanent solution or will they be replaced with something better for ECS? I'm under the impression that ECS is going to be how unity works in the somewhat far future, so are addressables going to be built to work with it or is it mostly gameobject focused for now?

    Please correct me if any of this is wrong.
     
    JonBFS, krigby and Krajca like this.
  2. Miguel_FirstLight

    Miguel_FirstLight

    Joined:
    Apr 9, 2020
    Posts:
    1
    Can someone from Unity answer this questions?
    I'm having problems connecting ECS with addressables at the moment
     
  3. Zerio777

    Zerio777

    Joined:
    Jan 12, 2015
    Posts:
    6
  4. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    224
    There is no connection to ECS whatsoever. As far as I'm aware currently you need to write whatever integration between your ECS game architecture and Addressable yourself.

    Assets are loaded normally, like they always did when loading scenes or asset bundles.

    As I said, there is no integration at the moment. You have to write this stuff yourself. Addressables provide 3 APIs for waiting on async processes: Task<T> for await, IEnumerator for coroutines and regular public event for everything else.

    These are two different systems for different purposes. It's pointless to compare them in terms of performance. Current implementation of ResourceManager in Addressables (the core component that loads stuff) is driven by MonoBehaviour and regular Update function.

    Addressables are not "focused on gameobjects", you're confusing between assets and runtime object representations. From what I've heard on these forums, Unity is working on Addressables 2.0 with improved API and probably some kind of ECS integration. Maybe it will use ECS under the hood...
     
  5. Maltesj

    Maltesj

    Joined:
    Feb 7, 2020
    Posts:
    7
    Where did you find this information? I'm just starting to work with addressables, so i might as well get ready for 2.0 if it is vastly different. Is there any specifics about it ?
     
  6. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    224
    Somewhere on this forum, there was a post from a dev. Don't remember where exactly. No specifics that I'm aware of.
     
unityunity