Getting Started with ECS in Unity 2019

Поділитися
Вставка
  • Опубліковано 26 жов 2024

КОМЕНТАРІ • 631

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

    🔴 UPDATED DOTS 1.2 TUTORIAL 🔴 ua-cam.com/video/4ZYn9sR3btg/v-deo.html

  • @matanyamin1
    @matanyamin1 2 роки тому +20

    It's almost 2023 and this is still by far the best video to explain about ECS and it's usages.
    Thank you Code Monkey!

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +85

    What ECS videos would you like to see more of?
    A completed game? Performance stress tests? Hybrid ECS?

    • @TheJeyjey11
      @TheJeyjey11 5 років тому +37

      A complete game would be better since we have stress tests already and hybrid is just phase and does not have any benefits.

    • @sauliusvincevicius8688
      @sauliusvincevicius8688 5 років тому +1

      I would like to see a video hybrid ECS vs ECS performance battle

    • @TheJeyjey11
      @TheJeyjey11 5 років тому +4

      @@sauliusvincevicius8688 hybrid does not have performance optimization. It's just there to get comfortable writing in ecs architecture while using monobehaviours.

    • @konstantinlozev2272
      @konstantinlozev2272 5 років тому +2

      ECS with physics github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/UnityPhysicsExamples

    • @ioanefeiqrishvili1617
      @ioanefeiqrishvili1617 5 років тому +3

      I would like to see video about job system or physics in ecs

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +156

    I've read all the documentation and watched a ton of GDC talks and other videos to condense it all into an easy to follow tutorial.
    If you have any ECS questions let me know! Cheers!

    • @jhang41
      @jhang41 5 років тому +4

      I really love this video and it is super helpful. Cound you link some documents that I can read to learn more about ECS? It isn't easy to find and being updating very fast. Again, thank you for your video.

    • @Zvrra
      @Zvrra 5 років тому

      Thank you so much this is
      LEGENDARY

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +7

      ​@@jhang41 For my research I've seen pretty much every ECS talk by Unity and spent a ton of time just experimenting.
      The manual is a great starting point docs.unity3d.com/Packages/com.unity.entities@0.0/manual/index.html
      The documentation here is great github.com/Unity-Technologies/EntityComponentSystemSamples
      This one is great for understanding how the memory is laid out and how the Boids demo works: ua-cam.com/video/p65Yt20pw0g/v-deo.html
      Then there's the forum forum.unity.com/forums/data-oriented-technology-stack.147/
      Cheers!

    • @galrose7165
      @galrose7165 5 років тому

      @@CodeMonkeyUnity This is Hybrid, right? They mention that you can still use GameObjects and Prefabs that get converted to entities at runtime, is this for pure ecs? Can you make a tutorial which explains how to use fixed GameObjects, like a menu system?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      ​@@galrose7165 The video shows Pure ECS. Entities are created directly through code and no Game Objects are used. Hybrid ECS is something I haven't done much research on since I just jumped straight into Pure ECS but it seems like a better way of handling creating Entity Archetypes with their default values.

  • @張毓庭-w1y
    @張毓庭-w1y 4 роки тому +17

    *【NOTE ABOUT ERROR】*
    *Note 1:*
    *error CS0117: 'World' does not contain a definition for 'Active'*
    *Solution:*
    don't use -World.Active.EntityManager-
    but use:
    EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
    (by rcdemoral1982)
    *Note 2:*
    *TransformAccessJob.TransformData>' does not contain a definition for 'Length' and no accessible extension method 'Length'*
    *Solution:*
    This video used Entities of Package Manager " in old version", and I use 0.8.0 (March 13,2020) version. You can use same or older version. And it maybe can solve the problem.
    *Note 3:*
    *error CS1061: 'TimeData' does not contain a definition for 'deltaTime'*
    *Solution:*
    don't use -Time.deltaTime-
    but use:
    UnityEngine.Time.deltaTime
    *Above don't ask me why, it just work.*

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  4 роки тому +146

    ⚠️ Notes / Changes since this video was made ⚠️
    - World.Active has changed into World.DefaultGameObjectInjectionWorld, however when inside a System class you should just use World or EntityManager rather than the static world
    - If your code isn't running fast make sure you removed the Debug.Log()'s
    - You also need to add typeof(RenderBounds) to your Archetype for the Entity to be visible
    - Here I show how to build an Entity from scratch but in most scenarios you should be using the conversion System, I covered Entity Prefabs here: ua-cam.com/video/pk-C_h0WJZs/v-deo.html
    - The recommended use for the future is to use SystemBase instead of ComponentSystem or JobComponentSystem
    I covered some of these changes and the logic behind them here:
    ua-cam.com/video/JxbvRhxeKTo/v-deo.html
    Here is the entire DOTS / ECS Playlist where I covered a bunch more topics and I'm constantly adding new ones
    ua-cam.com/play/PLzDRvYVwl53s40yP5RQXitbT--IRcHqba.html
    🌐 Have you found the videos Helpful and Valuable?
    ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php

    • @marceloricoy9822
      @marceloricoy9822 4 роки тому

      I can't install the packages without giving a conflict error, which versions are you using?

    • @blakeguyan2662
      @blakeguyan2662 4 роки тому

      @@marceloricoy9822 I had the same issue. if you remove 2dEntities you should be ok.... there is some sort of conflict going on somewhere

    • @marceloricoy9822
      @marceloricoy9822 4 роки тому

      @@blakeguyan2662 i don't have 2dEntities installed, so it's probably something else

    • @blakeguyan2662
      @blakeguyan2662 4 роки тому

      @@marceloricoy9822 what is the error and what version of unity are you using?

    • @marceloricoy9822
      @marceloricoy9822 4 роки тому +1

      @@blakeguyan2662 I tested different combinations for each version of each package and the errors suddenly ended up disappearing, but they should make it clear which version they are compatible with,
      I wasted hours on it

  • @RagoDN2
    @RagoDN2 5 років тому +43

    You have the best pacing, editing, and style of any Unity tutorial creator hands down. You speed through redundant typing, you explain each step thoroughly, and you are clearly an expert on the subject. Well done.

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +1

    Check out the complete Unity ECS Tutorials Playlist: ua-cam.com/play/PLzDRvYVwl53s40yP5RQXitbT--IRcHqba.html

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +1

    🤖Join the Community Discord discord.gg/eHjUVrm

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +34

    After learning ECS get started with the Job System!
    ua-cam.com/video/C56bbgtPr_w/v-deo.html

    • @christobanistan8887
      @christobanistan8887 5 років тому +1

      Could you make the code ACTUALLY downloadable? Cuz it isn't on your site, or the links are broken.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +2

      @@christobanistan8887 Works fine for me, I can download the package from any video. What issue are you getting?

    • @NangGioMienTrung
      @NangGioMienTrung 5 років тому +1

      thank you, but could you please switch to dark theme, light mode is not good for my eye (and many viewers)

    • @arnabchatterjee6585
      @arnabchatterjee6585 5 років тому

      i have a serious question that i find no clear answer to, will the DOTS/ECS replace MonoBehaviour based scripting entirely??? form which version can we say final goodbye to MonoBehaviour based system?? answer urgently needed

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      ​@@arnabchatterjee6585 GameObjects are not going anywhere, if you're currently working a game mainly with GameObjects/MonoBehaviours you don't have to worry, keep doing everything the same.
      Both DOTS and GameObjects will coexist together. You can go pure DOTS or pure GameObjects or mix and match.
      If you make a game mainly with GameObjects you can then look at where you have performance issues and convert just that part into DOTS.

  • @KnightWhoSaysNi
    @KnightWhoSaysNi 3 роки тому +3

    Amazing. This 22min video is FAR better at explaining ECS than any Unity official documentation I've seen so far. And I've spent hours reading through them. Thank you for making this video.

  • @AngryApple
    @AngryApple 4 роки тому +31

    for 2020.1 (maybe higher):
    use the + and then add via git url and enter:
    com.unity.entities
    com.unity.rendering.hybrid

  • @farpini
    @farpini 5 років тому +64

    Yeah! Please, make an ECS series! :)

  • @christofstanits
    @christofstanits 5 років тому +3

    best tutorial on using ECS! hands down. Came here from the official unity pages, because their stuff is outdated.
    very much appreciated!

  • @Cactus0
    @Cactus0 5 років тому +25

    WOW, this is great! I hope you make more ECS videos! A complete game tutorial would be great! 👍👍👍

  • @CariagaXIII
    @CariagaXIII 5 років тому +6

    your channel is going to play a huge role in newbies for ecs

  • @NedCollyer
    @NedCollyer 5 років тому +23

    Wow, this is a breath of fresh air after watching GameObject spaghetti tutorials.
    This feels so much cleaner.
    Great tutorial. Thank you.

    • @alindinca2864
      @alindinca2864 5 років тому +3

      Well that is exactly the opposite for me =))) I thought maybe I can do this ECS, but after this video, I am sure that I will never learn it. Mainly because my brain just get used to OOP and you need to write a LOT of code just to do something simple, comparing to the normal C#.

    • @minecraftermad
      @minecraftermad 5 років тому

      @@alindinca2864 well it's not exactly optimised in any way shape or form... the game objects probably could easily be translated into entities. the main difference is the systems handling those entities

    • @megaFINZ
      @megaFINZ 5 років тому +2

      @@alindinca2864 You're not alone, for me it feels like some random mess of abstractions and implementation details. This is not idiomatic C# code, and that makes it totally non-intuitive and non-discoverable. I feel stressed just by looking at this code. Let's hope that editor integration will make it easier to reason about.

    • @chanhokim7750
      @chanhokim7750 4 роки тому +1

      @@alindinca2864 ECS is like MVC of web front-end development.

    • @michaelbeee3801
      @michaelbeee3801 4 роки тому

      I guess it is just a matter of how each individual brain works - for me this is much better than those GameObjects.

  • @MrSuperdude6
    @MrSuperdude6 5 років тому +5

    Thank you so much for this! Every Unity ECS video I found was horribly outdated or woefully unhelpful, but this is precisely what I needed!

  • @geri4367
    @geri4367 5 років тому +15

    This is amazing and really well explained.
    I'm really curious on seeing smart ways of having entities interact with each other without having to check all entities against all others

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +5

      Yeah that is something I still have to do research on. There are several ways of finding something like the closest enemy but still have to figure out which approach is best.

    • @Robber7
      @Robber7 5 років тому +2

      Quad trees?

  • @konstantinlozev2272
    @konstantinlozev2272 5 років тому +5

    This is the clearest ECS explanation I found so far, including Mike Geig's titorial with the 98000 spaceships. What I am really interested in is using raycasts and colliders with pure ECS. I have been using the Unity's batched instanced rendering (somehow now everyone seems to have forgotten about it around the ECS demos) with great results. However, I have no solution for colliders without using GameObjects. Another interesting topic would be comparing the pros and cons of ECS vs batched instanced rendering. I think the latter is still superior if you want to have more variety to your objects, since it supports many variants with the MaterialPropertyBlock.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Yeah I'm not sure what is the current state of Physics using ECS, I believe they released something with Unity 2019.1 but haven't researched that yet.

    • @konstantinlozev2272
      @konstantinlozev2272 5 років тому +1

      @@CodeMonkeyUnity github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/UnityPhysicsExamples

  • @ourfromr
    @ourfromr 5 років тому +7

    Amazing! We need more ECS/DOTS staff!

  • @mehmedcavas3069
    @mehmedcavas3069 5 років тому +3

    My brain just evaporated :D To learn it I will come 2-3 times a week and rewatch it again and again :D

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +2

      It takes a while to click but when it does the benefits are immense!

  • @D_RockBottoms
    @D_RockBottoms 5 років тому +32

    As for august 2019: World.Active.EntityManager was replaced with World.Active.GetOrCreateManager(). Entities.ForEach is just ForEach without the Entities pre-text. Unity.Transforms.Translation is Unity.Transforms.Position

    • @nakrinoban6394
      @nakrinoban6394 5 років тому +11

      as of september World.Active.EntityManager is working World.Active.GetOrCreateManager() says obsolete as of 25/8/2019

    • @chunchunmaru5128
      @chunchunmaru5128 4 роки тому

      ty man I was going sick

  • @MollyWinter
    @MollyWinter 4 роки тому +2

    Newbie programmer here. Just updated Unity to 2019.3.6f1 and followed along with the tutorial for my first time. In the "Testing" script when declaring the value of the "Translation" field, "float3" was not being recognized, so I had to add "using Unity.Mathematics;" to the top of my code. That threw off the "Random.Range" code, since the compiler didn't know whether I wanted to use "Unity.Mathematics.Random" or "UnityEngine.Random". Changed the "Random.Range" entries to "UnityEngine.Random.Range" and all is well.

  • @neon1595
    @neon1595 4 роки тому +1

    Watching in 2020, but still perfect. Came just from another channel's playlist and ended up thinking its so hard, and now here everything seems so easy when I understand those archetypes and everything

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Yup, I covered what changed in this video ua-cam.com/video/JxbvRhxeKTo/v-deo.html
      Other than a few renames everything is still exactly the same.

  • @multimediahighway
    @multimediahighway 5 років тому +4

    Great Job Code Monkey !!! It is the best and more simple ECS tutorial that I have seen !!! Please go ahead with this topic and if it is possible, a game complete with ECS be would awesome !!! Thanks for sharing with us !!!

  • @biankro
    @biankro 5 років тому +3

    RenderMesh is now on [August 2019] com.unity.rendering.hybrid, so go on Window -> Package Manager -> (show preview packages) -> Hybrid Renderer -> Install from Unity and using it from Visual Studio.

  • @mohammedhamouda104
    @mohammedhamouda104 5 років тому +2

    crazy, awesome!!! I am coming from the android world, u can't imagine how writing clean code here is simple when compared to android. Thanks for the great channel content

  • @miatribe
    @miatribe 5 років тому +2

    Properly one of the best videos on this have seen (at this level).

  • @paktofu123
    @paktofu123 5 років тому +1

    You are a gift to humanity

  • @rafante2
    @rafante2 2 роки тому

    DEAR LORD!!!! Absolutely incredible!

  • @murrayKorir
    @murrayKorir 5 років тому +1

    great video finally I got to use ECS...easy to follow and understand waiting on the Job system implementation and maybe a game series that utilizes ECS

  • @waqasgamedev
    @waqasgamedev 4 роки тому

    The performance gains are magical. And you are a great teacher. Keep it up friend.

  • @adriandeveraaa
    @adriandeveraaa 4 роки тому +1

    Thanks for running this down. This was well put together!

  • @aq2kamisama
    @aq2kamisama 5 років тому +2

    Super satisfy for the contents
    Great job for simplify all the processes in the VDO
    waiting for the next ECS VIDEO

  • @arish7231
    @arish7231 5 років тому +2

    I want a whole tutorial series bro u teach so well like Brackeys

  • @kalucky0
    @kalucky0 5 років тому +6

    That will be hard to get used to. BUT THIS IS SO COOL. I'M SO EXCITED!

    • @kalucky0
      @kalucky0 5 років тому

      I'm overreacting but I love the power of programming and that's a new level.

  • @odo432
    @odo432 3 роки тому +1

    Thought I'd get back into trying DOTS. Haven't touched it since 2019. Unity no longer includes Entities and it's dependencies in the Preview Packages of Unity 2020 so they have to be manually added now.
    I love your tutorials (used them back in 2019 as well). Just now I was running 10,000 capsules and was pleased with the performance. Then I decided to mess around with some settings. I turned on shadows and the performance plummeted. Checked the Profiler and it seems that it's the rendering side of things that's taking a huge hit. Gfx.WaitForPresentOnGfxThread (CPU waiting for GPU to finish rendering) was at 15.26ms. So it's a GPU bottleneck. Guess that's to be expected on an 8yo graphics card. Enabling GPU instancing however gave an almost 3x performance increase. Impressive.

  • @morpheus7422
    @morpheus7422 3 роки тому

    This is the best explanation hands down, if you are wondering what Ecs is and come over my comment, you won't find any better content, just relax n watch this

  • @lee1davis1
    @lee1davis1 5 років тому +1

    Thanks for doing the research for us to simplify the steps

  • @subliminalcastillo2126
    @subliminalcastillo2126 3 роки тому

    Thank you for making this! I really like the separation of data, and functionality that ECS has to offer.

  • @elonmuskarabic
    @elonmuskarabic 5 років тому +2

    Dude, you are just great!!!! happy to find your channel...

  • @MalikenGD
    @MalikenGD 5 років тому +2

    I love your content mate. ECS especially.

  • @aqua_pi
    @aqua_pi 4 роки тому +1

    Really nice and straightforward ECS intro tutorial. Great examples!

  • @lijino7353
    @lijino7353 3 роки тому

    awesome tutorials , it's freaking me out , Excellent performance. After watched video, buy you course at once.

  • @thestonerstrategist9648
    @thestonerstrategist9648 4 роки тому +1

    Wow, this is an incredible overview. Thanks so much. Earned a new subscriber!

  • @civben85
    @civben85 4 роки тому +1

    Thanks for this very helpful introduction! Very nice video!

  • @ahkilleux
    @ahkilleux 2 роки тому

    I'd argue that having data and behavior in the same object is a violation of separation of concern and encapsulation. Core tenants of object oriented programming. I would argue then that this is not a comparison between "object oriented programming" and " data oriented programming' but rather "wrong or false object oriented programming" and "actual object oriented programming"
    Great video, much appreciated!

  • @ThatsMistaTwistToYou
    @ThatsMistaTwistToYou 5 років тому +2

    This was amazing - my only mis-steps were in my typos! Thanks so much :)

  • @hiddenvoid
    @hiddenvoid 5 років тому +1

    Thanks for the great video. This is the first time I really understand how it works. Thank you so much.

  • @hakanviajando
    @hakanviajando 5 років тому +1

    That was a great step by step introduction to all parts of dots. Thanks a lot for your effort. What is your suggestion to keep updated on the dots features and improvements made by unity team?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      You can keep up to date by looking at the changelog page docs.unity3d.com/Packages/com.unity.entities@0.0/changelog/CHANGELOG.htmlAccording to some people at Unity the update in March was the last huge update that changed a lot, the core is meant to be fully complete later this year so chances are there won't be another complete overhaul.

  • @vaqifquluzada2190
    @vaqifquluzada2190 4 роки тому

    Thank you for this great tutorial dude...İm from Azerbaijan and as a lack of material about ECS im trying to figure out this concept but hopefully i have found your tutorial...

  • @BunnyGunGames
    @BunnyGunGames 5 років тому +2

    Excellent tutorial, I followed along, and I'm absolutely floored by the performance gains! What I find interesting and confusing is that the numbers of batches get into the thousands, yet performance is still running smooth. Perhaps with the new DOTS way of doing things, the 'rule of thumb' batch recommendations are not so accurate... for example, the Oculus Quest recommends under 100 'batches', I just pushed a build containing over 3000 batches to it, and it runs like a champ! Perhaps these are tiny batches XD? What do you think? Thank again!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      In theory the less batches you have the better since you're rendering less stuff, however what each batch contains is also important, doing lots of opaque batches will be faster than lots of transparent batches.
      So it really just comes down to testing how far you can push it, always batch where you can.
      Best of luck with your VR game!

  • @TsetTsyung
    @TsetTsyung 4 роки тому

    Very impressive. I've just started looking into multhreaded async/tasks in C# (want to get 79-483 certified). Thus is very cool for Unity. Look forward to going through your next vids in the series.

  • @fed1splay
    @fed1splay 4 роки тому

    Thanks for great tuts! Good job!
    a little request: please make the voice track slightly louder in your vids, a few decibels. advertising is much louder than voice acting

  • @bearwongingarden
    @bearwongingarden 5 років тому +1

    Amazing! Looking forward to see a complete game tutorial with ECS system :D

  • @artemaslanyan7503
    @artemaslanyan7503 25 днів тому +1

    Would you recommend using DOTS for every game from now on, or should it only be used in certain areas like physics and bullets etc. How is the development speed like with a big DOTS project? Thanks brother.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  25 днів тому +1

      For some very specific genres that involve lots of units/objects (like RTS) then yes it's likely great to build most of the project with DOTS. However for most projects the best approach is to only use DOTS in the performance hotspots where you need it. For example there's no point in using DOTS in a Platformer character controller, but if the game also has bullet hell elements then maybe DOTS can help spawn a giant amount of bullets/effects

  • @skylinr3444
    @skylinr3444 5 років тому +1

    Great content! Next GameDev channel worth to follow :)

  • @NiclasGleesborg0
    @NiclasGleesborg0 5 років тому +1

    Very nice series so far. :)

  • @azitjamjam
    @azitjamjam 4 роки тому +1

    Thank you very much for this, finally a good starting point for ECS :)

  • @TheUnluckyhobo
    @TheUnluckyhobo 3 роки тому

    hey love the ECS videos but have only just started to give it a go lol was wandering if you can supply some info on registering components would be super useful thanks for great tutorials :)

  • @kuteninja
    @kuteninja 5 років тому +1

    Loved this video!
    It really helped me understand ECS, as well as the Job System as well

    • @DesignerTechKreativity
      @DesignerTechKreativity 4 роки тому

      Actually this isn't using much of the C# Job System. The NativeArray type is common to both. Jobs are the layer below ECS. Although this video was using systems running in the main thread as @Code Monkey said. He said he covered Job based Systems in a later video.

  • @aatwo
    @aatwo 4 роки тому +1

    This is great, thanks for sharing these DOTS videos

  • @sskenth
    @sskenth 5 років тому

    Absolutely brilliant tutorial, looking forward to the next one.
    Would love to see follow ups involving collisions, animations and navmeshs.
    Thanks for the hard work.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      Yup Physics is something I definitely want to do but first need to do my own research.
      I don't think NavMesh is ECS ready yet though but a simple A* Pathfinder could work with the Job System.

    • @sskenth
      @sskenth 5 років тому

      @@CodeMonkeyUnity I totally understand, the amount of time and effort that must have gone into researching this must have been huge. I appreciate you sharing what you have and look forward to future content :)

  • @antonvelmozhnyi7401
    @antonvelmozhnyi7401 4 роки тому

    Great tutorial thanks alot! Also you actualy have a lot of sales on Steam, good job!

  • @radbuster4403
    @radbuster4403 4 роки тому

    Great intro video! Understood all of it, thanks!

  • @raven5165
    @raven5165 5 років тому +3

    Here comes my favorite channel's new video 😎

  • @SamHalen5150
    @SamHalen5150 5 років тому +1

    Excellent video man!

  • @ThiagoCunha
    @ThiagoCunha 4 роки тому

    OMG, I got your own ad on your video.
    I'll go watch that ad channel. 🤣🤣

  • @sconosciutosconosciuto2196
    @sconosciutosconosciuto2196 5 років тому +2

    I want other videos on ECS, please :D

  • @TalkingRaven_
    @TalkingRaven_ 3 роки тому

    I have two batches of questions:
    1.) Why exactly is this faster compared to game objects? Isn't the OnUpdate() function still running once for each entity? And how is that different from each entity having their own instance of the update function? Is it simply because of the Job system or there's really "less" calculations going on ?
    2.) Would the effect still be the same if I were to create an array of game objects, assign structs, create a single monobehaviour script and put a foreach loop on the update and move each object from there. If not, why?
    Additional Question:
    is it Ok to use the ECS system for things that are spawned in large numbers like bullets and stuff while using game objects for more complex things like player character and enemies with AI?

  • @nakrinoban6394
    @nakrinoban6394 5 років тому

    if you use create ECS it has the options for components/system instead of using create script and rewriting that

  • @scriptsengineer
    @scriptsengineer 4 роки тому

    Best list of DOTS stack learn!

  • @TheTamilNinja
    @TheTamilNinja 4 роки тому

    nice (y)
    finally managing to understand and relate to how to code this

  • @jeethbopaiah9123
    @jeethbopaiah9123 5 років тому

    Really well explained, I have been trying to find a good video to show some examples up until now every other tutorial didn't make that much sense. Thanks, @Code Monkey. Just a suggestion why not create your discord server so that we can make a community and it may help you handle questions better than youtube comments.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Yeah I've started looking into Discord and made a channel but need to set it all up correctly before I publicly announce it.

  • @levrisfirst3291
    @levrisfirst3291 5 років тому

    Просто понятно и по делу ! Благодарю !

  • @trovo7490
    @trovo7490 5 років тому +1

    Thank you, great tutorial

  • @FinitiXgameDepartment
    @FinitiXgameDepartment 5 років тому +1

    you are doing gooooooooooood....I JUST LOVE THIS SERIES

  • @mehmedcavas3069
    @mehmedcavas3069 4 роки тому +9

    If someone cant see his mesh when adding it at the version 19.3 than try to add typeof(RenderBounds) to the entityArchtype

    • @SlaxX
      @SlaxX 4 роки тому +1

      Thanks! That's where i was stuck
      Edit: Oh wow, it's literally in the "Notes / Changes since this video was made" top comment.. how did i miss that?

    • @Gius7979
      @Gius7979 4 роки тому +1

      thank you man, i was stuck too here

    • @wanbabigyu
      @wanbabigyu 4 роки тому

      thanks!
      now it's Sep.2020, I use the latest version of unity, adding "typeof(RenderBounds)" solve my problem.

    • @esofd
      @esofd 3 роки тому

      you are the best, dude

  • @rathernotdisclose8064
    @rathernotdisclose8064 5 років тому +1

    you deserve more views/subs

  • @sssfvcsdgddbh1419
    @sssfvcsdgddbh1419 5 років тому +1

    Fantastic!!!! I finaly understand how to implement it

  • @aaroncross4063
    @aaroncross4063 5 років тому

    That was amazing. I was like, this is boring dry s#it I'm not going to get this... then you made it so obvious. The final recap nailed it.
    Thanks for this!

  • @gaemdevolper
    @gaemdevolper 5 років тому +1

    Amazing video, thanks man.

  • @Deadener
    @Deadener 4 роки тому +1

    Really nice tutorial, you did a good job explaining things.
    I get the performance benefits of this, I understand how it works, and how to code for it. But, I really don't see a personal benefit for my own projects. Prototyping with this system would be incredibly obnoxious. I can see it being faster to develop with later, perhaps, but the setup is gross.
    I've never had a problem with code performance, and none of my projects are drawing a gorillion things on the screen for absolutely no reason. That really does seem to be the only example presented by everyone, over and over again. It makes me wonder if there really is any use for this outside of that and perhaps procgen (another thing I don't care about). The workflow infringements just don't seem worth it.
    I'm glad Unity pulled the reigns a bit, and decided to focus on a conversion workflow. The abstain I've seen from so many developers also tells me that Unity likely won't deprecate MonoBehaviour, as I assume was their original intention.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Unity will not deprecate MonoBehaviours, so if your games right now work perfectly fine and you dont have any performance issues limiting your design then just keep working like you've always done.
      DOTS is just a new tool, if in the future you want to make a game that does require high performance then DOTS is there for you.
      And over time DOTS will be applied to the back end of the engine, so even if you don't explicitly use it you will still benefit if you use standard Unity components.

  • @hitenramolia9493
    @hitenramolia9493 5 років тому +1

    Nicely Explained.. Thanks

  • @catafest
    @catafest 4 роки тому

    Good tutorial. This will look good with interfeces.

  • @konstantinlozev2272
    @konstantinlozev2272 5 років тому

    Another interesting ECS idea is rotating a group of entities around a point as if they were children of that point amd the point itself was rotating

  • @GFCSoft
    @GFCSoft 4 роки тому

    I found it so hard :/ good tutorial! I like your channel a lot!

  • @mohammadfathi5205
    @mohammadfathi5205 5 років тому +1

    good tutorial. appreciate it.

  • @martingrof1685
    @martingrof1685 4 роки тому +1

    Take a drink everytime you hear "entity". Amazing video though thank you lol.

  • @AdvectionStride
    @AdvectionStride 5 років тому

    Extremely helpful, thanks!!

  • @edt4262
    @edt4262 5 років тому +2

    you've got new subscriber

  • @denisgoodman4492
    @denisgoodman4492 4 роки тому

    Good Video and very Clear, but you didn't talk regarding *strategy for use DOTS:*
    Can it combine in one project with "old unity programming style" - part objected created by DOTS (many object with simple logic) and less part created by old style?
    How it will work together - will be exist benefits from DOTS in this case? In which cases use of DOTS isn't possible or not effective?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Yup you can combine them, I did that where I used normal game objects for the visuals and DOTS for Pathfinding ua-cam.com/video/XomlTHitAug/v-deo.html

  • @adoniakazemzadeh
    @adoniakazemzadeh 5 років тому +1

    Thank a lot man

  • @bonehelm
    @bonehelm 5 років тому

    This feels like how a lot of people wrote C programs back in the 80s with structs that hold the data and functions that manipulate that data. But it's actually more confusing because it's wrapped up in an OOP blanket.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      I'm not familiar with those C programs so what exactly do you think makes it confusing?
      For me as someone with previously no experience with data-oriented design I found it quite intuitive once the different mindset kicks in. Entities contain instances of Component data and Systems do work on that data.

  • @jeffesoncosta14
    @jeffesoncosta14 5 років тому

    This is a great video about ECS. Unfortunately it seems to add a bunch of boilerplate code...

  • @JustMe-fl1db
    @JustMe-fl1db 5 років тому +1

    Subbed. Great content. Must have more... :)

  • @MrDePhili
    @MrDePhili 5 років тому

    This tutorial covers a lot of things that has already been covered, would you be able to cover a more in-depth tutorial that discusses making a playable character that interacts with unique npc's, can use animations and fights bosses etc? There doesn't seem to be anyone making tutorials on how to actually make a playable game afaik, every video is just "hey, look at my simulation that runs a ton of entities!"

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      Yup that's what I'm working on, I had to start from the basics since a lot of the videos on ECS are very outdated.
      Now that I covered the basics I'm working on more complex videos.

    • @MrDePhili
      @MrDePhili 5 років тому

      @@CodeMonkeyUnity awesome! I'm very much looking forward to it. Thank you so much :)

  • @ilafed9206
    @ilafed9206 4 роки тому

    Thanks man.

  • @gregoryfenn1462
    @gregoryfenn1462 5 років тому

    Just a note, at 7:00 - 7:15 we use a ComponentSystem this runs on the main thread [ docs.unity3d.com/Packages/com.unity.entities@0.1/manual/entity_iteration_foreach.html ]. So if you are using ECS with Jobs, and most will eventually be using, then ComponentSystem is usually bad coding practice. The simplest way to combine ECS and Jobs efficiently is with a IJobForEach struct [ docs.unity3d.com/Packages/com.unity.entities@0.1/manual/entity_iteration_job.html ]

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      Yes exactly. The goal in this video is to cover solely Entities to keep it simple, the video after this one covers the Job System. In the end you should use the entirety of the DOTS stack for maximum performance.

    • @gregoryfenn1462
      @gregoryfenn1462 5 років тому

      @@CodeMonkeyUnity Thanks :) sorry I hope I didn't sound accusative!! I was just learning myself too!