Search Unity

Support for Sprite Renderer in GameObject -> Entity conversion?

Discussion in 'Graphics for ECS' started by Gestalt_, Oct 6, 2019.

  1. Gestalt_

    Gestalt_

    Joined:
    Oct 2, 2019
    Posts:
    1
    Hi all,

    Apologies if this has been answered before - I've seen several mentions of it in some older threads, but all answers to it have been fairly old. Do we have an ETA on when DOTS will support converting the Sprite Renderer Unity component, specifically for MonoBehaviours that implement IConvertGameObjectToEntity?

    I've been trying to think of workarounds for this in the meantime, but they all seem to have significant downsides. (Please let me know if I'm wrong here; I've been programming for a while but I'm very new to Unity / C#):

    1. Use a Mesh Renderer / Filter instead (This approach seems to lose the advantage of what you get from Sprite Renderer, such as animation flows)
    2. Abandon the idea of using "Convert and Destroy" on my GameObjects' conversion to entities, and use "Convert and inject GameObject" approach. This lets me keep my Sprite Renderer. Then build my own component to house the GameObject, and write a custom system to remove those GameObjects in tandem with when the Entities are removed. (This seems to be a heavy-handed solution, and since I'm new to Unity, I'm finding it hard to figure out - Seems like the Destroy() method is located in MonoBehaviour, so writing a DOTS system for removal seems counter intuitive / makes everything confusing if done poorly)
    3. A different ECS-based GameObject removal pattern that's not as confusing as #2
    4. ???

    Finally, a more general question - Based on my low experience level with Unity / C#, would you recommend using DOTS in its current state for 2D games? I really like the concept of it and I've gotten a few basic things working, but it does seem like there's a lack of good tutorials and information out there. Documentation seems to be shoddy and the implementation of the framework seems to still be in flux, so perhaps it's better to wait for the 1.0 release.
     
  2. LazyGameDevZA

    LazyGameDevZA

    Joined:
    Nov 10, 2016
    Posts:
    143
    Project Tiny will likely be your best bet for 2D, but I'm a little unsure about the direction it'll be going in the coming months.
    has the detail on the roadmap. It sounds like the next Tiny preview might be 3D only, but the end goal for Tiny will be support for both 2D and 3D. Regarding an ETA it's likely to still be a few months at the least.

    Overall it has been the case that the focus for DOTS has been 3D and we're yet to get the 2D systems ported, but I'm sure it's going to happen. My suspicion is that the intent is to rather have developers developing for 2D use a hybrid setup where GameObjects still live to serve the needs for 2D, but still allows us to write systems that should yield a cleaner codebase than if we were to stick to MonoBehaviour workflows. It's admittedly a little messy, but I've found 2D games don't quite suffer the same level of performance issues as quickly as a 3D game would.