Unity DOTS: Components And Systems

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

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

  • @alenc.2645
    @alenc.2645 4 ปีที่แล้ว +39

    Among thousands of people that make Unity tutorials, about 95% don't teach anything beyond the basics, and 40% really don't teach anything at all, usually just showing what they've acomplished and being more of an entertainment than actuall advice. You, with the Udemy, TH-cam and blogs, are in the top of those 5% that teach what others don't. Thank you

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

      Alen C. Thanks, Alen. Appreciate the vote of confidence!

    • @rgame3989
      @rgame3989 4 ปีที่แล้ว

      agree

    • @borzonstudios8638
      @borzonstudios8638 4 ปีที่แล้ว

      Absolutely!

    • @gmjammin4367
      @gmjammin4367 4 ปีที่แล้ว

      amen

    • @kennethgriffin5761
      @kennethgriffin5761 4 ปีที่แล้ว

      As a consumer it's so easy to fall into the habit of only 1-starring the amazon stuff that didn't work and never giving a 5-star or only downvoting videos that were really bad but never really upvoting all the good stuff you see everyday. So I don't often comment positively but this fucking series, is actual fucking gold. I swear to god if I make it as an indie it's thanks to you and I'm gonna make sure you see some of that money.
      Edit : And as of this comment, there are 342 upvotes and 0 downvotes. Never seen that.

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

    great series so far, I've had no problems following along

  • @r.i.p.4485
    @r.i.p.4485 4 ปีที่แล้ว

    40,000 brick cubes looks like a tornado, or a hive of wasps. i spent fifteen minutes just admiring the beautiful chaos . Tried in object oriented and I was able yo 30 cubes lol, oh gawd the games I'm going to make.

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

    Finally a great tutorial! My thoughts on the topic:
    TLDR; If you're not an experienced programmer in C# and Unity, playing with and learning DOTS is OK because it's the future, but it is advised to wait until DOTS come out of preview phase.
    Well, DOTS is ok for experimenting, but for me it is still a no go, because it solves one problem (performance), and introduces a tons of other problems. My main point is frustration and development time. Just to name a few problems that makes me climb up the wall:
    - no real time tweaks in play mode. This is a big problem for me. Given the above tutorial - currently you can't tweak the speed and offsets while in play mode, which leaves you with re-entering play mode A LOT, which brings us to the next problem:
    - creating a script, compiling and entering play mode takes ages - when 30-40% of development time is waiting for the editor to load, it's not a pleasant experience
    - learning curve - completely new paradigm - this alone makes it hard to pick up, and also very few good docs and videos exist, mainly because it's in preview stage since 2016(!). Also, the packages that implement this new paradigm, is written by Unity which means you will need to learn how Unity thinks it should work. For every package! (Physics, rendering, etc.)
    - Lot of editor functionality and built-in features don't work with DOTS yet, or in very early stages, meaning you will have to use workarounds for basic things, or work with preview packages that change a lot, and probably wont work perfectly on all platforms. For example, the Hybrid renderer V2 which supports URP and HDRP basic materials is not even verified for mobile platforms (as of this post)

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

    great series.1st dots tutorials which make sense.and .please continue this slow style..

  • @AM-dj4vp
    @AM-dj4vp 3 ปีที่แล้ว

    i know im a little late to the video series, but i'm going to watch and re-watch to soak in as much as i can. Seriously thank you, i will definitely buy any ECS content and recommend it to some as well

  • @beeznest2232
    @beeznest2232 4 ปีที่แล้ว

    I am halfway through this and you have already delivered more practical knowledge than the last six I watched elsewhere. So far, so good!

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

    Awesome, looking forward for the Job tutorial as well !! A_A

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

    God Tier channel.

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

    Thanks for the video man! Excellent as usual! Keep the same pace. One note though - in your lambda function you should use in type for Move and Wave data components, since they both are read only.

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

      I don't think you can use the 'in' keyword with the Entities.ForEach in the ComponentSystem. It only works in the JobComponentSystem. They have to be 'ref' in the ComponentSystem's Entities.Foreach lambda as far as I know.

    • @angel1st007
      @angel1st007 4 ปีที่แล้ว

      @@GameAcademySchool Maybe you are correct - I didn't realize ComponenSystem might have such specifics. Thanks for the clarification anyway. One more inquiry - if you consider the entity wall you built as a single object/entity, could you please tell me how you can make it rotate around a certain axis e.g. x, y or z? - I mean the entire wall, not each individual entity. With game objects it is quite easy to make all those objects children to a single game object, then to rotate the parent. I cannot, however, wrap up how to achieve the same in the ECS realm.

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

      @@angel1st007 You can add a Parent and LocalToParent component to do that...agreed it's a little wonky. If you use the conversion workflow and you have the parent-child relationship already set up, then it's much easier per usual.
      entityManager.AddComponentData(childEntity, new Parent { Value = parent });
      entityManager.AddComponentData(childEntity, new LocalToParent() );

    • @angel1st007
      @angel1st007 4 ปีที่แล้ว

      @@GameAcademySchool I would appreciate a small code snippet, so I catch on the idea. Thanks in advance :-)

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

    It was a very useful video. Thank you.

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

    it's been said before, but what a great tutorial series. Thank you so much for the great content.

  • @hematogen50g
    @hematogen50g 4 ปีที่แล้ว

    The most useful ECS tutorial I have seen so far. Keep it up.

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

    very nice video! thank you!

  • @autorotate1803
    @autorotate1803 4 ปีที่แล้ว

    Unity needs to hire you to do their tutorials!

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

    Really nice explanation and tutorial. Is it possible to adjust the frequency (or a related parameter), so the sine wave is an event, just a single wave ripple, rather than a repeating sequence of wave ripples?

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

      It is, but this is just a simple example to get everyone started.

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

    Thanks! Please create video how to change behavior of entities on runtime. For example, when presser R half of cubes are red and if pressed W half of cubes rotatea other side

    • @GameAcademySchool
      @GameAcademySchool  4 ปีที่แล้ว

      Hey, simple enough example for a future video. Input is just data like anything else. You use the data to drive the system. You still have access to the UnityEngine. Use that to get the Input from the keyboard. Then add some logic to make the Entities behave one way when one key is pressed and behave another way when another key is pressed. But let's table that for a future video.

    • @HOSTRASOKYRA
      @HOSTRASOKYRA 4 ปีที่แล้ว

      @@GameAcademySchool Sorry, I'm not talking about input.
      Here is an example of a game case.
      At first the enemy just runs. Then a ball of fire shoots it. Then the enemy runs and burns for a some time. During burning, the enemy takes more damage.
      Should all this logic be shared between several systems? Is it convinient?

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

      @@HOSTRASOKYRA You could have a EnemyHealthSystem with all of the methods to apply damage to your Enemy and trigger EnemyDeathSystem when health drops below 0.
      You may want another EnemyBurningSystem to handle turning on/off a EnemyBurningData component, which has a boolean and float burnDuration. The EnemyBurningSystem could count down with a timer in OnUpdate and set the EnemyBurningData to false when the burnDuration has been exceeded.
      The EnemyHealthSystem reduces health each frame that EnemyBurningData is true.
      Something like that?

    • @HOSTRASOKYRA
      @HOSTRASOKYRA 4 ปีที่แล้ว

      @@GameAcademySchool Yes. Thanks.

  • @mathiasjensen2841
    @mathiasjensen2841 4 ปีที่แล้ว

    I'm always impressed with your presentation - what kind of software do you use to edit and highlight your videos and do the animations? :)

    • @GameAcademySchool
      @GameAcademySchool  4 ปีที่แล้ว

      I don’t remember which one in this case, but it was either Screenflow or Camtasia for the editing. For slides I use Keynote or PowerPoint

    • @mathiasjensen2841
      @mathiasjensen2841 4 ปีที่แล้ว

      @@GameAcademySchool thanks for the very fast response :)

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

    I am doing a feasibility study for a demo and the following is crucial for it to work.
    Is it possible to have the NavAgent component and the full A* pathfinding in ECS?
    This is without having to rewrite everything yourself ofc
    .

    • @GameAcademySchool
      @GameAcademySchool  4 ปีที่แล้ว

      You'll have to wait for those. Unity has not released DOTS versions of those components. At the moment people have been writing their own.

    • @borzonstudios8638
      @borzonstudios8638 4 ปีที่แล้ว

      @@GameAcademySchool Thanks!

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

    just too damn cool

  • @jkRatbird
    @jkRatbird 4 ปีที่แล้ว

    Great tutorials! Really clear and easy to follow, and so good someone is covering all the new features in a decent way!
    I get an error when i add "ref WaveData waveData" as a third parameter in the For each. Suddenly It doesn't accept the MoveSpeed anymore, and i get told "The type MoveSpeed must be a reference type in order to use it as a parameter. If i remove WaveData error is gone. Anyone knows what's going on?

    • @ShackMan
      @ShackMan 4 ปีที่แล้ว

      Maybe you forgot to make waveData inherit from IComponentData, or didn't make it a struct?

  • @anonymoussloth6687
    @anonymoussloth6687 4 ปีที่แล้ว

    how would you use the speed as a scriptable object in ecs instead of attaching it to each prefab?

  • @alial-awadi7072
    @alial-awadi7072 2 ปีที่แล้ว

    At 2:20 you said the reason why they allowed only non-reference types is because of packing is not totally correct. The actual reason is to cache the components more efficiently.

  • @AtlganSak
    @AtlganSak 4 ปีที่แล้ว

    Thanks for tutorial.

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

    I just started to learn ECS. And I would like to know if it is possible to change the value of the material individually for each entity. I usually used Material Property Block. Is there something like this in ECS? And you can please with an example code.

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

    With the 'old' way of thinking, i tried to figure out where or how to add or instantiate a Component System like one would do with MonoBehavior Components.
    However Systems are always around... what makes me wonder how to restrict a System to a Scene or a single Entity. Is this a thing or is ECS simply not supposed to used that way?

  • @johnanthony44
    @johnanthony44 4 ปีที่แล้ว

    Does changing the authoring script values during runtime effect things?

    • @GameAcademySchool
      @GameAcademySchool  4 ปีที่แล้ว

      Once the Conversion is complete, the values in the Monobehaviour should not affect the Component Data at runtime.

  • @borzonstudios8638
    @borzonstudios8638 4 ปีที่แล้ว

    Would it be common to have a project where I combine GameObjects and Entities? For example, have my player as a GameObject since it's easy to work with and I only have a single instance per scene, while have all the AIs as Entities since I might have a lot of them each running AI code. Or should I try to have a "Entity only" architecture if I choose to go with ECS?

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

      There is no reason to go to an “Entity only” architecture if you’re not going to get significant performance gains. Use ECS where applicable.

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

    I know this is an old video but I'll still ask : Wouldn't it make more sense to have the WaveData and speed attached to the spawner object? If I spawn 100 000 entities, why should repeat the same data 100 000 times in memory? Correct me if I'm wrong but the only thing that is unique to each entity is their transform component.
    Also, just for fun, I tried coding a MakeEntityGrid() function with the MakeEntity() function you showed at the beginning of the video. Everything works great except the renderer stops rendering entities as soon as a part of it is out of viewport instead of all of it. Very funny looking behaviour. Any clue as to why?

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

      In this simple example, sure, the entities have the same MoveSpeed, but they don't have to be. Yes, you could just store the MoveSpeed in one global object if they did all have the same speed, but in most practical examples, you don't want to restrict them all to be. If you had an armada of spaceships, they may have slight variations in speed to look interesting.
      Note that the Spawner is just a classic object that spawns Entities; it doesn't exist in the DOTS world at all. You would have to use it to generate some other Entity that contained your global data to talk to the WaveSystem.

  • @roguestargun
    @roguestargun 4 ปีที่แล้ว

    How did you enable the quickfix in VSCode?

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

      Do you have the Extensions for Unity installed in VSCode?

  • @CalicoArchives
    @CalicoArchives 4 ปีที่แล้ว

    When initializing component variables I tried setting it up using a ForEach() loop in a OnCreate method in a SystemBase but I think entities don't exist when OnCreate is called. Where should I be initializing component variables? (This is for thousands of cubes so doing it in the Inspector wouldn't make sense)

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

    so cool videos, everything is well explained step by step, if you have a tipee i will give a tip to you :D

  • @immeasurability
    @immeasurability 4 ปีที่แล้ว

    hi! i need help((( i use unity 2019.4 LTS and entities p4 0.11! and cant add WaveData, GenerateAuthoringComponent not work, i have all time error (cant add script component WaveDTA:Authoring... class cannot be found). i dont have errors in editor, how to do that?

    • @immeasurability
      @immeasurability 4 ปีที่แล้ว

      solved a problem!

    • @hoangthanhduong2676
      @hoangthanhduong2676 4 ปีที่แล้ว

      @@immeasurability Can you show me how to solve it? I met the same problem.

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

      ​@@hoangthanhduong2676 hi, in real i dont understand why this happen, i delete all entities scripts in project and re copy them again, after this it is work correct!

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

    Wilmer Lin?? How many accounts do you have? Thanks for this tutorial though.

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

      Ha, no this is the same channel. I just thought I should reflect the Web site name as the channel name.

    • @tapendrashahi2097
      @tapendrashahi2097 4 ปีที่แล้ว

      @@GameAcademySchool And what about the game dev guide channel?

  • @sdv-51
    @sdv-51 4 ปีที่แล้ว +1

    Everything is cool! really! but .. "char" must be pronounced as "chaa" not a "car" :D

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

      Denis english.stackexchange.com/questions/60154/how-to-pronounce-the-programmers-abbreviation-char

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

      I have heard it both ways. I always thought “car” made more sense since it’s short for “character”

    • @sdv-51
      @sdv-51 4 ปีที่แล้ว

      @@GameAcademySchool it's okay :) keep make videos ;)