Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Combining ECS, Authoring/Bakers and Addressables

Discussion in 'Entity Component System' started by Sylafrs, Sep 20, 2023.

  1. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    53
    Hi :)

    I'm trying to make a RTS game using the ECS system.

    For each game, we need to implement Addressables for further update, but we can't Bake subscenes in runtime; so I thought referencing the Baked scenes with the entities to spawn (and a generic spawner) would be the way to go. I'll use some kind of flag or string to be able to send commands to them, through systems and a singleton.

    So now I'm trying to add baked-in-addressables subscenes at runtime.
    Since I can't seem to be able to set it on runtime (is that correct?) I think I'll have to instantiate prefabs that have setted subscenes in it. But then, I don't know how to 'open' them.

    Still, even if it works, this pretty much feels like a hack somehow. What is the proper way of achieving that ?

    Addressables are pretty much mandatory when developping a video game, so how do you usually implement it when using hybrid ECS ?

    Best regards,
    Sylaférès
     
    koonm likes this.
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
  3. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    53
    Can we use it in parallel with Addressables ? (it seems possible; but we never know: conflicts may arise ^^)
    If we have other content, not ECS, we want in our build ?

    We would like to only have 'swarm'-like units in ECS, the other units, buildings, asn would be classic unity behaviours.

    So basically the maps should at least be stored in addressables, I guess..?
     
    Last edited: Sep 20, 2023
  4. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    53
    Alright, seems like I manage to load my scenes, but it also seems the loaded scene isn't baked..
    How can we force the scene to load to be already baked ?

    Is it possible to get a EntitySceneReference from a WeakObjectSceneReference ?
     
    Last edited: Sep 20, 2023
  5. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    yes, it is possible to use both solutions but you must manually manage the Addressables part.
    in our case we use it for the Hybrid part (Skins, VFX, SFX, UI....)
     
    Sylafrs likes this.
  6. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    53