Command Pattern – Game Programming Patterns in Unity & C#

Check out the Course: https://bit.ly/3i7lLtH

——-

I’m doing a full series based on the book ‘game programming patterns’. It’s full of a lot of great gems including the command pattern. In this video I go over a few use cases and sample implementations of the command pattern in a Unity project and show some of the benefits (like the ability to undo/rewind time)

Inspired by Robert’s great book on Game Programming Patterns – https://amzn.to/2Ohg01Z

More Info: https://unity3d.college

Join the group: http://unity3d.group

Patreon: https://patreon.com/unity3dcollege

source by Jason Weimann

c# language

Mourad ELGORMA

Fondateur de summarynetworks, passionné des nouvelles technologies et des métiers de Réseautique , Master en réseaux et système de télécommunications. ,j’ai affaire à Pascal, Delphi, Java, MATLAB, php …Connaissance du protocole TCP / IP, des applications Ethernet, des WLAN …Planification, installation et dépannage de problèmes de réseau informatique……Installez, configurez et dépannez les périphériques Cisco IOS. Surveillez les performances du réseau et isolez les défaillances du réseau. VLANs, protocoles de routage (RIPv2, EIGRP, OSPF.)…..Manipuler des systèmes embarqués (matériel et logiciel ex: Beaglebone Black)…Linux (Ubuntu, kali, serveur Mandriva Fedora, …). Microsoft (Windows, Windows Server 2003). ……Paquet tracer, GNS3, VMware Workstation, Virtual Box, Filezilla (client / serveur), EasyPhp, serveur Wamp,Le système de gestion WORDPRESS………Installation des caméras de surveillance ( technologie hikvision DVR………..). ,

40 réflexions sur “Command Pattern – Game Programming Patterns in Unity & C#

  • juin 11, 2021 à 7:04
    Permalien

    I look forward to this series! I find commands to be really useful for splitting the "visual" (delayed) actions from the "logic" (computer usually knows if you have died before the animation is playing). You did touch on this in the "turn based" talk.
    I would love a series where you create a single minimal game with all of your structures and tips in place. Since it is when using multiple systems your setup really shines, avoiding the technical debt. Anyways, great video!

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Looking forward for more examples !
    And please, if you have a microphone try to record with mic, it may increase the quality of you voice.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    liked before the video started 🙂 . not disappointed. this will be a good series to watch . it was a bit on the fast side , and the sound quality is kind of low , otherwise it was perfect .

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    You should consider improving the sound quality. Content is top notch but the horrendous mic sound bogs it down.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Hi! I found your great channel! You are super cool! I really like your examples, that shows things in the most simple way.

    Noticed, that you overviewed a lot of features from new versions of Unity, but I think you missed a huge topic: Assembly Definitions.
    I tried them in my project, They works fine with my code. But what to do with plugins? Third party code? The problem is that if I using assembly definition files in project, then all code from 'Editor' folders would be in build. And now I must go through all 'Editor' folders, create .asmdef files and then reference all dependencies… It's annoying! Does anyone know tricks to avoid such thing?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    As a Junior developer, I'm looking forward to learn about of all the patterns that can be used out there. It would be really interesting to see, for example, a project built around Scriptable Objects to create systems (I didn't fully get the " Overthrowing the MonoBehaviour Tyranny" in Unite, despite looking very interesting), and making good Singletone Patterns (I discovered what they where when working in my first company and put me to work in a project full of null references of singletones, now I see them everywhere and I can't get out of my head that nagging feeling that something is going to crash at some point).

    Thank you for all your work, people like you make us, the rookies, learn how to do things the proper way.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Your videos are really excellent. Might not get as many views as some channels because the topics aren't as flashy or gimmicky, but they really do fill in the kinds of things that a REAL game designer needs to know.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    more examples would be great =) also, in your old style, as a small article on your site

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Thank you again for your unique contents. This topic is so underestimeted, especially from beginners.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Referred to your other video, in which you explained the differences between array, Lists, stack and so on, I would suggest to use a Stack for the CommandProcessor

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    I have a question
    If i become a programer i will be abe to design games ?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    So it seems to lead to an allocation of coomand class on heap in Update. At least use structures for such things.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Is this like packages like in in java where we can call one package in another package?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    I don't really understand how the magic behing the Transform property works in IEntity. For me, it seems like that transform merge with the transform of Monobehavior and any call to transform.position will modify the position of the gameobject in the scene? How do you explain that?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Hey Jason, pretty cool video.

    However I'm a bit bothered by the way you implement the MoveFromTo part. It feels wrong to have such a specific method in such an unspecific thing as a IEntity Interface. What it means to "move from to" should be entirely implemented inside the Command, and not inside the entity.

    I understand though why you did it this way: you don't have access to "startCoroutine" and "stopCoroutine" from within the context of your Command class (because it's not a monobehaviour). However this could be worked around very simply by using a singleton monobehaviour and do something like MySingletonMB.instance.StartCoroutine(MoveFromToCoroutine(from, to));

    Probably a bit advanced for the target audience, but I'm sure you will appreciate the beauty of this 😉

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    For me, only confusing thing is that In the first example, we don't need to original position of the player but In the second example we need it for Undo. Why?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Great video, thanks. Just for my own clarification, the object we are storing is the Vector3 direction, yes?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Top-notch content, thanks for creating such a great series.
    It would be great if you could create some abstract class diagram to understand the communications between classes and interface better thanks a lot.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    When you start watching and the Wikipedia page you have open features the castle from my home town… 😮

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Thanks, Jason, your tutorials are always great and helpful for me. Correct me if i am wrong I think the "Redo" method in the command processor will not work as it supposes to be since we already removed refrence to command we have pefromed "Undo" on it.

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    How would you go about implementing this pattern for a card game where the UI is event driven (for decoupling) and the actions are animated. For example, you discard a card with the DiscardCommand and the ui animates the discard. This command should not complete as long as the animation is running, but it is event driver so… Is it possible?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Cool video 🙂 Watched it second time just to refresh my memory of your example. You mention about some more deep example if we ask about it. So maybe time came to make video with more advanced implementation of this pattern, what do you think?

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    I have no idea, what do we need IEntity interface in the first place when we can achieve the same thing to depend on ClickToMoveEntity or Entity???

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Hey Jason! Does the book still holds up for nowadays? I'm genuinely curious about it

    Répondre
  • juin 11, 2021 à 7:04
    Permalien

    Business Opportunity in Ruvol

    I have invented a Board Game [still unpublished and not yet out in the market] that I believe is guaranteed to be as challenging and exciting as CHESS. I called it “RUVOL.”

    It is my hope that one day Ruvol may surpass chess as the “Number One Board Game in the World.”

    The weakness of chess is it always starts in fixed positions that the opening moves become “memorizable.” In fact, not a few have so mastered the moves that they can play against their opponents “blindfolded.” It is for this very reason that the great Bobby Fischer introduced his so-called “Fischer Random Chess,” where the starting position of the pieces is “randomized” to make the memorization of openings impracticable. Fortunately, it is also for this reason that I invented Ruvol where “every game” has been calculated to be a challenging one to play.

    HOW IS RUVOL PLAYED and HOW YOU CAN MONETIZE IT?

    I detailed everything in my YouTube video. Here is the link: https://www.youtube.com/watch?v=jcqth0m3-R0

    BIG MONEY POTENTIAL IN RUVOL!

    It is worthwhile to note that the people who play chess will be the same people who will play Ruvol. In my Google search, I learned there are around 800 million chess players in the world. Even just a small percentage of these 800 million is good enough to earn big money from Ruvol either as an ONLINE GAME BUSINESS or as a PHYSICAL PRODUCT DISTRIBUTOR.

    You may contact me at: rodolfovitangcol@gmail.com.

    Thanks and God bless!

    RODOLFO MARTIN VITANGCOL

    The Ruvol Inventor

    Répondre

Laisser un commentaire