Тёмный

Unity DOTS: Components And Systems 

Wilmer Lin GA School
Подписаться 12 тыс.
Просмотров 16 тыс.
50% 1

In this episode, we make our cubes move! First we define some custom Component data. Then we create a Wave System to make ripple motion through the wall of cube meshes.
Download the starter or final projects on GitHub:
Starter project:
github.com/Uni...
Final project:
github.com/Uni...
Software: Unity 2019.3.2 with HybridRender Version 0.3.4 and Entities Version 0.6.0 from the PackageManager.
Also check out the previous videos in this series:
Unity DOTS: Creating an Entity
• Unity DOTS: Creating a...
Unity DOTS: Conversion Workflow
• Unity DOTS: Conversion...
Want to learn more about DOTS and ECS? Sign up for our mailing list to get notified when the premium course releases:
gameacademy.sc...
Want to support this channel? Subscribe to our premium courses at GameAcademy.school:
gameacademy.sc...
Let’s build something cool together!

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@alenc.2645
@alenc.2645 4 года назад
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, RU-vid and blogs, are in the top of those 5% that teach what others don't. Thank you
@GameAcademySchool
@GameAcademySchool 4 года назад
Alen C. Thanks, Alen. Appreciate the vote of confidence!
@rgame3989
@rgame3989 4 года назад
agree
@borzonstudios8638
@borzonstudios8638 4 года назад
Absolutely!
@gmjammin4367
@gmjammin4367 4 года назад
amen
@kennethgriffin5761
@kennethgriffin5761 3 года назад
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.
@AdityaSinha92
@AdityaSinha92 3 года назад
God Tier channel.
@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.
@keepeetron
@keepeetron 4 года назад
great series so far, I've had no problems following along
@randomeda
@randomeda 4 года назад
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)
@lkhprime
@lkhprime 4 года назад
Awesome, looking forward for the Job tutorial as well !! A_A
@quadriproduction
@quadriproduction 4 года назад
great series.1st dots tutorials which make sense.and .please continue this slow style..
@beeznest2232
@beeznest2232 3 года назад
I am halfway through this and you have already delivered more practical knowledge than the last six I watched elsewhere. So far, so good!
@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
@reeds7777
@reeds7777 4 года назад
it's been said before, but what a great tutorial series. Thank you so much for the great content.
@Noss454
@Noss454 3 года назад
It was a very useful video. Thank you.
@hematogen50g
@hematogen50g 4 года назад
The most useful ECS tutorial I have seen so far. Keep it up.
@angel1st007
@angel1st007 4 года назад
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 года назад
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 года назад
@@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 :-)
@ws4535
@ws4535 Год назад
very nice video! thank you!
@autorotate1803
@autorotate1803 4 года назад
Unity needs to hire you to do their tutorials!
@stoneageprogrammer432
@stoneageprogrammer432 3 года назад
just too damn cool
@AtlganSak
@AtlganSak 4 года назад
Thanks for tutorial.
@surfcode3366
@surfcode3366 4 года назад
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 года назад
It is, but this is just a simple example to get everyone started.
@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 :)
@HOSTRASOKYRA
@HOSTRASOKYRA 4 года назад
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 года назад
@@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.
@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.
@kennethgriffin5761
@kennethgriffin5761 3 года назад
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 3 года назад
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.
@nemosisstudios2673
@nemosisstudios2673 4 года назад
so cool videos, everything is well explained step by step, if you have a tipee i will give a tip to you :D
@borzonstudios8638
@borzonstudios8638 4 года назад
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!
@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?
@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?
@CalicoArchives
@CalicoArchives 3 года назад
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)
@anonymoussloth6687
@anonymoussloth6687 3 года назад
how would you use the speed as a scriptable object in ecs instead of attaching it to each prefab?
@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 года назад
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.
@tapendrashahi2097
@tapendrashahi2097 4 года назад
Wilmer Lin?? How many accounts do you have? Thanks for this tutorial though.
@GameAcademySchool
@GameAcademySchool 4 года назад
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?
@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.
@roguestargun
@roguestargun 4 года назад
How did you enable the quickfix in VSCode?
@GameAcademySchool
@GameAcademySchool 4 года назад
Do you have the Extensions for Unity installed in VSCode?
@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 года назад
​@@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!
@denissachkov6693
@denissachkov6693 4 года назад
Everything is cool! really! but .. "char" must be pronounced as "chaa" not a "car" :D
@GameAcademySchool
@GameAcademySchool 4 года назад
Denis english.stackexchange.com/questions/60154/how-to-pronounce-the-programmers-abbreviation-char
@GameAcademySchool
@GameAcademySchool 4 года назад
I have heard it both ways. I always thought “car” made more sense since it’s short for “character”
@denissachkov6693
@denissachkov6693 4 года назад
@@GameAcademySchool it's okay :) keep make videos ;)
Далее
Unity DOTS: C# Job System
19:47
Просмотров 20 тыс.
Unity DOTS: Creating an Entity
15:59
Просмотров 49 тыс.
DOTS Gameplay: Basic Player Input and Movement
22:23
Просмотров 23 тыс.
Unity Job System - A Practical Code Example
13:50
Просмотров 82 тыс.
Unity DOTS: System Base
12:47
Просмотров 15 тыс.
What are Blob Assets?
18:47
Просмотров 28 тыс.
Unity DOTS: Conversion Workflow
15:55
Просмотров 22 тыс.
DOTS GamePlay: Tags
19:09
Просмотров 10 тыс.
Converting your game to DOTS - Unity at GDC 2019
25:51
Harder Drive: Hard drives we didn't want or need
36:47
Getting Started with the Job System in Unity 2019
25:54