Intro to DOTS Animation - Unity ECS Tutorial 2023

Поділитися
Вставка
  • Опубліковано 2 чер 2024
  • 🤑 Get these assets for 50% off: assetstore.unity.com/turbo-ma... 🤑
    👨‍💻 Code/Scripts from this video: gist.github.com/JohnnyTurbo/c... 👨‍💻
    Animation Options Wiki: forum.unity.com/threads/dots-...
    💬 Come chat with other DOTS/ECS devs: tmg.dev/Discord 💬
    🎮 Play Turbo Wars (DOTS RTS Game): johnnyturbo.itch.io/turbo-wars 🎮
    🚧 Resources Mentioned 🚧
    - Animation Options Wiki: forum.unity.com/threads/dots-...
    - Polygon Sci-Fi Worlds Pack: assetstore.unity.com/packages...
    - GPU ECS Animation Baker: assetstore.unity.com/packages...
    - Rukhanka ECS Animation System: assetstore.unity.com/packages...
    💻 My Game Development Setup: tmg.dev/GameDevPC 💻
    📸 My Camera Gear: tmg.dev/CameraGear 📸
    🎮 Let me know what other topics you want to learn about 🎮
    ⌚ Time stamps for key topics ⌚
    - 0:00 - Animations in Unity DOTS
    - 3:09 - Prerequisite Setup
    - 4:28 - Hybrid Animation Theory
    - 6:23 - Setting up Hybrid Animation Components
    - 9:25 - Spawning the Companion GameObject
    - 12:36 - Synchronizing the GameObject
    - 15:03 - Cleaning up the GameObject
    - 17:34 - Hybrid GameObject Conclusion
    - 19:05 - GPU ECS Animation Baker Overview
    - 24:20 - Rukhanka ECS Animation System Overview
    - 27:10 - Comparing the Three Approaches
    🌐 Find Me Online! 🌐
    📄 Blog: tmg.dev
    👨‍💻 GitHub: github.com/JohnnyTurbo
    🎮 Games: johnnyturbo.itch.io/
    🦅 Twitter: / turbomakesgames
    📺 Twitch: / turbomakesgames
    #UnityDOTS #UnityECS #MadeWithUnity

КОМЕНТАРІ • 90

  • @pbosteels
    @pbosteels 9 місяців тому +14

    Just a quick update on the GPU ECS Animation Baker : A new release is scheduled for next week where the attachment issue will be addressed (among some other features)

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +3

      Awesome, so glad to hear this feature will be available soon! Thanks again for the awesome asset 😀

    • @wumbla
      @wumbla 9 місяців тому +1

      this attachment tutorial is out and thank you

  • @PaulMucci
    @PaulMucci 9 місяців тому +3

    I currently use the hybrid approach along with a pooling approach for the GO side. Thanks for showing us some of the other options. 👍

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +2

      Awesome, yeah I think that is a solid place to start!

  • @testitestmann8819
    @testitestmann8819 9 місяців тому +4

    It's like you can read our minds ;) Thanks for the awesome content!

  • @hermionegreen333
    @hermionegreen333 2 місяці тому

    thank you! super informative as always

  • @KimboKG14
    @KimboKG14 9 місяців тому +1

    I bought the animation baker about a month ago.
    didn't have the time to get used to it.
    so thanks a lot for the introduction!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Cool, hope it works out well for you, I've been really enjoying using it so far 😀

    • @KimboKG14
      @KimboKG14 9 місяців тому

      @@TurboMakesGames it allready saved a customers project. Even though webgl2 doesnt Support mutithreading. Looking forward to make a vr Zombie game.

  • @cat_meow2
    @cat_meow2 9 місяців тому +1

    Great video as always!! I got a question that I've been wondering though, if 1 types of entity required too many components, what's your approach to handle that?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Not sure exactly what you mean by that, but do you mean if an entity has too much data associated with it that it won't fit in a 16kb chunk? That is pretty uncommon to happen, and if it does then maybe it is an indication that you should rethink your data layout. But if you truly did need all that data for one entity, then a good approach would be to see if you can draw lines between functionality and break the entity up into multiple entities. Then you can just have entity references between the two separate entities to keep anything in sync that may be required.

  • @LukeClemens
    @LukeClemens 9 місяців тому +7

    Awesome video!! For the ecs animation baker asset - one way to keep the helmet would be to use a mesh combiner to permanently make the helmet part of the main mesh. There are several assets in the asset store that can merge meshes and skinned meshes together. Of course that makes weapon/clothing swapping impossible... So it's not a good solution if you need that feature.

    • @JesterHereYT
      @JesterHereYT 9 місяців тому

      You could also apply the animation on the helmet at the same time as the body

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Yeah probably a better solution than just deleting the helmet 😆
      And thanks again for the extremely helpful forum post! (so glad you're keeping it updated as new things come out too!)

    • @yalong7914
      @yalong7914 9 місяців тому +1

      Nice to meet you here. :)

  • @KutluKanyilmaz
    @KutluKanyilmaz 9 місяців тому +1

    Hi Turbo, I haven't been able to dive into DOTS so far. That's why I'm curious as to if you recommend one of the assets over the other one. The hybrid approach seems cumbersome.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +2

      For ease-of-use Rukhanka is really great. For maximum performance on extremely high entity counts (100k+) GPU ECS Animation Baker is the way to go. Of course both of these require you to use ECS in your project, hope it helps!

  • @Simon19903
    @Simon19903 9 місяців тому +2

    Hey there, thanks for this video, I am getting into ECS and animations at the moment and I was wondering how the Rukhanka Animation System actually works and if it can be as performant as the GPU ECS Animation Baker System (the attachment/helmet thing is not really an issue for me right now). If I understood it correctly the GPU system bakes all the bone data into a file and just uses a shader. For the Rukhanka system: Is the skinning still done on the CPU just like the normal Skinned Mesh Renderer or is it also done on the GPU? Thank you so much!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Good question - to my understanding Rukhanka is an ECS based animation system so it runs on the CPU. I haven't done any performance testing myself, but my assumption would be that GPU ECS Animation Baker would be able to support a higher entity count as everything is running on the GPU.

    • @rukhankaanimation
      @rukhankaanimation 9 місяців тому +4

      Rukhanka's main task is to prepare skin matrices for EntitiesGraphics which uses them to render skinned meshes (with GPU skinning). This achieved by utilizing bursted parallel jobs. But despite that Rukhanka have decent performance characteristics, it is hard to outperform GPU solutions.

    • @Simon19903
      @Simon19903 9 місяців тому +2

      @@TurboMakesGames Oh wow that was quick, thank you for your answer. The developers of Rukhanka actually responded a few minutes ago and it seams you are right. Thank you for all the amazing ECS content :)

    • @Simon19903
      @Simon19903 9 місяців тому +1

      @@rukhankaanimation Thank you so much for explaining how it works! That makes a lot of sense. The fact that Rukhanka needs no baking and additional setup (except the shader) is a really nice.

    • @rukhankaanimation
      @rukhankaanimation 9 місяців тому

      @@Simon19903 And even shader requrement comes from EntitiesGraphics mesh deformation capability (explained in documentation). All baking is done under the hood by ECS bakers.

  • @LodenHeathen
    @LodenHeathen 2 місяці тому

    Lack of animation support is why I just haven't bothered with DOTS
    I use burst and jobs but really its the instance rendering of large numbers of objects which I have been doing since before DOTS was a thing that I find most useful and the lack of an out of the box solution to rendering animated meshes is just crazy to me

  • @user-kp5de3zh1g
    @user-kp5de3zh1g 9 місяців тому +2

    i used AnimationCooker to handle Animation in Dots and its really useful when using GPU to handle those animation instead of CPU but still have many cons

  • @PanCotzky
    @PanCotzky 9 місяців тому

    Hey! I love your videos very much. They are very helpful. But your thumbnails are the art of their own. Making those faces over programming tutorials is probably the bast mockery of the trend I can imagine. Keep it up!

  • @rcdemoral1982
    @rcdemoral1982 9 місяців тому +1

    Hi! Question - so DOTS Animation is slated for... apparently the next year or so. What are your thoughts here on the solutions staying relevant/feature parity/etc for the eventual Unity-made solution? Or maybe it's so far out that it doesn't matter?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      That's a tough question because I really have no idea what Unity's animation system will look like and what things it will support. As far as more general relevancy of these assets, so far thing have been looking good - the developers have been very active in responding to issues and keeping them up to date with the latest versions of ECS

    • @rcdemoral1982
      @rcdemoral1982 9 місяців тому

      Thanks for taking the time, mate. I'll try the Ruhkshana solution as even they are commenting on your video here.

  • @mufelo
    @mufelo 9 місяців тому +1

    Is there a performance difference between the GPU one and Rukhanka or are they using the same approach behind the scenes?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      To my understanding Rukhanka is an ECS based animation system and most of the animation calculations are running on the CPU, while the GPU solution is fully on the GPU. I haven't done any performance testing myself, but in theory the GPU solution would be able to handle a higher entity count at a steady framerate.

    • @mufelo
      @mufelo 9 місяців тому

      Makes sense, thanks! Havent yet taken the plunge back in but considering it again and animation definitely is one of the first big ones that I always need. Literally was asking around about this the same day you posted the video so thanks!

  • @hvinfinity6659
    @hvinfinity6659 9 місяців тому +2

    Thankyou for sharing this!
    GPU ECS Anim Baker is really great, i think the problem with the "detached - helmet" can be easily fixed by combining every parts into just 1 mesh (include bones and bind poses mapping) with scripting. I've done it several time, but the logic is quite messy and strongly depend on the kind of skinned mesh we are working with, so there is no comprehensive solution for it!
    Anyway, it think it is no problem at all!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +2

      That's definitely a good option! The only issue is that sometimes you do still want to have a separate GameObject or entity especially for something like a weapon that you may want to swap in and out for other weapons at runtime or you need to keep track of the firing point on a gun or move a collider for a melee weapon.

    • @hvinfinity6659
      @hvinfinity6659 9 місяців тому

      ​@@TurboMakesGames actually, this case is exactly the reason why I need to combine skinned mesh by runtime-scripting (not by using 3D software)
      Each time I modify the character, my code will create an instance of shared mesh (and dispose the old one). I used to do this because i need to minimize the amount of draw call per character.
      But in the work-flow of ECS GPU Anim, I'm not sure is it posible to convert the skinned mesh in runtime (not editor time), just bought this package an hour ago and i need some time to read their code to investigate 🤔

    • @hvinfinity6659
      @hvinfinity6659 9 місяців тому

      @@TurboMakesGames moreover, even the runtime conversion is impossible, i don't think it is the real problem! Because we mostly mass spawning thing such as monsters, civilians, etc,... we can perpare several mesh for them. WIth player character that require modify, we can simply use the old-school unity mecanim or Animancer until this problem is solved in the future!

    • @LukeClemens
      @LukeClemens 9 місяців тому

      ​@@hvinfinity6659 There are several mesh combiner/merger assets in the asset store. But yeah as turbo mentioned, once you merge you can no longer do weapon/clothing swapping. I have seen some gpu bone animation packages that support it but they're a little clunky. Ruhanka will support it easily out of the box, but it's performance won't be quite as high.

    • @hvinfinity6659
      @hvinfinity6659 9 місяців тому

      ​@@LukeClemens I know those packages, but they don't help much in REAL skinned mesh combining! They did something like...mixing parts together, sometime they still keep the material separated. And I don't satisfy with them. What I need is merging all of Accessory, Hairs, Weapons,... into root body, that why I need to write my own one.
      Actually, building your own Skinned mesh combining system with scripting is a "quite" advance solution. You will need to rebuild the texture, UV, Mapping re-compute bind poses, etc,... It costs me nearly 1500 lines of codes just for this feature but still not a comprehensive solution that can work for any models, in each type of model that's not sharing the same rig, i still need to re-map the config of the merging logic.
      But anyway, it work really nice on runtime!

  • @fatguystudios0com
    @fatguystudios0com 5 днів тому

    Can you give more details on the MoveInput script 25:50? What does this inherit from? I can't seem to get my components to work

    • @TurboMakesGames
      @TurboMakesGames  3 дні тому

      MoveInput is an IComponentData - check out this video to see how I setup input in Unity ECS - ua-cam.com/video/bFHvgqLUDbE/v-deo.html

  • @xuanquy1200
    @xuanquy1200 9 місяців тому +2

    Love u 😘

  • @tanama84
    @tanama84 2 місяці тому

    Are you working for any video game company? or still working on your solo project? thank you. You have a great experience with C# and Unity. This is awesome!!

  • @thomasmuller8118
    @thomasmuller8118 9 місяців тому +1

    I feel like this video realy needed a summary in the beginning. What are the alternative ways of doing this, what are the relevant advantages and disadvantages. I don't know if I want to watch the entire tutorial when I dont know if the assets alternative is better for me. And the two assets did basicly the same thing which is super relevant and you kind of just glance over that fact when first describing the second asset.

    • @LukeClemens
      @LukeClemens 9 місяців тому

      You might find the DOTS Animation Wiki useful (Turbo posted a link for it in the video description). It gives a rough summary of the different techniques with their strengths and weaknesses. It also includes assets mentioned in the video.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Thanks for the feedback! I'd agree that it would be good to check out the DOTS Animation Wiki as that summarizes the techniques shown in this video and more - forum.unity.com/threads/dots-animation-options-wiki.1339196/
      But to state it briefly here, here are the 3 options shown in this video:
      - Hybrid GameObject - Good if you are already familiar with Unity's regular animation workflow, worst performance as visuals are all GameObjects
      - GPU Baker - Best performance as everything is running on the GPU, limited feature set
      - Rukhanka - Similar workflow to regular Unity animations with almost all its features, it is an ECS based solution that runs on the CPU so performance is much better than the GameObject approach, but not as good as the GPU approach
      Hope it helps!

  • @user-zm2ks6tz5h
    @user-zm2ks6tz5h 9 місяців тому

    so i tried to resolve the error but still my character still not animating and still in T-pose.

  • @user-yu2oe6sx8m
    @user-yu2oe6sx8m 9 місяців тому +1

    Hi, that's really awesome stuff! I am wondering if I can get the source code of the whole project? Do we need to subscribe on the patreon?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      I don't plan on releasing the source code for this project as it contains lots of references to paid assets. However I do plan on making dedicated tutorials for some of the important parts of this project which will do a much better job at teaching/showcasing how to use them in a real project setting. But glad to know you'd be interested in learning more about these things!

  • @vertxxyz
    @vertxxyz 9 місяців тому +1

    Just a note that you don't need to dispose your ECBs if they are Temp allocated.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      Good point! I'm usually just over-cautious about things like that sometimes as I've definitely caused some memory leaks when I was being lazy 🙃

  • @OmerFarukGonen
    @OmerFarukGonen 8 місяців тому +1

    Do you guys know what solution does Stunlock Studio uses for V-Rising game?

    • @TurboMakesGames
      @TurboMakesGames  8 місяців тому

      If they've said it, I don't remember what it is. But knowing them, I wouldn't be surprised if they made something custom or heavily modified an existing solution.

  • @youtube_video_patrol
    @youtube_video_patrol 9 місяців тому +2

    This may sound like a dumb question, but how would I go about 2D animations?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +4

      Not a dumb question at all - I was initially going to talk about it in this video, but the video was getting a bit long. There is a great package on GitHub that can help you do this called NSprites - github.com/Antoshidza/NSprites - it is definitely something I'd like to play around with some more and maybe do a video on at some point 😊

    • @youtube_video_patrol
      @youtube_video_patrol 9 місяців тому +1

      ​@@TurboMakesGames Thanks a lot for the answer! I tried NSprites but it didn't quite click with me. So, for now, I'm thinking of creating my own simple solution and keeping an eye out for any awesome alternatives that might come up. Once again, thanks for the answer and all your amazing content!

  • @HoratioNegersky
    @HoratioNegersky 4 місяці тому

    Man this looks great when you hit play but the level of type/interface management really makes it daunting to want to get involved. Hoping they find a way to make it a little less enterprise looking on the script side and still reap the performance. Great example though, this is the first time I've seen any shred of ECS where the person teaching it made sense.

  • @kloa4219
    @kloa4219 9 місяців тому +1

    how would you do procedural animation with this?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +3

      For the hybrid GameObject approach, you likely could implement the procedural animation on the GameObject side similar to how you normally would, but the entity is still driving the transform of the GameObject. I don't think procedural animations would be possible with the baked GPU solution. And I am unsure if/how it would work for Rukhanka's ECS based animation solution.

  • @Shmilylhh
    @Shmilylhh 7 місяців тому +1

    Hello, I would like to ask you how you can cut out your character videos so clearly

    • @Shmilylhh
      @Shmilylhh 7 місяців тому

      Is your own explanation screen

    • @TurboMakesGames
      @TurboMakesGames  7 місяців тому

      Hi, not quite sure what you are asking about? Could you point to a time code in the video that you want to know more about?

    • @Shmilylhh
      @Shmilylhh 7 місяців тому

      Hello, thank you for your reply, I want to ask about your live video, please forgive me for the wrong description of the question@@TurboMakesGames

  • @user-zm2ks6tz5h
    @user-zm2ks6tz5h 9 місяців тому

    I'm having error in getting component :/

  • @HeyWhoTheFuckAreYou
    @HeyWhoTheFuckAreYou 9 місяців тому +1

    What about IK? I think IK fits better with the ECS architecture.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      I don't know if any of the ECS or GPU based solutions support IK. Best approach to implement IK for now would likely be using hybrid GameObjects

    • @HeyWhoTheFuckAreYou
      @HeyWhoTheFuckAreYou 9 місяців тому

      @@TurboMakesGames Is it possible in ECS to somehow take Transform character bones and move them?

    • @LukeClemens
      @LukeClemens 9 місяців тому

      DreamingImLatios's free Kinemation ECS animation package has IK on the short term roadmap. That's the only one I'm aware of that has mentioned IK.

    • @HeyWhoTheFuckAreYou
      @HeyWhoTheFuckAreYou 9 місяців тому +1

      @@LukeClemens I've been going to this repository for a year now and always see IK in Roadmap, apparently it's not coming out for a while yet XD

    • @LukeClemens
      @LukeClemens 9 місяців тому

      @@HeyWhoTheFuckAreYou I concur. It has been on there for a long time.

  • @xuanquy1200
    @xuanquy1200 9 місяців тому +1

    How about DOTS Collision?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      Definitely an important topic I'd like to cover soon!

  • @heman922
    @heman922 9 місяців тому +1

    Wow my old comment is on your video ❤😍

  • @josephseger6053
    @josephseger6053 9 місяців тому +1

    LOL hey that is me

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      Haha I feel like your comment summed it up perfectly 😆

  • @alperensisman6002
    @alperensisman6002 7 місяців тому

    why this is so hard? :D

  • @JacobNax
    @JacobNax 8 місяців тому

    both hybrid and rukhanka are simply not viable for production on large scale worlds.. GPU ECS animator is the only way for performance if its a thing that worries you.

  • @danielwalley6554
    @danielwalley6554 9 місяців тому +1

    Please, not the open mouth expression in the thumbnail! Don't do it! For humanity!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Oh don't you worry, I've got some ones waaaaay more egregious than this one 😆😆

  • @smarttarded
    @smarttarded 7 місяців тому

    An ECS wizard right here

  • @GameBoyyearsago
    @GameBoyyearsago 9 місяців тому +2

    Hello im new to the game dev, will you make video about gameloft.? About their past mobile games? I am wonder how are they able make such a high quality mobile games like call of duty and halo rip off like Modern Combat series and Nova series, what was their success behind it? We really want to know, please make a video about it 😊😊😊😊

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Thanks for the suggestion, I'm no game dev historian though. If you think it is a good video idea, why don't you give a shot at making it??

    • @GameBoyyearsago
      @GameBoyyearsago 9 місяців тому +1

      @@TurboMakesGames Thanks for the reply im also wondering and finding the answer, Gameloft is one of the inspiration i was aiminh making mobile games good again like they did 10/11 years ago and its still amaze me to this day, well maybe i coild give it a shot but it takes more time, so yeah aiminh to it right now 😊😊😊😊