Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Some questions about ECS (I'm very new to it)

Discussion in 'Entity Component System' started by Lekret, Apr 16, 2021.

  1. Lekret

    Lekret

    Joined:
    Sep 10, 2020
    Posts:
    365
    I started learning ECS literally yesterday, and I have a couple of questions, good if someone more experienced can answer them.

    I understand how to create struct, generate authoring component from it and put it on the GameObject. Is this pure ECS approach or part of hybrid ECS?

    Is there a way to create entities in component model without that conversion workflow from inspector? Because I see people just creating entites from code, setting a lot of data and these typeof everywhere. Is this what pure ECS is? Is this supposed to be like that? Or it's just temporary and we will see some inspector entity builder in the future?
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,283
    Don't worry about the difference between "pure" and "hybrid". The distinction isn't as big of a deal as it used to be. "Hybrid" is typically an indication that a UnityEngine.Object is involved.

    The conversion workflow is the recommended workflow for authoring entities. While some people like to configure all their entities in code, there's no real advantage to it.
     
    xVergilx and Lekret like this.
  3. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    131
    The GameObject with your authoring component gets destroyed after the conversion to Entity is done. So at this point you only have your Entity. This means that (as far as this one Entity is concerned) it is pure ECS. Hybrid ECS means that you have both Entities and GameObject MonoBehaviours at work in your scene. But if all your GameObjects get converted to Entities, it is pure ECS.

    Also note that pure ECS isn't necessarily "better" in all cases and hybrid ECS isn't bad practice. You have to see for yourself what parts of your game work best in ECS, and what parts are better for GameObjects (especially parts that don't really have a DOTS equivalent yet, like UI).
     
    xVergilx and Lekret like this.
  4. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,715
    I don’t know what’s with the word hybrid but for some reason it lends itself to suggestions some temp or in transition to it pure form, hybridrender is another one that does this