Search Unity

Loading Entity-Manager content from asset file after or while LoadSceneAsync

Discussion in 'Entity Component System' started by Quatum1000, Nov 16, 2018.

  1. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    H team,

    currently we didn't now how to continue with our static ECS chunk loading procedure for an entity manager. The idea to render statics with ECS was formed by us some time before mega city.

    We are loading Scenes with LoadSceneAsync in real time game-play if the player reach a new area. Loading in background takes about 20-70ms for a scene (~3000 gameobjects). That's fully okay, because the area is not directly visible in range of the player and the player cannot reach this newly loaded area in this amount of time.

    Each scene-area contains it's own entity manager. All static objects are placed finally in this scene to load.
    But starting to fill the entity manager from the newly loaded scene and initialize all NativeArrays, etc. in real time takes too long. It doesn't matter if the game objects are nested prefabs or single objects.

    I think the mega city demo does load it's entity manager content from the files in editor already, and do not in real time at start or when the player reach an new area.

    • How can we solve the problem to load/unload contents of an entity manager after or inside of LoadSceneAsync.
    • Filling up the entity manager (perhaps through an asset file) must be async and hiccup free for sure.
    I really appreciate some info on this, so we can count on.
    Thank you.
     
  2. N3V-Developer

    N3V-Developer

    Joined:
    Jun 7, 2014
    Posts:
    20
    Interesting in this too. Tried several examples with IBufferElementData but nothing does it. Could be possible to update internal memory references to materials and meshes on load, but we I not handle this from the c# layer.