How to Use the Entity Manager in Unity ECS - DOTS 2022 Tutorial [ECS Ver. 0.17]

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 42

  • @TurboMakesGames
    @TurboMakesGames  2 ปีที่แล้ว +2

    ❗❗ *Caution:* This video was made using an older version of Unity ECS. While the core concepts remain the same, some of the API and workflows have changed as of ECS version 1.0. I would recommend checking out my ECS 1.0 tutorial video for a good overview of the latest standards for Unity’s DOTS: th-cam.com/video/IO6_6Y_YUdE/w-d-xo.html
    Once again, the theory behind the concepts of this video are still relevant, however the API has changed. Stay tuned for further updated videos on this subject. Please let me know if you have any questions either here or in our Discord community: tmg.dev/Discord

    • @notraynah
      @notraynah 2 หลายเดือนก่อน

      currently in the process of learning ecs, a lot of ur amazing videos are a little old how relevant are most of these topics nowadays?

  • @jtprukop
    @jtprukop 10 หลายเดือนก่อน +2

    Can't tell you how helpful your videos have been in my exploration of ECS. Thank you for putting your knowledge out into the world!

    • @TurboMakesGames
      @TurboMakesGames  10 หลายเดือนก่อน

      Thank you so much for the support! So glad to hear these videos have been so helpful to you 😊

  • @xanderlinhares
    @xanderlinhares 3 ปีที่แล้ว +12

    Almost no one is really covering ECS, it's great to see you give it some love!

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว

      Been having fun with it, glad you've been enjoying!

  • @로물루스-e5p
    @로물루스-e5p 3 ปีที่แล้ว +6

    I always appreciate your videos about ECS

  • @FlipYourLearning
    @FlipYourLearning 2 ปีที่แล้ว +2

    Thanks for including the explanation of different ways of creating and changing entities. Something that makes ECS hard to learn is the bunch of different ways there are of doing what seems like the same thing.

    • @TurboMakesGames
      @TurboMakesGames  2 ปีที่แล้ว +1

      Definitely understand how that can be tricky to navigate - it's also tough because sometimes one way of doing things is better than another depending on the circumstances

  • @joshxwho
    @joshxwho 3 ปีที่แล้ว +1

    Great video!

  • @LukeClemens
    @LukeClemens 3 ปีที่แล้ว +1

    Wow, I never saw that section in the docs about how much needs to get done when adding a component before.... that's a lot! Reading that underscores that we need to be careful when deciding when to use tagging vs booleans.

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว

      Yeah it was definitely eye opening for me, but it kinda makes sense why it has to do all that. Think this brings up some good conversations on how to generally make decisions for designing your games with data oriented programming in mind - when it makes sense to choose one method over another. Would like to do more videos discussing these things soon 😊

  • @LukeAps
    @LukeAps 2 ปีที่แล้ว

    I had no idea there was a float4x4.Translate function. Thanks man, can finally fix some of my janky unit spawning behaviour.
    I'm not so sure about the example of the oscillating system working on LocalToWorld rather than Translate, but I'll assume it's just faster than waiting for the system to operate on Translate or something in this situation.

    • @TurboMakesGames
      @TurboMakesGames  2 ปีที่แล้ว

      Nice, glad to hear this will help you clean up that system!
      If you haven't already, check out the video I did on translations in ECS, it'll explain that a bit better. Basically, the LocalToWorld component is the end all, be all of where an entity exists in the world. Modifying the Translation component doesn't move the entity right away, rather there is a system that runs later in the frame that takes in the translation, rotation, and scale components to calculate the LocalToWorld.

  • @a.technology1446
    @a.technology1446 3 ปีที่แล้ว +1

    Thanks Johnny

  • @myelinsheathxd
    @myelinsheathxd 3 ปีที่แล้ว +2

    Nice! Can you make a video about ML agent package + DOTS.? Since ML agent's brain runs parallel using job system, however its any other world interactions code runs in single thread. And this has been typical issue in the community.
    Since all the time I did write reward +mechanics functions in just usual mono update method. As a result when the agents duplicated in the scene during training mode, CPU thread usage was just only 2 out of 16 threads.

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว +1

      Sounds like that could be interesting. I'll look into it!

  • @MrMorvar
    @MrMorvar 2 ปีที่แล้ว +2

    Slightly late but just wrote this myself and all capsules are created over each other. That CalculateTransform method doesn't seem to work for some reason. As a workaround, one can set the positions with spacings like this:
    Vector3 position = new Vector3 (x * _entitySpacing.x, 1f, y * _entitySpacing.y);
    EntityManager.SetComponentData (newEntity, new Translation { Value = position });

    • @TurboMakesGames
      @TurboMakesGames  2 ปีที่แล้ว

      Thanks for sharing what worked for you!

  • @NewbNinjas
    @NewbNinjas 7 หลายเดือนก่อน

    Legend.

  • @thegnosticatheist
    @thegnosticatheist 3 ปีที่แล้ว +1

    @TMG, Philippe released his Rival - DOTS Character Controller package recently. Maybe it's good idea to check it and create a small walkthrough series?

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว +1

      Oh nice! I heard he was close to finishing it but didn't know it got released yet. Will definitely check it out!

    • @thegnosticatheist
      @thegnosticatheist 3 ปีที่แล้ว

      @@TurboMakesGames yeah, it's very recent. I suggest grabbing it while it's discounted: assetstore.unity.com/packages/tools/physics/rival-dots-character-controller-195567
      Haven't had time to dig into myself yet but based on his previous work I have high expectations!

    • @dvgen
      @dvgen 3 ปีที่แล้ว +1

      I'll second the general comment of check it out. May or may not be useful content, but I've been following the project for a long time and bought it as soon as it was released. Haven't had a whole ton of time to play with it though.

  • @LukeClemens
    @LukeClemens 3 ปีที่แล้ว +1

    Great vid! This is way off topic, but I've never really understood the philosophy behind using different worlds in a game. As you said, each world uses a different manager. So far I've never used anything other than the default world and nearly all other code I've looked at it is the same. Scenes, and subscenes make sense... scenes are usually used for different levels or screens and subscenes are used for things like grouping similar entities so they can serialize really fast, avoiding ConvertToEntities scripts on everything, or loading/unloading sections of a map during gameplay. But why would we want two or more worlds? Is it mainly a multiplayer thing?

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว

      Funny you mention that, I was recently doing some research into this to possibly make a video on Worlds, but I started to come to the same conclusion that you did. Does seem like there are some use cases for it - mainly for networking like you mentioned. Also it seems like implementing it, in most cases seems to be more trouble than it is worth having it. Curious to see if this is an area that evolves more as ECS continues development.

  • @lnPower
    @lnPower 2 ปีที่แล้ว

    Сould you share a link to the material where you solve the many-to-many problem (for example, each object in the array needs to move to its point) in the most productive way. Thank you.

    • @TurboMakesGames
      @TurboMakesGames  2 ปีที่แล้ว +1

      Using the ECS design pattern, you can operate on things parallelly and in batches - thus highly optimizing many to many operations. I do have some plans to do some more in-depth performance testing with different things along these lines...

  • @mrbinggrae5954
    @mrbinggrae5954 3 ปีที่แล้ว +1

    Do you know the release date of Unity ECS?

    • @joepeters8746
      @joepeters8746 3 ปีที่แล้ว +1

      there is no release date, they will need years of developmentto get ECS in an usable state

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว +1

      Unfortunately, like Joe said, there is no release date or even official timeline from Unity. They are taking their time to make sure everything is working right before committing to a release schedule.

  • @王鑫-w4c
    @王鑫-w4c 3 ปีที่แล้ว

    I wrote the code according to your video and found that only 64 entities were generated in the same place, and unity reported an error: assertion failure. Value was null. The same error will be reported in your project

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว

      That's strange, I'm not seeing that same error. Is there something going on with the "CalculateTransform" function? Or is it another line that is reporting the error?

  • @Aedeus
    @Aedeus 3 ปีที่แล้ว +4

    Ok, I have one for you: Lighting! I got shadows and directional lights working just fine in pure ECS, but spot light and point lights which support realtime have me pulling my hair out. If you find a solution, it would be quite amazing as documentation is sparse.

    • @TurboMakesGames
      @TurboMakesGames  3 ปีที่แล้ว +1

      Sounds good! I'll add it to the list 😊

    • @Aedeus
      @Aedeus 3 ปีที่แล้ว

      @@TurboMakesGames Also a quick fact finding tip there, word on the street is that Hybrid Renderer V2 doesn't yet support spot and point in URP, but somehow does in HDRP? So probably will need a HDRP scene to show off those lights.

    • @LukeClemens
      @LukeClemens 3 ปีที่แล้ว

      I agree - I finally gave up on point lights (via HRV2).

  • @Saleca
    @Saleca 3 ปีที่แล้ว +1

    Unity DOTS Best practice Guide: :)