Search Unity

How to use ECS Built-in components??

Discussion in 'Entity Component System' started by destrozates, Apr 17, 2019.

  1. destrozates

    destrozates

    Joined:
    Nov 7, 2013
    Posts:
    26
    Hello everyone, I am trying to play with pure ECS. I just created a brand new GameObject in the scene and added the Game Object Entity Component as shown here:
    upload_2019-4-16_18-15-13.png

    Now after watching some tutorials online I noticed that they have other components such as:
    upload_2019-4-16_18-16-21.png
    If I understood correctly those other Components are Built-in within the entities package. And if I go to the "Packages/com.unity.entities" folder I can see them there but I cannot add them to my GameObject. If I try to drag and drop from the previously mentioned folder I get the following error:
    upload_2019-4-16_18-19-57.png

    Can someone give me a hand and tell me what am I doing wrong here?

    Thank you so very much in advanced

    PS: I am using Unity 2018.3.12
     
  2. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    I believe the current version of the entities package requires Unity 2019.1.0b9 or later.
     
  3. destrozates

    destrozates

    Joined:
    Nov 7, 2013
    Posts:
    26
    So that means it should work if I upgrade to 2019.1 ??
     
  4. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    Yes, in theory.
     
  5. destrozates

    destrozates

    Joined:
    Nov 7, 2013
    Posts:
    26
    Well I am now having a different error message:
    upload_2019-4-17_12-53-21.png
    I don´t know how to assign the built-in components to the GameObjects.
     
    Last edited: Apr 17, 2019
  6. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
  7. Twinsens

    Twinsens

    Joined:
    Dec 27, 2018
    Posts:
    6
    I was watch lots of tutorial about ECS some of them use 'Rotation' that coming from Unity defaults. But when I search this, It was deprecated there is no efficient tutorial around the web. Could someone help me about this? (Please check the screen shoot that located below) (Unity 2019.1)

    Screen Shot 2019-04-17 at 21.51.10.png
     
  8. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    The new Convert to Entity workflow introduces GameObjectConversionSystem classes that handle converting data from GameObject data layout to Entity data layout. Any GameObject with the Convert To Entity component will get converted to an entity, then the GameObjectConversionSystems will take care of transforming their data to.

    As an example, check out the built-in TransformConversionSystem. This system handles converting the Transform component to LocalToWorld, Translation, Rotation, and NonUniformScale components.
     
  9. Twinsens

    Twinsens

    Joined:
    Dec 27, 2018
    Posts:
    6
    @dartriminis So starting ECS is not good at this time. May be next release things that you have learned from old version will be deprecated. I'm newbie on unity but I have mobile app development background. What would you recommend to me? Start unity mobile game development with old school MonoBehaviour system or learn ECS and start from ECS? I chose the second one. But the ECS will changed in all new versions, something is constantly changing, so I believe it is a waste of time. What do you suggest for me? (If a person who has any idea of my concerns will reply my post. I'll really appreciate for the replies)
     
  10. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,269
    Ultimately which you should use depends on what you value. Do you want extreme levels of performance and the increased modularity of DoD practices at the cost of a not-yet-finalized API? Or do you just want to make a game with a game engine like Unity?

    The core API is starting to solidify now that Megacity is out and Unity has made comments about bringing the core API out of preview by 2019.2 or 2019.3.

    I personally suggest that if you really want the power of ECS to follow these examples and to watch Unity's Unite and GDC presentations on the topic. https://github.com/Unity-Technologi...emSamples/tree/master/Samples/Assets/HelloECS
     
    Rennan24 likes this.
  11. destrozates

    destrozates

    Joined:
    Nov 7, 2013
    Posts:
    26
    I am trying to replicate the example given by Mike Geig in this video:


    I was able to do the job system and burst compiler part. But not the ECS one. Can someone give me a hand?
     
  12. Rennan24

    Rennan24

    Joined:
    Jul 13, 2014
    Posts:
    38
    I think the best thing to do would follow the examples in the Unity ECS GitHub, Even the new Unity videos from GDC 2019 on DOTS still use ComponentDataProxies which I'm not sure if they are going to deprecate it or not. But there is a video that I found on YouTube that is using the new IConvertGameObjectToEntity interface

    Hopefully that gets you on the right track! I know the DOTS API is still fluctuating but hopefully you stick through it and reap the performance and organization benefits from it! I know I have ;)
     
    NeatWolf likes this.
  13. destrozates

    destrozates

    Joined:
    Nov 7, 2013
    Posts:
    26
    Thank you very much