How and Why to use a Component Based Architecture in your C# Unity Game

  Рет қаралды 5,070

Dapper Dino

Dapper Dino

Күн бұрын

Пікірлер: 11
@TheJaultman
@TheJaultman 6 жыл бұрын
This is amazing! I'm just beginning to make games, and I would never have realized I could do this, but it makes so much sense now that I know about it. Thanks for sharing!
@mosth8ed
@mosth8ed 6 жыл бұрын
Hey man, since you are already headed that direction with this, it would be awesome to see this as a "from scratch" ECS example doing the same thing but utilizing ECS for as much as possible with the same outcome. Thanks! -MH
@hipno3477
@hipno3477 6 жыл бұрын
Great tips! love these quick tutorials, very well paced and clearly explained. Keep it up
@cargorunnerUK
@cargorunnerUK 3 жыл бұрын
Another question I have is can you control the sequence that Unity calls the Awake or Start or Update functions? My game didn't work and that was because component1's awake method called a method in component2. There was no error message but component2 had NOT had it's Awake method called and so the game data was missing. I was expecting Unity 2020 to dynamically manage the awake calls at runtime. So when I try and use component2, Unity will stop and make sure the Awake method is called on component2 before executing a user defined method on component2. But this is NOT the case. This is very important in your component design - when you have a big component all your Awake functionality or Update functionality etc is in one place you can make sure it executes in a valid order. But when you have many small components I think your design must take into account that it has no idea the order in which the components will execute. I guess this is one of the reasons why people start to build high level manager/controller classes on top of their small components.
@RudolfJvVuuren
@RudolfJvVuuren 2 жыл бұрын
Interesting, thx!
@cargorunnerUK
@cargorunnerUK 3 жыл бұрын
Interesting video, but like the other videos on the subject it is only half the picture so is missing critical advice. Games are usually "world simulations" of varying complexity. So designing smaller and smaller isolated components seems intuitive and a good idea UNTIL you try and make your game work. This is why so many people ask for help as their component based code is getting really hacky and messy. So in your small component architecture design how do you suggest you implement score? When an enemy dies points should be awarded to the correct player. Where is this handled? The bullet? The enemy? The player? Or maybe you have an RPG and you have a sword script. But the damage it does may need to be affected by a crown that the player is wearing and a ring that the player is wearing. Where do you calculate sword damage? Or when a player is hit by an enemy the damage may need to be blocked by a shield component and then reduced by an armor component and also by a magic ring component and then reduced further by the currently active magic spell component. So how and where is the final damage actually calculated? We have all these isolated reusable components that know nothing about eachother.
@RudolfJvVuuren
@RudolfJvVuuren 2 жыл бұрын
Good insights, thanks for sharing.
@DarthMerlin
@DarthMerlin 5 жыл бұрын
If you use that DestroyOnCollision script, how do you prevent it from running and destroying the object before everything else has a chance to run?
@DoomCatcher
@DoomCatcher 2 жыл бұрын
Useful tutorial, when would you use this say vs using events, adding more events on collision rather than the examples you demonstrated?
@XZYSquare
@XZYSquare 6 жыл бұрын
These videos are cool. do you have any more on shader graph?
@WelshGuitarDude
@WelshGuitarDude 3 жыл бұрын
Thing is you end up having multiple components detecting collisions on one object thats not performant if you scale up.
Unity Tips and Tricks - Referencing Scripts
19:41
Dapper Dino
Рет қаралды 1,7 М.
How and Why to use Delegates in your C# Unity Game
16:55
Dapper Dino
Рет қаралды 9 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
I Remade Star Wars VFX in 1 Week
10:39
ErikDoesVFX
Рет қаралды 2,9 МЛН
Entity Component System Overview in 7 Minutes
7:21
Board To Bits Games
Рет қаралды 107 М.
How and Why to use the Generic Type T in your C# Unity Game
20:05
Software Architecture in Unity
7:13
Jason Storey
Рет қаралды 124 М.
Game Architecture Tips - Practical Uses Of Scriptable Objects
14:45
Unity Architecture - Composition or Inheritance?
16:24
Jason Weimann (GameDev)
Рет қаралды 74 М.
How To Build An Event System in Unity
8:01
Game Dev Guide
Рет қаралды 419 М.
Be CAREFUL with Scriptable Objects!
8:27
Code Monkey
Рет қаралды 87 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19