Entity Component System Overview in 7 Minutes

  Рет қаралды 97,494

Board To Bits Games

Board To Bits Games

Күн бұрын

A discussion of the fundamentals and implementation of entity-component-system architecture, and how it might impact your game development as Unity rolls out ECS.
I'm told that knowing is half the battle.
Support Board to Bits on Patreon:
/ boardtobits
Check out Board To Bits on Facebook: / boardtobits

Пікірлер: 77
@rakibjahan
@rakibjahan 5 жыл бұрын
Need a full on tutorial series on ECS
@DrPol1
@DrPol1 3 жыл бұрын
Excellent and concise explanation, just what I was looking for!
@1996Pinocchio
@1996Pinocchio 5 жыл бұрын
You've explained what ECS is very well, thank you so much! :)
@Golemofstone
@Golemofstone 5 жыл бұрын
Wow i actually understand most of this now, really good explanation of this concept for a noobie like myself, you gained a sub sir.
@rugososphotos3646
@rugososphotos3646 7 ай бұрын
Really nicely explained, this video really helped me conceptualize what ECS is and what is not
@lhorbrum1818
@lhorbrum1818 5 жыл бұрын
You just can't get anymore awesome! Thank you so much!
@lleytonmorris6305
@lleytonmorris6305 5 жыл бұрын
Thank you so much for explaining this concept. For a while now i have wanted to start creating my own game and every couple of steps I come across a hurdle that makes me want to redesign the entire system. The largest hurdle has been the fact that inheritance just doesn't always allow for things. as explained, a duck is both a mammal and a bird so it makes sense to inherit from both of them, but an interface doesn't allow for me to define any code so I would have to write the same code twice in two different classes if i was to implement an interface so this method seems super logical in a game development environment.
@kruth6663
@kruth6663 4 жыл бұрын
Excellent explanation, makes good sense even to a beginner like myself. Thanks!
@sh42913
@sh42913 3 жыл бұрын
I want to notice that performance is not main ECS advantage, main advantage of ECS is flexibility and scalability, due everything is data and you can easily change how data flow is working.
@Microphunktv-jb3kj
@Microphunktv-jb3kj 5 ай бұрын
i dont get it ... is entities like data/metadata components basicly like methods or actions and system is more like a la "MovementSystem" "SpriteSystem" "TileSystem" "AudioSystem" etc.. for example... im trying to learn this thing... and doing research, what i have to learn and know to build a browser game,... Basicly i want to build a webbased tick or ws game.. like planetarion and darkgalaxy years ago.... i kind of liked these "background games" u could play if u dont have much time.. or on the side when you have 10-15min time and nothing to do at work... also seems Vue is very interactive and 2way databinding is supercool in that frameworks, was thinking of that... but it somehow feels really weirtd to use a web freamework for a game... (eventho those type of games almost aare like basicly websites where u just push tables and data haha, they're not that complex you know... my goal is to make more complex and "lively" one.... an inspioration to me is that game -> www.landsoflords.com i love how the map is... and how there's some RP elements in the game, wich reminds me of CK2/3 .. characters, coat of arms, hierarchy/titles etc....
@DasAntiNaziBroetchen
@DasAntiNaziBroetchen 3 жыл бұрын
Storing an entity's attributes all in the same place is *not* more efficient. It all depends on the access pattern. If you're not always going to access all attributes (highly likely), you waste cache lines for unused data and hinders vectorization. It is better to split up the data in a way that matches the access pattern. For example: You're doing a lot of checks on entity positions? Store all entity positions in a giant array.
@SelesteDev
@SelesteDev 8 ай бұрын
That’s literally what ECS is. You can store all the components within their own arrays and then have them reference the entity with an ID
@sitter2207
@sitter2207 Жыл бұрын
you really explained very well. I have been watching vids about ECS for 2 hours to completely get it. After this video I will stop. Thank you so much!
@uweeby69
@uweeby69 5 жыл бұрын
you have a great voice and mic setup. very easy to listen to.
@Outfrost
@Outfrost 3 жыл бұрын
This is kinda random, but your infographic has told me more about the 'flyweight' pattern than the Wikipedia page for it and any explanations I could find by googling.
@KeiNovak
@KeiNovak 5 жыл бұрын
Good call on holding out. Now there is DOTS!
@llamasarus1
@llamasarus1 3 жыл бұрын
I'm going to max out what I'm able to build with the OOP inheritance-based approach then I'll check back with this when I need it. Thanks!
@OGkuma_
@OGkuma_ 5 жыл бұрын
Thank you for your videos!
@DukeJon1969
@DukeJon1969 2 жыл бұрын
Great explanation
@62mohsen62
@62mohsen62 3 жыл бұрын
amazing info, thanks.
@awwastor
@awwastor 3 жыл бұрын
“Doesn’t unity already use ECS?” “Well it depends what “system” means in the shortcut”
@TheCrXe
@TheCrXe 5 жыл бұрын
great one!
@mantasvaiciulis3657
@mantasvaiciulis3657 5 жыл бұрын
Can you make a series on dialogue? I always wondered how developers make such advanced dialogue systems. For example night in the woods, Oxenfree or any visual novel game, how do you manage so much text, different choices and outcomes? I imagine you don't type everything out in the inspector. There are ZERO tutorials on this. Ty, and great content as always.
@BoardToBitsGames
@BoardToBitsGames 5 жыл бұрын
Short answer is using excel sheets & data files, lol. That is an interesting idea though. I’ll give it some thought.
@beardordie5308
@beardordie5308 5 жыл бұрын
As a hobby I've begun scripting such a system. I've been heavily using Scriptable Objects to do so, however a full on database or Excel sheet is more appropriate for large projects. I'm focusing on how player dialogue choices can affect gameplay and are only presented as dialogue choices based on previous gameplay. Difficult to architect in a way that is loosely coupled.
@goombario7411
@goombario7411 5 жыл бұрын
You should check out kzbin.info/www/bejne/h6TMpmCwr6mMrdk, it's the Night in the Woods devs talking about their dialogue system
@MarcoFriz
@MarcoFriz 5 жыл бұрын
Como siempre, muchas gracias, me ha quedado mas claro como funciona el nuevo sistema de Unity
@RT-.
@RT-. 3 жыл бұрын
Roses are red Violets are blue The video speaks English So why don't you too?
@MarcoFriz
@MarcoFriz 3 жыл бұрын
@@RT-. solo yo tengo que traducir lo que dices para entenderte?
@RT-.
@RT-. 3 жыл бұрын
@@MarcoFriz Si. El video se habla en inglés, por lo que debe comentar también en inglés si desea que otras personas lo entiendan.
@MikoGot
@MikoGot 5 жыл бұрын
Thank you, good video :)
@anwaraisling
@anwaraisling 5 жыл бұрын
Thank GOD! I’ve long been frustrated with the overhead of the GameObject-Component system that’s been the hallmark of Unity. I wish I had this ages ago.
@luckylove72
@luckylove72 5 жыл бұрын
So from programmers point of view who has read GOF Design Pattern book. It is Composition over Inheritance for object composition?
@SolacePavilion
@SolacePavilion 4 жыл бұрын
I think that thing about memory is not about the storage of the entity but about the fact that you are doing all the logic in order. Like, first you do all your rotation transforms then you might do all your draws and so you get better performance because you are doing many similar operations in a row. I may be wrong though, I'm new to this as well
@clickrush
@clickrush 4 жыл бұрын
The memory layout of your data has massive implications on CPU performance. It has nothing to do with the similarity of sequential operations, but with how those operations access your memory. The classic OO approach and even most ECS mostly concern themselves with readability and the organization of code rather than performance. If you care about performance then you want to think about data-structures and algorithms first, including memory layout.
@jerrickmarques8777
@jerrickmarques8777 2 жыл бұрын
@@clickrush When we're talking about memory layout, I assume it's always best for the data to be laid out sequentially in the order it is accessed? Also, I don't know if I'm missing something, but it seems like caching is always done automatically by the CPU and we don't really control how that works right?
@Jianju69
@Jianju69 3 жыл бұрын
Great explanation of the concept! Thanks
@10843555
@10843555 3 жыл бұрын
Regarding the example brought up at 3:25 (and revisited again at 4:36), I don't see how this is an inherent advantage of ECS, it seems like it is just a difference in how the components are modelled using each approach (GameObjects vs ECS). If the Transform "component" used on GameObjects is bloated with all these additional fields, couldn't it just be replaced with a lightweight one modelled like the one shown in the example for ECS?
@tandyabimap-hv6fw
@tandyabimap-hv6fw Күн бұрын
The Only Thing I Needed for "Entity-Component-System" is The Description The Thing That You Playing The Game and The NPC That Destroys You Player is Protagonist NPC as Enemy is Antagonist That's The Thing I Wanna Know
@gamereplayhq
@gamereplayhq 8 ай бұрын
i've been trying to understand entity component system, so from what i understand 1. entity [A]: an entity can refers to an game object in our scene, and this entity holds components ( attachComponent( entity=A, component=B) ) 2. component [B]: a component has no method, only provide set of data, think of a "struct" in c language 3. system [C] : system acts on components, they provide methods that can alter entity's component in expected manner, ex: so a system "C" that may increase speed attribute defined in component B can be used as follow : applySystemOnEntity(entity = A, system = C)
@dranon0o
@dranon0o Жыл бұрын
For the storage, it's good to create chunks of memory by archetypes (unique combination of components)
@alejandrocr9293
@alejandrocr9293 16 күн бұрын
that is a good one
@osogrande4999
@osogrande4999 5 ай бұрын
Tagged with a unique ID hash? what is it a hash of exactly?
@bagieta21
@bagieta21 4 жыл бұрын
So now we are waiting to see how you would change your flocking algorithm to ECS;)
@awwastor
@awwastor 3 жыл бұрын
Well my game doesn’t need any of the things you said on when to use ECS but I cannot deal with inheritance in C++...
@cyanuranus6456
@cyanuranus6456 3 ай бұрын
Most Thing I Know About That are an Object Can Be Controlled By User and Objects That are Alive But Aren't Controllable. Like Players and NPC
@danieleccleston7928
@danieleccleston7928 4 жыл бұрын
can u combine ECS and oop like have the game be oop like normal and were need the flexibility add the ECS?
@androyd16
@androyd16 4 жыл бұрын
He explained that ECS still integrates OOP in some ways at the early part of the video. However, it seems like you have to choose one way or the other if you want the whole project to be consistent.
@danieleccleston7928
@danieleccleston7928 4 жыл бұрын
@@androyd16 Alright
@ishdx9374
@ishdx9374 3 жыл бұрын
OOP isn't compatible with ECS, literally. OOP uses vtables which contain references to instance structs, which means your memory still isn't centralized and you'll get cache misses.
@SunnyApples
@SunnyApples 5 жыл бұрын
As an aspiring Unity developer who got into programming 2 years ago, I am ready to start learning ECS. If Unity devs insist that ECS is just flat out better than OOP, than let's use the better way to write code! It looks to me like no one has a ton of experience with ECS, not even seasoned developers. That means that people will be motivated to start making lot's of tutorials for it, it will be a hot new thing, everyone will be googling it, and every KZbinr will be covering it. Exciting time to be a beginner programmer. 😃
@Rakkoonn
@Rakkoonn 5 жыл бұрын
A lot of gamedevs already have experience with it. This is not some new thing Unity invented, ECS and job system are already common in game development. Even Unity already had an ECS library, Entitas, which some game studios have used.
@tomicooltomi
@tomicooltomi 5 жыл бұрын
Is there any literature on Unity's ECS yet?
@seditt5146
@seditt5146 4 жыл бұрын
There is, quite a bit but I would not really call it complete. I was not happy with the stuff I seen.
@ian3084
@ian3084 4 жыл бұрын
Can someone explain the tag thing? How can i dynamically know which components exist or are valid for each entity? Also i don't understand how that solves the issue of whether a component exists, given it is stored in a separate array.
@jerrickmarques8777
@jerrickmarques8777 2 жыл бұрын
I assume by using a custom made hashing algorithm which takes into account the components an object has
@ian3084
@ian3084 2 жыл бұрын
@@jerrickmarques8777 Good idea
@MarcoFriz
@MarcoFriz 5 жыл бұрын
Esperando a que cargue :)
@warwolt
@warwolt 5 жыл бұрын
It's worth noting that it's common practice with component based design in object oriented programming as well! Not all OO designs are great huge inheritance hierarchies.
@BoardToBitsGames
@BoardToBitsGames 5 жыл бұрын
Very true - it’s basically what the original GameObject/Component architecture does in an OO context. It’s just being taken to the extreme for optimization purposes now.
@warwolt
@warwolt 5 жыл бұрын
@@BoardToBitsGames And I think a certain distinction is that the Object owns it's data _and_ behaviour, whereas the encapsulation is opened up in ECS with behaviour in the system and data in the components, no?
@MountainKing123
@MountainKing123 2 жыл бұрын
It's not a data-driven dev process, it is data-oriented.
@CarlosDaniel-od7bx
@CarlosDaniel-od7bx Жыл бұрын
That’s why there is a drop in fps when you choose high population density in your games.
@mr.sunflower3461
@mr.sunflower3461 5 жыл бұрын
ecs is great for ai research :) cant wait
@mattetis
@mattetis 3 жыл бұрын
Why is that? 🤔
@Ne0mega
@Ne0mega 5 жыл бұрын
For ten years, I could not code. I always imagined how code must work, and in my mind, I always imagined an ECS system. OOP to me has never really made much sense. It always seemed so inefficient. I can code now, but still, I am always trying to make ECS like systems, (such as the AI I am working on). Part of that may be because I always imagined making strategy games. I never, have ever imagined making games with only a couple hundred entities calling the cpu/gpu at once.
@xwtek3505
@xwtek3505 3 жыл бұрын
You should learn OOP. You won't use it much to make game, but it's still useful elsewhere
@Ne0mega
@Ne0mega 3 жыл бұрын
@@xwtek3505 I already know OOP, and I don't care to code elsewhere.
@HiasHiasHias
@HiasHiasHias Жыл бұрын
Very good intro, but consider talking more slowly or at least adding subtitles!
@UrbanLetsPlay
@UrbanLetsPlay 3 жыл бұрын
i swear all the videos on ecs are just the same content with a different voice. Nothing useful here
@danielesquivel3155
@danielesquivel3155 3 жыл бұрын
calla Cagada
Entity Component System | Game Engine series
43:05
The Cherno
Рет қаралды 120 М.
How To Render 2 Million Objects At 120 FPS
14:57
Tarodev
Рет қаралды 135 М.
СҰЛТАН СҮЛЕЙМАНДАР | bayGUYS
24:46
bayGUYS
Рет қаралды 809 М.
КАХА и Джин 2
00:36
К-Media
Рет қаралды 4,2 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 29 МЛН
Подробный урок по Entity Component System в Unity
15:27
Insane One - Разработка игр
Рет қаралды 41 М.
Entity Component System (ECS) - Definition and Simple Implementation
28:02
Delegates, Events, Actions and Funcs - The Observer Pattern (Unity & C#)
11:48
Building a fast ECS on top of a slow ECS
8:03
UnitOfTime
Рет қаралды 25 М.
Entity Component System | Coding a 2D Game Engine in Java #10
30:52
GamesWithGabe
Рет қаралды 26 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 190 М.
Bob Nystrom - Is There More to Game Architecture than ECS?
23:06
Roguelike Celebration
Рет қаралды 189 М.
Выложил СВОЙ АЙФОН НА АВИТО #shorts
0:42
Дмитрий Левандовский
Рет қаралды 1,7 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 2 МЛН