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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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


    Jun 10, 2018

    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


    Unity Technologies

    Oct 7, 2019
    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
    and the managed component
    . 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.