100 thoughts on “New way of CODING in Unity! ECS Tutorial”

  1. – Easier to reuse code: How? You don't have access to polymorphism.

    – Easier to code: Turn 3 lines of code into 20 to do the same. Wow.

  2. This sounds very suspiciously like entity management systems I've seen with libgdx. In fact I was just porting one from Ash to C# for use in another application (a text based stock simulation).

  3. So before we manage everybody alone, like good ol meritocracy, and now a central component demanda the behavior of everybody much like comunism?
    This is the marxism of computation paradigm

  4. so this is a systemic design aproach to the game development itself? Great, I always thought MonoBehaviours where too abstract, and I always felt lost without knowing where I should do what, with Systems it is way simpler

  5. This reminds me of JavaScript having it's vanilla approach then ES5, now ES6. Will this be the new standard? Is the performance benefit worth it? I'm going to implement it on my next project. Would do it on my current project but I'm in too deep.

  6. I'm new to coding so correct me if I'm wrong. Does this mean we can have a massive amount of unit in the game? Like 1k soldiers in the scenes since it's no longer a 1k of monobehavior running logic but a single System handling all the logic. And designers can still teak variables on the component like the old way.

  7. For people who have little programming knowledge outside of unity, this might look clunky, wrong and overcomplicated. But believe me, this is a good approach to handle things. OOP (which unity is mainly build around) is still a viable approach to coding things, especially since it is very readable for us humans. But the whole component and inheritance system has major flaws. Firstly, getting components and use them in your code will force you to always get the complete component, which in the end means loading aaaall of the data and functions from the class the component as an object is defined in, into your code. Even when cached, you will drag down your performance with a load of unused code. Secondly, the whole inheritance system OOP is built around can have major flaws, especially in inexperienced hands. Though some people claim that inheriting is by default evil (just look up composition over inheritance for more info), I believe its more bad implementation of this design technique. If you are careful with your objects and go for small and simple objects and a clear and well-planned inheritance structure, OOP can work just fine. Especially since unity is designed around it… Anyways, I like ECS. I think its a great step towards highly optimized games and gives us developers a tool more to design our architecture. I hope unity will keep on optimizing the usability and I am really looking forward towards the first bigger tutorials and projects introducing ECS 😀

  8. I have a game that I can make enemy catching fire. Currently, if over 200 enemy were on fire the same time, the FPS would drop to below 15. I wonder if ECS could deal with this. (Lots of sequential logic happens during this fire effect, not just damage health)

  9. I have a long ass AI script for characters in my game, with an insanely heavy Update function. Currently when the number of characters reaches arround 100 the framerate gets to arround 20fps, and I have a decent computer. Would splitting the data and the logic, like shown here, of my AI characters give me a good performance boost, or would there still be so much going on at once that it wouldn't really be worth converting my script?

  10. Thank you very much for the tutorial <3 ! Do you know if I can use a 3d text prefab as entity ? It seems ECS doesn't handle text mesh renderers yet. Thx

  11. I compared frame rate on both the rotator monobehavior and the hybrid ecs style. I don't see a frame rate difference with a 4000 rotating cubes. Both hover on 27 frames a sec. Hope its something obvious I'm missing but a little disappointing.

  12. ECS should just be a TOOL and mustn’t replace the old scripting method. That’s what makes Unity popular, it’s easy and beginner-friendly for small devs. You could make a game with very few lines of codes. ECS, although efficient, complicates things so much. I have been doing game development since 2014 with Unity, migrating from JS to C#. I like Unity now, the scripting, the UI, everything. I really hope ECS isn’t the “future” of scripting in Unity or many users will probably switch to UE.

  13. ECS Documentation: https://bit.ly/2J9YvLe ● More on Pure ECS: https://bit.ly/2H9ResT

    the links seem broken. Also, can you add new videos to work with ECS?
    I learn mainly from your videos and would like to learn this as well.

  14. At 7:38 you show a foreach loop that is running in an OnUpdate(). Wouldn't this be unnecessary and quite heavy? We could have used a start function to get all entities and then stored them in a List?? Why didn't we take an approach like this?

  15. Amazing video as most of your videos are, very informative and straight forward.

    Could you go further on this topic?
    I believe the links are broken because they finally updated the system, right? @Brackeys

  16. Could Someone answer me the question : "Is it necessary to use ECS in some small or mobile game because its relatent new to me and I depends on making some small 2D or 3D games"

  17. So basically they're moving to MVC – model, view, controller. I guess it will move the dev environment closer to standard for developers.

  18. 8:01 how is this better performance??
    You're just using a static variable inside a for, isn't that just reading the value of a pointer? Why would using a local variable be better performance?

  19. ● ECS Documentation: https://bit.ly/2J9YvLe

    ● More on Pure ECS: https://bit.ly/2H9ResT Those links are donw. Not working. Can you fix that. thx.

  20. i want to ask, can we use classic code if ECS release? And if classic code can use when ECS release how about performance? thank you

  21. What the actual fuck? This isn't easier to read. And that's not an opinion, it's observable, quantifiable FACT:

    The code for rotating a simple object goes from 7 lines at 4:14, to fucking twice as much at 8:06.

    ECS might be more performant, but the idea that it's easier to read and construct is horseshit. I'm not moving onto this until there is vastly more support and tutorials for this nonsense.

    People like me who are just now getting into programming and C# are fucked if Unity moves entirely away from OOP and into ECS, especially without any resources or significant community support. And looking around the forums, it seems ECS is as buggy as 2 day old dog shit on a summer afternoon in Louisiana.

  22. Another issue with ECS, it seems entirely built around utilizing 4 threads.

    How future proof is this? How long until 4 threads is ancient and not at all applicable to modern development? So this entire system will be built around an architecture with a rapidly approaching expiration date? And it increases development time? I'd rather drop a script on another object and call it from other scripts with a single line of code instead of writing an extra 20 lines (with debug time), thank you.

    Completely backwards.

    It appears that this is Unity's attempt to play catch up with UE's performance, meanwhile it's built on a house made of straw and it goes against the very thing that makes Unity so popular and a good tool for creatives in the first place.

  23. The only thing I would ever use this for are particles, or lots of objects or enemies on the screen at one time. I don't know much about it, but it really looks like a massive pain in the ass.

  24. ok. I thought I can learn the unity basics here (gamecomponents are strange things for me). Now I'm more confused then before my youtube-search 😀
    … i will coming back, later
    but great video!

  25. Oh wow, not only is my optimization ocd extremely happy, the system seems really intuitive as well!
    UPDATE: Trying this out I get a bunch of deprecation errors and the documentation is still not updated. I'm struggling with a basic "move the entities" as there are no examples on how to e.g. update a transform, and no indication on wether updating a transform is even THE way to move entities anymore. I'm lost.

  26. Oh how wonderful,,, instead of typing something 1 hour to rotate the cube now you have to type something just 1 hour and cube will rotate… well maybe you will forgot to put some freakin ; or ( or maybe just a . and whole your game will be fuked up. Until unity make some real visual scripting, not like those rubbish things called "visual scripting" from the Asset Store everything will be same.

  27. So, we're sacrificing time for performance. If you're making a game, I'd recommend doing it the normal way and not using ESC. Takes too much time and the system is, frankly, way too vague. You can't really specify the objects 100% anymore. If the performance is big enough it'd be good, but at the moment, I doubt it.

  28. getting NullReferenceException when instantiating a prefab with the GameObjectEntity script attached to it – line 175 of said script, "types[t++] = com.GetType();." The system is not processed as a result.
    Any ideas? Thanks!

  29. Hi Brackey's! Great Vid, I have Unity 2019.1 and this is the code that works for me:

    class MoveBulletSystem : ComponentSystem


    protected override void OnUpdate()


    float deltaTime = Time.deltaTime;

    Entities.ForEach((Transform transform, MoveBulletECS moveBulletECS) =>


    transform.Translate(Vector3.forward * deltaTime * moveBulletECS.speed, Space.Self);




    My problem is the code keeps running even when the gameObject is inactive, or even when I change scene. How do I stop the code from running?

  30. Hi, If I follow your link to the pure ECS I get to a github Error 404 Page. Could you fix the link? thank you 🙂

  31. As someone who still fairly new to Unity and programing in general should I cobsider shifting over to using ECS now or should I wait until I'm confednt with object orented?

  32. Holy shit this is terribly written. Why would you run Get Entities inside an update loop? You just taught like 350k people to write bad code.

  33. Does somebody know which game architecture is better to use? ECS or MVC (model-view-controller)? Respectivally is there some a video or a thread that solves this. For example pros and cons, which is better for specific gender of game and so on?

  34. Hey. Great explanation. Just a thought. Maybe a short series of tutorials about hybrid ECS used on a different/most common systems used in the games would be good for the people to use them in their own games and practice it a little bit in a real situation. Things like AI or VFX are all very computing heavy processes and are used in almost all of the games. Having a practical tutorial on how to use ESC to improve those aspects of the game would be amazing. It is always hardest to makes first steps. Thanks again

  35. nexpected exception Burst.Options.OptionException: Unexpected arguments: `–safety-checks

    This is the error I get when I try playing it.

  36. I don't get it, how come that a lot of people state that ECS is easier to read? Instead of having all your logical components contained in a single OOP class that they belong to – you now have a whole cluster of tiny components scattered around a whole cluster of tiny files. To fully understand which parts some game object (entity) has and what do they do – you will have to trace all of the components this object has and all of the behaviours that may act upon them, and all of those may reside in a whole bunch of different files. This sounds like an absolute spaghetti code to me, and I don't understand how it can possibly be easier to read than OOP.

  37. So complicated and strange… I really hope they don't remove the old system. Also, can we get a performance comparison?

  38. thats exactly the topic i was thinkg about when i started with unity scripting. there is no system. everything is a mess if you are not working with getters/setters or some kind of class structure sending and receiving data. sure its easier to put a small script on each object but in the end you have 1000000 single scripts all over the application and you have to change things in every single script, which is a mess. so rather you set up your own system, avoiding as many seperate scripts as possible to handle everything in 1 script if possible, or you use this new technique showed in the video. thats thething I was waiting for

Leave a Reply

Your email address will not be published. Required fields are marked *