The beauty of Entity Component System and Command Pattern

Entity Component System and Command Pattern

Entity Component System…

Recently I decided to use ECS (Entity Component System). I wanted to create RTS after many fails. Yeah, I tried so many times that I can’t even count. I love strategy games and I will create one someday. So the time for ECS came and I started to go deeper. I found it pretty useful and I started creating simple game for a programming compo. It’s the „Szalone Mikołaje 2” – here on github: https://github.com/Patys/Szalone-Mikolaje-2

Why…

I love it. I simply create some components. It will store data. Then systems. What they do? They take entities(boxes) filled with components (data) and do some things (algorithms).

And Command Pattern comes…

Ones I needed something which will help me fast create some entities in different places of code. I was searching and I found this: http://gameprogrammingpatterns.com/command.html This was exactly what I was looking for. It improved my code.

How to use it together…

So I have entities (boxes) filled with components (data) and systems (algorithms) process them. And here comes command pattern. I want to create new entity with some components and initialize them all with some values. I just use command and done.

Next…

I will create a technical tutorial about using it later. (I hope)

But for now, see you 🙂

Programista? Tak. Specjalista od blockchain? Tak. Przynajmniej sam tak uważa. Programuje i tworzy własną kryptowalutę na blogu. Realizuje pomysły i projekty. Nie narzeka i walczy o swoje. Chce być najlepszym programistą. Tworzył aplikację do konsultacji wideo. Wszystko płatne w krypto: Experty Teraz jest programistą w Netguru. Najszybciej rozwijająca się firmą w Europie. Programuje z najlepszymi i stara im się dorównać. Podróżuje z marzeniami o byciu ekspertem i blogerem. Od czegoś jednak trzeba zacząć. Od zapału, zajawki, pomysłu. Od dzisiaj.

Please follow and like us:
0

1
Dodaj komentarz

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Tim Recent comment authors
  Subscribe  
najnowszy najstarszy oceniany
Powiadom o
Tim
Gość
Tim

Yeah that are really great patterns. Sadly UE4 is somehow mixes class hierarchies but they added a component concept for using composition over inheritance. I think unity does a better job there but did not use this engine.

Well I’m looking forward for your tutorial.
Keep on coding!
Tim