Data-Oriented Input in Unity ECS - DOTS + Input System 2023

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

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

  • @Unity3dCollege
    @Unity3dCollege ปีที่แล้ว +13

    Awesome! Excited to start seeing all these tutorials on DOTS, may have to make the switch sometime soon :)

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

      Ooooohhhh 👀👀👀

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

      Indeed, I was generating mineral fields (24K objects) in my game using monobehavior and a Poisson disc sampling algorithm to keep them dynamic and getting a baseline of 130 FPS, converted those over to ECS and got that baseline up to 397 FPS. It is well worth the learning curve to get it done just to allow high performance on lower end platforms.

  • @alexadach5507
    @alexadach5507 ปีที่แล้ว +7

    hey man I just want to say you deserve way more views/subscribers than you actually have. As someone learning ECS in 2023 your videos have been a godsend. Keep cranking them out, especially now that 1.0 is out. They're incredibly useful thank you.

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

      Thank you so much for the kind words. Got plenty more videos coming 😀

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

    Thanks Johnny, I'm finally revisiting DOTS after a few years and these tutorials have helped me catch back up to the new way of doing things :)

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

      Right on Nathan! Excited to see the cool things you make with it 😀

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

    Grabbing my popcorn, here we go! 🍿

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

    Was just attempting to convert my project to DOTS and wasn't confident in my approach, this helped clear things up. Thank you yet again. Lol

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

      Awesome, glad to hear this was helpful to you 😊
      And feel free to ask in the Discord if you're stuck on anything else in your conversion process - tmg.dev/Discord

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

    Thank you SO MUCH for this. Been waiting for a good tutorial for some time 👍

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

      Hahah it's been a long time coming 😀

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

    drink every time Turbo says "you know"

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

      You know, that sounds kind of dangerous 💀💀

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

    One day, someone will make a 100 hours compilation video with all the times you said "we're gonna go ahead", thank you for your work it helps

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

      Oh probably longer than that 😆😆

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

    I have been lurking in the ECS world for a few years now waiting for a 1.0 before attempting a conversion due to the imminent codebase changes we all knew were coming. It is great to see you staying on top of it as most content is outdated coming in this new release of the ECS package. Kudos to you for sharing your journey with us for the last few years!

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

      Thanks for the kind words! All the best if you do decide to give it a proper go now that 1.0 is out 😀

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

    At times, I find myself pondering why we don't need to utilize a two-layer, double-pass authentication hybrid, unmanaged interop-dots-api just to access the value of a single button. A few years ago, I could code something like if (JS_Button.Xyz) and was immediately able to launch the logic - and it worked flawlessly right out of the box. Nowadays, in Unity, it feels like you need an advanced degree just to query a controller input. But thanks to spend so much effort into this topics! 👍

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

      LOL! It certainly is more complicated, but it does have a lot of flexibility

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

    Thanks for the tutorial. This was a great topic. It's not always obvious how to hook up non dots-specific parts of unity with the DOTS/ECS application model. This was a nice explainer.

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

      Awesome, thank you so much for the kind words! Glad it was helpful 😊

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

    Thanks for the tutorial. As for a suggestion you asked for at the end of the video, I would love to see some of your old tutorials updated for 1.0 (specifically the Unit Selection ones).

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

      Awesome, glad to know you'd be interested in that. Currently working on something that uses some unit selection like this, so may be able to whip up a dedicated tutorial on that hopefully soon 😊

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

    I can't wait to put this into practice :) Thank you for your amazing contribution to the game development community! All your tutorials are excellent and this isn't an exception.

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

      Thank you so much for the kind words. Can't wait to see where you take this 😀

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

    Exactly what I needed when I needed. Thanks!!!

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

    DOTS looks complicated for a beginner lol. Thanks for all the help! ❤

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

      haha indeed it can be quite complex, but it is worth it if you need the extra performance. Hoping these videos can make it more approachable though!!

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

    Very interesting to see how events are used in the ECS world.
    Thanks

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

    Really good tutorial. I've actually started implementing some DOTS systems for fighting game inputs, and this first system that stores the input and writes it to a component in the update is something I was guessing at. Reassuring to see someone with more experience land on something similar :)

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

      Oh cool, sounds like a fun project! Feel free to share your progress in our Discord community if you'd like - tmg.dev/Discord

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

    Super appreciate your content man. Very few ECS folks at the moment it seems. I'm still wrapping my head around all of it right now, and I've never really done DOD before. I think it would've helped to see you walkthrough your thoughts as you're writing out the code. I'm still missing here how your player object in the scene is being hooked up to the movement scripts. I assume it's because the GO's got that player tag component and more on it through some authoring process. Still making the mental switch from GO to entities in the scene hierarchy as well. I'm slowly getting there I think o.O

    • @ppreshh
      @ppreshh ปีที่แล้ว

      Just saw you linked the project files! That should be plenty helpful. tytyty

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

      Thanks for watching, good to know you'd be interested in learning some more about the main DOD concepts!

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

    Very cool tutorial i would love to see more of it. You will be the new brackeys for ECS. :)

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

    Great Job! I'm a huge fan of your content and hope you will help me add new features to my games as I build using ECS. I'll be in touch and comment with some new features I would like to see added that match my C# code in this player input system but I think I have all that I need thanks to your Full ECS 1.0 video. If not, I look forward to reaching out.

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

      Awesome, so glad to hear it! Feel free to join our Discord community and share your progress/ask questions there as well! tmg.dev/Discord

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

    The things I still find challenging is Animation and AI. 2 very important systems in any game.
    So for example in a city you would simulate lots and lots of citizen / traffic.
    Having citizen walk streets from one point to another considering traffic lights and cars etc.

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

      Definitely agree on the importance of those features in any game.
      For animations, here are some of the current options available to you - forum.unity.com/threads/dots-animation-options-wiki.1339196/
      And I definitely would like to approach the topic of some different AI implementations soon!

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

    Thanks Turbo ✌

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

    Before we're gonna like the video, we're gonna go ahead and leave a comment.

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

    I'm a little cofused not with this simple example but with more complex input system where other things at the same time should be enabling and disabling some inputs.
    I.e. You have player movement input enabled at start.
    The input can be disabled by inventory and map.
    Then player opens up inventory ui so the ui forces to disabled.
    On top of it opens map. There is no change in input since its already disabled.
    Then it closes the map. The movement is enabled yet it shouldn't because the inventory is still on.
    What I have done is in singleton with
    public Dictionary disallowed; string is an action ID.
    I add every single component which disallows action. And refer with every steering component this the singleton.
    It works yet, It feels like I am doing something wrong. Like I am skipping input system package in some way.
    I was trying to search for this information yet everyone shows very basic cases with input system.
    Maybe not the correct place to ask it.
    Either way good work and thanks for the tutorials.

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

      Thanks for voicing your concerns for your use case. Unity's input system has a ton of features you can take advantage of that may be able to help you. For instance you can have different control schemes that essentially group individual controls a user has access to. So rather than disabling the full input asset, you can just change which control scheme is active at a given game state. Hope it helps your research into the input system!

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

    It would be cool if you showed how to do skeletal mesh animations using DOTS
    Maybe instead if there is no native way to do skeletal mesh in dots (even procedural animation) you can show us good practice of binding game object and it’s components to a entity in efficient way

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

      Thanks for the suggestion! Animation is definitely an important topic, but one that I want to approach in the right way when I get to it.
      For now, here are some of the current available options - forum.unity.com/threads/dots-animation-options-wiki.1339196/

  • @amir._.nazarpour
    @amir._.nazarpour ปีที่แล้ว +1

    thanks for this information

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

    So basically SystemBase is just a replacement for normal managers and non-dots type code in the main thread? Then you kind of trigger work via the already running entity systems?

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

      That is one way to use them, yes. You'll also see in my recent UI video, I use them to invoke events to update UI.

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

    Thanks bro!

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

    Could you do a video on how you would use a mixamo character & animations in dots?

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

      Definitely going to be doing some things on animation soon, so glad you'd like to know how to use a mixamo character 👍

  • @boringkillerstudio5880
    @boringkillerstudio5880 ปีที่แล้ว

    That's Great Video, I have been following your tutorials on ECS. And I have implemented into Surviver Game that's looks good but Now I'm unable to add Animation I have tried many things but couldn't work for me. So could you please make a Tutorial on Human Animation in ECS it will be great help for many dev out there. Thanks

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

      Awesome, that's super cool to hear about your game. Feel free to share your progress on our Discord if you want - tmg.dev/Discord
      Yep, animation is a topic I really should cover a bit more. For now, here is a good forum post detailing the current animation options available for ECS - forum.unity.com/threads/dots-animation-options-wiki.1339196/

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

    Would like to hear how to set up addressable assets for modding with DOTS and Steam Workshop

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

      Sounds fun, thanks for the suggestion!

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

    Hoping w get gyro feed from controllers. Last time I looked it wasn't available. Had to use Rewired.

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

      I know for sure you can look at gyro data for VR controllers, unsure about console controllers though

    • @JunkerJames
      @JunkerJames ปีที่แล้ว

      @@TurboMakesGames yeah. I think there's some issues with official driver support. You kinda have to go down the route of reverse engineered drivers since there aren't ubiquitous standards yet. Ah well.

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

    Any tips/ideas how to work with animations when using ECS/DOTS?

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

      Here are some of the current available options - forum.unity.com/threads/dots-animation-options-wiki.1339196/

    • @SuperKemito
      @SuperKemito ปีที่แล้ว

      @@TurboMakesGames Thank you

  • @Luciferdelight
    @Luciferdelight 8 หลายเดือนก่อน +1

    What is the difference between what you are doing, i guess you are just coding everything yourself, but in the new input system you usually set an Player Input component on the player and choose behaviour, (Send messages or Invoke C sharp events)
    Is this unusable when you using dots and is that the reason you do what you do.
    And if not, what would you (or anyone in the comments) say you loose out on by not using the player Input component instead ?
    I really cant wrap my head around this
    Any answere is appriciated

    • @TurboMakesGames
      @TurboMakesGames  8 หลายเดือนก่อน +1

      With ECS you can't use regular Unity components in the same way as game objects. There are ways you can reference Unity components from ECS, but for hooking into input events it ends up being even more cumbersome than what I've shown here. The biggest thing you lose out on is just the convenience of setting up things in the editor - which can be nice if you are working on teams where you want to give people the ability to tweak certain things about the input without having to open up the code.

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

    is it easy enough to make the controls rebindable? right now im using the player input component on a gameobject for my controls and i can rebind the controls in the ui, can this same logic apply to that workflow?

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

      Great question - Yes, but you'll have to go through some extra steps to support this. Here is a thorough tutorial that shows how to do this with the generated C# class - th-cam.com/video/TD0R5x0yL0Y/w-d-xo.html
      Also, it might be worth taking a look through the documentation on the input system and try some of those options - docs.unity3d.com/Packages/com.unity.inputsystem@1.6/manual/ActionBindings.html#changing-bindings
      Alternatively, you could use a managed data component, where you can store and reference your existing player input component in an ECS system. docs.unity3d.com/Packages/com.unity.entities@1.0/manual/components-managed.html

    • @UngodlyDev
      @UngodlyDev ปีที่แล้ว

      @@TurboMakesGames thanks a ton

  • @MrHandsy
    @MrHandsy ปีที่แล้ว

    Would I be able to purchase some personal advice regarding ECS from you?

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

      Reach out to me via Discord or email and we'll see if we can work something out!
      tmg.dev/Discord
      contact at tmg dot dev

  • @vakuzar
    @vakuzar ปีที่แล้ว

    This is great! now lets make Vampire survivor XD !
    or an RTS prototype could be cool.

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

      I recently did make a Vampire Survivors clone! Try it yourself, it was a super fun exercise.
      I've got something in the works that I think you'll enjoy though 😊

    • @vakuzar
      @vakuzar ปีที่แล้ว

      @@TurboMakesGames yeah! I saw that! looked so cool I wanted to try myself, but I don't know where to start on tutorials for ECS since I've been waiting for 1.0. Now that it's out I wanna dive in, but I feel like most resources are dated and might not be compatible. That's why a from scratch one is so interesting to me.

  • @jmguillemette
    @jmguillemette ปีที่แล้ว

    Dumb question but what asset / material are you using to get the floor plane with correct 1x1 cubes on it?

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

      Gridbox Prototype Materials! Free on the Unity Asset Store
      assetstore.unity.com/packages/2d/textures-materials/gridbox-prototype-materials-129127?aid=1101l9vRP
      Be sure to use it with ProBuilder so the texture tiles properly

  • @andhikadimas6345
    @andhikadimas6345 4 หลายเดือนก่อน

    too many time jump in script, i am confuse.

  • @alexpopov1902
    @alexpopov1902 ปีที่แล้ว

    can't see actor in webgl

  • @h2w..
    @h2w.. 3 วันที่ผ่านมา

    Using the (new) input system looks redundant.

  • @ashpats2
    @ashpats2 9 หลายเดือนก่อน +2

    Why is it when I copy all the scripts into a fresh project I get errors, but when I download and launch your project on the same Unity version, it runs cleanly?
    ```InvalidOperationException: The previously scheduled job PlayerMoveJob reads from the ComponentTypeHandle PlayerMoveJob.JobData.__TypeHandle.__TMG_InputSystemTutorial_PlayerMoveInput_RO_ComponentTypeHandle. You must call JobHandle.Complete() on the job PlayerMoveJob, before you can write to the ComponentTypeHandle safely.```

    • @jayvander5770
      @jayvander5770 6 หลายเดือนก่อน

      try adding Dependency.Complete() before calling SetSingleton( new PlayerMoveInput)...

    • @simleGuy
      @simleGuy 5 หลายเดือนก่อน

      @@jayvander5770 tnx man.

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

    What about IK Animations in Unity DOTS? Will there be videos on this topic? As far as I understand, now you still need to use MonoBehaviour for this, since Animations Rigging itself is written in MonoBehaviour?

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

      Yeah, that's how I am doing it now. Syncing the transform and animator from ECS to the rigged animator that lives outside of the ecs world. I do it by instantiating the prefab on start and remembering the references by using class versions of the IComponentData (unmanaged components). Wayn has a tutorial about this.

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

      That's correct. I definitely would like to put up some good videos on Animation in ECS in general, but good to know you'd like to learn about IK animations specifically

    • @evanfield6720
      @evanfield6720 ปีที่แล้ว

      You can actually bake in the animations into the Entity itself and progress them through code. There is a good asset out all ready that will allow you to accomplish this called "GPU ECS Animation Baker", It is pretty straight forward to use it and the video demonstration is sufficient enough to get it up and running. Here are the tutorial videos he made for the application of the asset, th-cam.com/play/PLerop1JzrAobUF2d8Iafj5waqSq3Ib8k1.html, buying assets is of course just the prelude to dissecting the code in them to see the path that was used to accomplish the task.

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

      ​@@evanfield6720That won't support IK. As far as I know the only DOTS option that supports IK is by synchronizing legacy game objects with ECS. The DOTS Animation Options Wiki lists a lot of options, but none support IK at the moment. The Kinemation framework from DreamingImLatios has it on the roadmap.