Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question Is 2D Entities supposed to be used in non-Tiny games?

Discussion in 'Project Tiny' started by rockisch, Sep 9, 2020.

  1. rockisch

    rockisch

    Joined:
    Jun 10, 2018
    Posts:
    1
    Hi,

    I know this forum is supposed to be Tiny related, but since it seems like the 'unity.2d.entities' package is mostly related to it it seems like a good place to ask for some help.

    I'm currently prototyping a 2d platformer game, which will target PC and major consoles, so there's no need to 'make it' a Tiny project. I'm interested in DOTS as a concept, and would love to use it in our game, but I'm not sure whether I should use the 'unity.2d.entities' package for physics and rendering, since it mostly aims at project Tiny. Besides the obvious API instability, are there any drawbacks on using those features in comparison to the 3D DOTS (unity.physics)/GameObject (Box2D) alternatives? Also, sprite rendering seems to work fine without that package, does it add some extra features?
     
    NotaNaN and dannyalgorithmic like this.
  2. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello @rockisch,
    Currently there are two DOTS runtimes available to choose between, DotsRuntime (Project Tiny) and UnityRuntime (a.k.a Big DOTS/Hybrid DOTS). 2D Entities development is currently focused on DotsRuntime. We made this decision since it allows us to develop the 2D feature set in a "pure" DOTS environment.

    We also know that there is an interest in seeing more 2D DOTS features developed for the UnityRuntime, and this is something we are looking into, but we do not have any news to share about this work right now.

    The 2D Entities package contains a UnityRuntime pipeline, which is the reason why you can see the SpriteRenderers in the editor while the SpriteRenderers are inside a closed SubScene. The pipeline works by combining the data from the
    Unity.U2D.Entities.SpriteRenderer
    and the managed component
    Unity.U2D.Entities.SpriteProxy
    . Since we are working with managed components, we cannot fully utilise all the performance boosting systems that a pure ECS-style component can. This is where work would have to be done for a proper UnityRuntime pipeline for 2D.

    HybridRenderer takes another approach to rendering SpriteRenderers. It is using something called Hybrid Entities, where a clone is made from the GameObject with its UnityEngine.Components. These clones can then be reached from within the ECS world. Do note that these clones are still managed objects.

    So, what to use? If you are prototyping a project which is using the UnityRuntime pipeline, I would strongly suggest using packages developed for the UnityRuntime. This includes HybridRenderer and Unity.Physics.

    I hope this post answers your questions. Let me know if you have any other questions, and best of luck with your prototype!
     
    NotaNaN likes this.