What You Need To Know About The COMMAND PATTERN
Вставка
- Опубліковано 10 бер 2022
- There are a ton of Code Design Patterns, and the Command Pattern is one of the most commonly used ones when it comes to games.
The obvious and most used example would be something like a Real Time Strategy game (like starcraft/warcraft/age of empires) where you can give your units a sequence of commands.
Another might be a Tactics game like Fire Emblem or Final Fantasy tactics or any turn based game really where you might want to record your actions or UNDO an action.
Other less obvious examples might be creating a messaging system for a multiplayer game between the server and client.
Or maybe handling monetary transactions where the sequence of events is critical.
Let me know in the comments what else you've used the Command Pattern before.
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
➤SUBSCRIBE to learn more about other design patterns as I cover them next!
➤Join our discord, I command you: / discord
Thanks for watching!
#bmo #gamedev #programming
I died when I saw the thumbnail 😂 Was waiting specifically for this one. Appreciate the high/medium level overview of something I always viewed as super hard
Thumbnail was hysterical.
Informative vid on difficult info
Bmo’s wish is my command 😊but seriously, informative vid and helpful concept! Not to mention that fire thumbnail 🔥
I thank you from bottom of my heart for this.
awesome thumbnail xD
well explainded on a simple example.
used the command-pattern too, in my first gamejam recently.
had a char being conrolled by commands.
added player-controller passing commands to char.
for ai i used same char with an ai-controller.
its just a very helpful pattern - also for other use-cases^^
something that no one seems to wanna talk about is how to do for this real time replays of nonturn based games. how do you guarantee that a command executed at say, 10 seconds into the game, will also execute at exactly the same time during the replay, what if the user has major slowdowns for whatever reason, how do you deal with floating point inacuracies? etc etc
Another banger as usual
Absolutely killing it!!!!
You've been on a tear with the content lately, bud!
Giving it a real try, we keep it goin
Thanks!
Congratulations for the tutorial. I think simple examples as that one you have used are the best choice to get the understanding of the core subject. Just let me ask you: why didn't you use the ICommand interface?
Hi! Please make more video on patterns in unity
Hey, I like your videos and your vibe - but I noticed something here that I'm not sure about. You are instantiating new commands in your update method. This seems incorrect to me. Is there something I am not understanding, or is there a better way to do that?
How could you implement a redo?
I got really confused at 2:14 when you said "its way more complicated..." - great video nevertheless
Haha yeah - meant it sounds way more complicated
And thanks!
Face 🔥
Bad implementation.