The Most Common Mistake Beginners Make in Unreal Engine | UE5

2024 ж. 28 Сәу.
75 032 Рет қаралды

The Observer Pattern:
Software Design Patterns are like a manual on how to write good code, whether you're using Blueprints or C++, knowing good software practices is a MUST!
I hope this first video in the series gives you a good intro on what design patterns are and how the observer design pattern can be used.
This will be done through the use of "Event Dispatchers". Event dispatchers in unreal engine use delegates, which are an implementation of the pub/sub (observer) pattern.
Through blueprints, event dispatchers are available, but have certain limitations that will be touched upon in this series
Download the project files and support my channel on Patreon
/ alizoh
Join my Discord server to chat and mingle with the community
/ discord
Additional Resources:
refactoring.guru/design-patte...
gameprogrammingpatterns.com/o...
docs.unrealengine.com/5.2/en-...
Chapters:
00:00 The Problem
00:24 Background Context
00:49 The Mistake
01:38 The Observer Pattern
02:49 The Publisher
04:05 The First Subscriber
07:11 The Second Subscriber
10:19 Summary
11:00 The Benefits
11:40 Coming Soon
About me:
I've been learning game development for a few years now, I have a background in software engineering, and I also have a background in education, so being able to combine my love of gaming, software engineering and education is the best way to spend my time.
I am currently working on a few unreal engine games as a hobby, but I am also trying to build a community, thus I am creating KZhead tutorials to find others who are interested in game development and design.
#unrealengine5 #observerPattern #tutorial #unrealengine #ue5 #gamedev #softwaredesign #software #designpatterns #cleancode

Пікірлер
  • This is the kind of tutorials youtube needs more of! You actually explain conecepts, instead of just telling your viewers to copy paste some code with no explanation. I don't leave comments often, but you definitely deserve it.

    @peppastone@peppastoneАй бұрын
    • Thank you so much for your kind words! I really appreciate your support and I'm glad you find my tutorials helpful and informative. Your feedback means a lot to me.

      @AliElZoheiry@AliElZoheiryАй бұрын
    • I literally came down here to write the same sentiment. Thank you!

      @sgtpeppr778@sgtpeppr778Ай бұрын
    • Here to say the same, this is a really great video and i'm excited to see more in the series. Started watching this channel to start learning some basic AI stuff, but this kind of content I will absolutely love to see.

      @reede140@reede14011 күн бұрын
  • You are an ABSOLUTE SAINT for actually explaining where concepts can be used for actual functionality in the engine instead of just showing people how to make a shiny looking functionality. God bless you man.

    @swarnavadas5461@swarnavadas546111 күн бұрын
    • Thank you! I appreciate your kind words and I'm glad you find my explanations helpful.

      @AliElZoheiry@AliElZoheiry9 күн бұрын
  • It's almost uncanny how you described my exact method for this at the beginning. Thanks a lot for not just teaching solutions to problems, but teaching more efficient workflows and good practices while you're doing so. It might be more work up front but it absolutely pays off!

    @perochialjoe@perochialjoe2 ай бұрын
    • What's uncanny is his eyes bro is seeing into my future

      @maxten1463@maxten14632 ай бұрын
    • Thank you @@perochialjoe I'm really happy that you see the value in what I do. I truly try to teach how to become a proper developer instead of just how to copy and paste code. Glad that you find it helpful. Thanks for watching and commenting ☺️🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • Hahah thanks @maxten1463 ☺️

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I dont leave comments often, but just wanted to say that your tutorials are easy to follow, and I enjoy watching them! Youre doing a great job!

    @EdenPresents@EdenPresents2 ай бұрын
    • Hey Eden, thanks so much for watching and commenting. I'm really glad you found this useful 🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Something you could add to avoid hard references to actors (like you have currently) is handling dispatchers in actor components. In that way you can have a reference to a generic character instead, get component by class, bind to onDeath that is ran in the component. Hard references should be avoided when possible because otherwise you will always have the entire enemy class and all its dependencies in memory whenever the Widget is in memory. Maybe its too much for one lesson, but i think it would be better to not teach hard references. I think these types of videos are badly needed and i hope you will make many more in the future. Excellent presentation and easy to follow.

    @Wrexthor@Wrexthor2 ай бұрын
    • I like how you think! You're indeed one step ahead of the rest ;) My plan is to cover actor components when I talk about the component design pattern, and show how it relates to the observer pattern as well. The result would be very similar to what you described, and one of the benefits is indeed runtime "soft" references that can be garbage collected easily

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • wow I need a tutorial about this. Soft references + using dispatchers inside components

      @carlosrivadulla8903@carlosrivadulla89032 ай бұрын
    • @@AliElZoheiry if you're going for "soft" references, I would advise using interfaces instead. this way you could simply add an IKillable interface, that describes an event you can bind to. you can implement multiple interfaces, so at runtime you could check if the IKillable could be cast to another interface that knows whether or not it's an enemy.

      @jackie.p6891@jackie.p68912 ай бұрын
    • Hey@@jackie.p6891 Thanks for the suggestion, a lot of people seem to be confused about this. I would definitely add event dispatchers in an interface if possible, but in blueprints, that's just not possible. To bind to an event of a class, you need a reference to that exact class, an interface reference isn't enough because you CAN'T add event dispatcher definitions in an interface. In the next lesson though, as I mentioned, I will be going over the mediator pattern to create an event manager which will remove references all together, both hard or soft

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • @@AliElZoheiry Oh, my bad. I've been a programmer for years, but am pretty new to Unreal. Seems weird to me that you can't add event dispatchers in an interface. anyway, nice video, I'll definitely check out the next one!

      @jackie.p6891@jackie.p68912 ай бұрын
  • This is the kind of UE tutorial video I've been searching for for years! It's so much easier to understand concepts and retain that kind of information when it's described and showcased in this way. Excellent work!

    @chantalduxfield@chantalduxfieldАй бұрын
    • Thank you for your kind words! I'm thrilled to hear that you found the tutorial helpful and easy to understand. I aim to make complex concepts more accessible and it's rewarding to know that it's making a difference for you! Keep watching for more helpful content in the future.

      @AliElZoheiry@AliElZoheiryАй бұрын
  • In Unreal 5.2 and up, You can also just call interface functions on the overlapping or hitting actor. The enemy calls the player when hit and dead, the player calls the interface function for the door, when no more actors of class exist each time an enemy dead event is called. There are many ways of creating in Unreal with the new interface functionality. I’d say use interfaces to generate blueprints fast, and when working you can refactor to use proper patterns

    @jomesias@jomesias2 ай бұрын
    • Interfaces are not new to 5.2. Epic has been recommending using Blueprint Interfaces for years and years because the hard reference created by a Blueprint cast can be extremely costly memory wise.

      @Fafhrd42@Fafhrd422 ай бұрын
    • Unfortunately blueprint interfaces don't support having event dispatchers in there. So you would always need the exact reference to the class to bind to an event from it. And even if interfaces supported event dispatchers, you would still need a reference to some class that implements this interface to bind to it

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • @@AliElZoheiry Technically, you just need a reference to the actors that implement the interface, not their class (and you can use 'Get All Actors With Interface' to get the actors at run time). I believe it's also possible to define delegates in a native UInterface class, and set them up so they can be bound in Blueprint, but I haven't tried it.

      @Fafhrd42@Fafhrd422 ай бұрын
    • @@Fafhrd42 cool! Sounds awesome, that get all actors with interface must be costly too though :( Like I stated in my initial comment: use interfaces for prototyping fast, then when that works think about refactoring and changing it to use design patterns.

      @jomesias@jomesias2 ай бұрын
    • @@AliElZoheiry correct, I personally use the hit or overlap events for the interactive part. (The collision system part that is) So I have both the overlapping and overlapped (and hitting) objects available in those events. So it’s no biggie. If you will use another way of hitting actors (like Multi trace sphere let’s say) you’ll also have the reference to them, so it works out with interfaces just fine too! It’s all about advantages and disadvantages of each method 😁 cheers fellow Game devs

      @jomesias@jomesias2 ай бұрын
  • I've watched a few of your videos, and many others of others. And I have to say I am really looking forward to this series. The way you explain your code and the design patterns within it are some of the best ive seen on youtube.

    @MichaelDavis-nu3sz@MichaelDavis-nu3sz2 ай бұрын
    • Thank you Michael, real glad you found it useful 🙏☺️

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • This is really kind of UE related content I've been looking for. Actually I'm pretty sure you did some kind of poll while ago or something and I was mentioning back then, that THIS kind of videos or tutorials or explanations is what I'm missing. I can't say I'm struggling, but there are times when I'm discussing my approach of designing some systems with experienced programmers. Thank you for this and I'm looking for more of this.

    @realarchanger@realarchanger2 ай бұрын
    • Hey there, thanks a lot for the feedback, I did indeed make this tutorial based on community polls and feedback, so if you participated in those, then thank you so much, you're the reason for this kind of content 🙏 and I'm really glad you see the value in it. I'll definitely keep em coming

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Love these videos that resolve bad practices from other youtubers, amazing!

    @juggernautx1779@juggernautx17792 ай бұрын
    • Thank you so much for your comment 😊🙏 I do indeed try my best to showcase good practices so that people don't end up with a mess and not know why. Glad you see the value in that

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • My mind is blown how clean and easy someone is explaining that! You are a gem in all these Unreal tutorial channels. This is a real learning lesson and not just ''look at me how I did that and try to copy''. This is awesome.

    @Daniel-sn5se@Daniel-sn5se17 күн бұрын
    • Thank you so much for your incredibly kind words! I'm happy to hear that you find my tutorials helpful and valuable. Your support means a lot to me! Keep learning and creating amazing things in Unreal Engine!

      @AliElZoheiry@AliElZoheiry15 күн бұрын
  • Hands down best tutorial I've watched so far in my early UE5 journey. You explain everything so well. The first video I didn't have to pause and rewatch 100 times.

    @Butter007@Butter007Ай бұрын
    • Thank you so much for your encouraging feedback! I'm delighted to hear that the tutorial was helpful for you as you start your journey with UE5. Your appreciation means a lot!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Thank you. Your Tutorials are sooooooooooo good. I was trying to figure out how to deal with this exact problem and didn't realise UE5 already had built in features for it. Please keep making tutorials on 'best practices' for common programming problems like this. They're super valuable.

    @chickenmadness1732@chickenmadness1732Күн бұрын
  • Your tutorials are great! Im switching from Unity to Unreal and it really helps to re learn the basics. Keep it up and thank you!

    @ERBaruin@ERBaruin2 ай бұрын
    • You're very welcome 🤗 really glad to hear that! In Unity it's much easier to find these kinds of tutorials since there's so much info on good C# programming, but it's a lot harder in Unreal's proprietary blueprints, so I'm glad to be filling that gap 🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Very nice video. I look forward to see the upcoming ones because I find it very interesting to learn how to use Software Design Patterns in Unreal/Game Dev for better code and which ones to use. Also very good explanied. Love your videos. :3

    @revan9903@revan990327 күн бұрын
    • Thank you for your comment and your support! I will definitely create more design pattern tutorials. Glad you're finding the content helpful! 😊

      @AliElZoheiry@AliElZoheiry27 күн бұрын
  • Clear communication and explanation.. Great job Ali.. keep going man

    @spyxx@spyxx2 ай бұрын
    • Thanks so much 😊🙏 I'll definitely keep em coming

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • WOW I am currently working on a remaining players display, and see this video in my feed, But Your tutorial style is perfect and clear and fully explained, and not just a do this BUT also WHY! :) subscribed !

    @BaseRealityVR@BaseRealityVR2 ай бұрын
    • Thank you for the kind words and for subscribing! I'm glad you find the tutorials helpful and explanatory. Good luck with your remaining players display project!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • That was fantastic. I've watched several tutorials, including paid udemy tutorials to get my head around event dispatchers and none of them made sense to me. But you explained it to clearly with such great examples AND didn't just go over which nodes to use, but also why! Thank you! Instantly subscribed.

    @Zeis@ZeisАй бұрын
    • I really appreciate your kind words! Glad you found it useful 🙏😊

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Great video man. Im learning UE5 blueprints and the way you explain stuff is great, clear and smooth. Also great advice to avoid problems later on. Thank you and keep up the good work.

    @legotimebombshorts4231@legotimebombshorts4231Ай бұрын
    • Thank you so much for your thoughtful comment! I'm really pleased to hear that you found the video helpful and my explanations clear. I'll definitely keep it up, thanks for your support!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • I feel like this is one of the best unreal guides ive seen, really like it man thanks

    @maskn7208@maskn720829 күн бұрын
    • Thank you so much for your kind words and feedback! I'm happy to hear that you found the guide helpful. If you have any more questions or need further assistance, feel free to reach out!

      @AliElZoheiry@AliElZoheiry27 күн бұрын
  • This is probably the best explanation on not just how, but also and more importantly, WHEN to use event dispatchers I have ever seen. I find a lot of videos for UE BP skip over the why in favor of the how and it drives me nuts. Sure it's just visual scripting. Except logic is still applied making the concepts, or "the why", still just as important. Without the why things like tick or delay get abused. Good stuff you gained a sub!

    @hardwire666too@hardwire666too2 ай бұрын
    • Thank you so much for the kind words! I'm really glad you found the explanation helpful. Understanding not just the how but also the why behind these concepts is crucial indeed for building scalable games. Welcome to the community, and I appreciate the support!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Greate explanation, easy to follow and actually understand the concept of observer patterns. Kudos! 🏆

    @janschrader8048@janschrader8048Ай бұрын
    • Thank you so much for the support Jan Schrader! I really appreciate it 😊🙏 I'm happy you found this useful

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Great video, I'm really looking forward to this series because sometimes I struggle to figure out how design patterns translate to BPs. Thanks!

    @blackshinobi956@blackshinobi9562 ай бұрын
    • Thank you! Glad you're finding these topics useful 🙏 I wasn't sure either in the beginning if this was going to be interesting for people but it seems there is a need for this type of content indeed

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • This is such a great concise explanation of how Event Dispatcher is like the Observer Pattern. I was "pretty sure" that is what it was used for before this video, but now I am very sure.

    @EHLarson@EHLarson2 ай бұрын
    • Awesome! Glad it helped you gain confidence in your knowledge. I will be expanding on this pattern in later videos to make it even more performant and efficient

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Man, what an amazing video!! I just found your channel and I already subscribed, incredible work, and thank you for sharing it!

    @gulliverwaldmann393@gulliverwaldmann39323 күн бұрын
    • Thank you so much for your kind words and for subscribing! I'm really glad you enjoyed the video and found it helpful. Welcome to the channel, and I look forward to sharing more content with you in the future!

      @AliElZoheiry@AliElZoheiry21 күн бұрын
  • one of the best Unreal training videos….very clear, very focused, superb example

    @soadindakhor3932@soadindakhor3932Ай бұрын
    • Thank you so much for your kind words and support! I'm happy to hear that you found the video helpful and engaging. Your feedback means a lot to me 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Great tutorial, been looking for more methods of decoupling to ensure best practices!

    @sinksinkswim@sinksinkswim2 ай бұрын
    • Thank you for the feedback! I'm glad you found the tutorial helpful in understanding decoupling methods for best practices. If you have any more specific topics you'd like to see in future tutorials, feel free to share your suggestions!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thanks for creating tutorials that go beyond beginner subjects.

    @ptcmia@ptcmia2 ай бұрын
    • Thank you! I'm glad you appreciate the more advanced topics. Always striving to provide valuable content for learners at all levels.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I'm very new to a lot of Unreal Engine 5 and working within its BPs. It's safe to say that I don't entirely understand everything here, but I do want to comment on the fact you explain things very eloquently and also mention examples of why this "Publisher + Subscriber," or "Caller + Listener," pattern is VERY practical and resource efficient. I'm definitely subscribed and hoping that I'll be able to understand a lot of this in the near future. Haha. Thank you for this!

    @JairusC@JairusC2 ай бұрын
    • Thank you for watching and commenting ☺️🙏 really glad you found my teaching style helpful, I do put a lot of time and effort into making sure that things make sense before I hit that record button. glad you see the value in that.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • This was a very well done explanation and illustration, thank you!!

    @linux_master_race@linux_master_race17 күн бұрын
    • Thank you so much for your kind words! I'm glad it was helpful. Keep an eye out for more content in the future.

      @AliElZoheiry@AliElZoheiry15 күн бұрын
  • Best channel on youtube for UE5! Thanks for great content!

    @kenellsweden@kenellswedenАй бұрын
    • Thank you so much for your kind words! I'm glad you're finding the content valuable. Your support means a lot! 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • I asked somehting along these lines in discord a few weeks ago, its still been a bit of a problem. Now you made the perfect video! Thanks a lot.

    @weikor6545@weikor65452 ай бұрын
    • That's awesome to hear! I do take all feedback into consideration when making a new video, so it could have very well been your question that led to this video. Glad you found it helpful 😀🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great video, thank you for covering good coding practices and patterns!

    @roguepithlit@roguepithlit2 ай бұрын
    • Thank you! I'm always excited when I hear that someone sees the value of good coding practices! Thanks for watching and commenting ☺️🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Such a concise and informative tutorial. Really helps me a lot. Can’t wait to see more content like this.

    @GameTourist491@GameTourist491Ай бұрын
    • Thank you for your kind words! I'm thrilled to hear that you found the tutorial helpful. Stay tuned for more content like this in the future! 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Thanks for the tutorial! Ive been looking for a way to include a remaining enemy counter for my retro shooter and this will work perfectly

    @crisppxls@crisppxls7 күн бұрын
    • You're welcome! I'm glad you found the tutorial helpful for your retro shooter. Good luck with implementing the remaining enemy counter!

      @AliElZoheiry@AliElZoheiry2 күн бұрын
  • This was great tutorial very well taught with easy to follow instructions and descriptions that help you to really learn what is being taught. I have learned about event dispatchers already but this made them more understandable to me.

    @oscblade1691@oscblade169122 күн бұрын
    • Thank you so much for your kind words! It's happy to hear that the tutorial helped you gain a deeper understanding of event dispatchers. I'm really glad you found it useful.

      @AliElZoheiry@AliElZoheiry21 күн бұрын
    • @@AliElZoheiry I know this has nothing to do with your tutorial but I am working on a project and I am running into a issue I can not find a solution to. I have been asking around to find a solution but have not got an answer yet. Anyways I am making a character that can either be in third person or sidescroller with a camera on the right side. I have it with a enum that lets you switch between which camera is in use. I also have the code where you can switch between being able to move everywhere or just on the x axis. However, I can not seem to figure out how to activate the y constraint in code only when I set the player to sidescroller. If you have a answer for this that would be great if not no issues. Thanks again for this tutorial I have already watched another video and plan to go through more of your videos here soon.

      @oscblade1691@oscblade169121 күн бұрын
    • Hey @@oscblade1691 Unfortunately I've never done sidescrolling in unreal engine, so I'm not sure what the issue is :(

      @AliElZoheiry@AliElZoheiry20 күн бұрын
    • @@AliElZoheiry that's fine thanks for replying

      @oscblade1691@oscblade169120 күн бұрын
  • Your tutorials is next level. Cant understand why you dont have x10 subs. You like Brackeys but in Unreal. Keep going!

    @simonasstonys3844@simonasstonys384416 күн бұрын
    • Thank you so much for the kind words and the comparison to Brackeys! I'm thrilled that you found the tutorials helpful, and I genuinely appreciate your support. Keep creating!

      @AliElZoheiry@AliElZoheiry15 күн бұрын
  • Hello from France ! After 6 months of learning C++, I'm on learning UE5 learning journey for 1 month and a half, I just worked myself through Blueprint Interfaces to communicate between Target, Trigger, via Gamemode in my little practice aim game. I had a hard time understanding how casting works even though it seems so simple ! Your video is so clear, gave me few tools and opened my mind on some aspects, I will look for more about your work for sure, thank you very much Ali ! +, just the way you drag nodes effortlessly to align them shows a lot how many hours you may had been practiced UE lol Thanks for your time if you read that :)

    @13romor@13romor2 ай бұрын
    • Hey there, Thank you so much for your kind words and feedback! I'm really glad to hear that the video was helpful and that you found it insightful. Keep up the great work on your UE5 journey, and feel free to explore more of my content as you continue to learn. And yes, the hours spent practicing UE have definitely added up! Stay connected and all the best with your learning endeavors!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Amazing tutorial again. One of the better channels for all type of tutorials on youtube for sure

    @ProxyRushSc2@ProxyRushSc22 ай бұрын
    • Thank you so much for the kind words! I'm really glad to hear that you find my tutorials helpful. Your support means a lot to me!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I so needed to watch this yesterday. My work today needed this.

    @PedroOliveira-sl6nw@PedroOliveira-sl6nw2 ай бұрын
    • There is always time to refactor ;)

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I'm intrigued, why would interfaces not be better for this? Wouldn't an interface send the same message to the blueprint and is actually easier to implement and to include other blueprints in the system? Especially if you have tens of thousands of actors.

    @waw4428@waw44282 ай бұрын
    • Same. 😅

      @RenegadeRukus@RenegadeRukus2 ай бұрын
    • I believe there is some confusion between interfaces and event dispatchers. An interface on its own doesn't really do anything. It simply describes what functions a class should implement to be considered an instance of that interface. It has nothing to do with the observer pattern which is based on 1-to-many communication between subjects and objects. In classical C++ the interface can also describe what events a class is publishing, which would have been helpful in blueprints. Meaning you would use interfaces as an additional layer between the publisher and subscriber but not as a replacement. Unfortunately that doesn't exist in blueprints though

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • dude I love how you explain things, great job!

    @VRDivision@VRDivisionАй бұрын
    • Thank you so much for your kind words! I'm really glad you appreciate the way I explain things.

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Nothing new but explanation is clear and coherent. I wish somebody told me all this when I only started to learn UE. Good work!

    @artkalm@artkalmАй бұрын
    • Thank you for the positive feedback! I'm glad to hear you found the explanation helpful. It's always great to know that my content is providing valuable insights to new learners.

      @AliElZoheiry@AliElZoheiryАй бұрын
  • This was really interesting! Thank you for making this video!

    @ssnightshadow@ssnightshadowАй бұрын
    • You’re very welcome! Glad you found it useful 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Bro this is pure gold. Thx for sharing.

    @williamlacrosse9389@williamlacrosse9389Ай бұрын
    • Hey! Thank you for your support and kind words, I'm glad you found the content valuable!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Awesome content! Glad I stumbled on this; very direct and clear presentation my friend

    @extendedblundering@extendedblundering2 ай бұрын
    • Thank you! I'm so glad you found the content helpful. If there's anything specific you'd like to see in the future, feel free to let me know.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great tutorial, enjoyed every second of it! Thanks!

    @RubaDev@RubaDevАй бұрын
    • Thank you for the kind words! I'm glad you found the tutorial helpful and enjoyed it. You're very welcome!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Very good video. I knew the observer pattern, but not how to do it in UE. Thank you! Excellent example too.

    @raisgamesnz325@raisgamesnz3252 ай бұрын
    • My pleasure 😊🙏 glad you found it useful

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Oh would you look at that! Recently i wanted to use something like this, i was sure that the dispatchers did something like this, but I just didn't know how to actually use them. Thanks! Amazing tutorial ❤

    @palvelusmusic@palvelusmusicАй бұрын
    • Hey, I'm glad the tutorial helped you out! Dispatchers can be tricky at first, but once you get the hang of them, they're super useful. Good luck with your project! 😊

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Very good information! I used interfaces a lot, but as you mentioned, I created unneccesary dependencies as I needed references when calling interfaced functions. Thanks! Time to rewrite interactions!

    @Multiblitzyy@MultiblitzyyАй бұрын
    • Glad you found the information helpful! Rewriting interactions to reduce unnecessary dependencies can make a big difference in the long run. Good luck with the changes!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • As always your tutorials are super useful! Thanks a lot Ali.

    @projectvikingdevdiary36@projectvikingdevdiary362 ай бұрын
    • Thank you for watching and commenting, glad you found it useful 🙏☺️

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • more design patterns and approaches please! great video 😁

    @yvettenaomi3870@yvettenaomi38702 ай бұрын
    • Glad you found this useful 😊🙏 I'll definitely keep em coming

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thank you so much!! I always saw the usual tutorials and I thought "there is no way I should reference other actors for everything. There has to be a better way" and yes there is. Now I know how to make a light turn green when I deposit an item quest.

    @libertarianterminator@libertarianterminatorАй бұрын
    • You're very welcome! I'm happy to hear that the tutorial was insightful for you. If you have any more questions or ideas, feel free to share them!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • really loved this video brother, may Allah reward you. Rather than giving code you actually gave a pattern that we can use and fill the code in our selfs.

    @Zero-bg2vr@Zero-bg2vrАй бұрын
    • Thank you my friend 🙏 that's exactly what I meant to do, teach you to code instead of teaching you to copy code 😊

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Super informative, thank you!

    @justpeachyrl@justpeachyrlАй бұрын
    • You're very welcome! I appreciate your positive feedback and I'm glad you found it informative.

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Excellent! Subscribed and will be watching all your vids. Thanks.

    @truespiritualmeditation@truespiritualmeditationАй бұрын
    • Thank you for subscribing! I'm glad you found the content helpful and hope you enjoy the upcoming videos. Stay tuned for more useful content!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Simply Awesome ... the technique and the teacher! Thanks bro. A great help. Follow with this serie.

    @isoverdg@isoverdg2 ай бұрын
    • Hey, thanks for the kind words! I'm thrilled that you're finding the series helpful. Stay tuned for more great content!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I often find that the most difficult part of learning this engine is just how exactly to go about things and the best practices. Stuff like this really helps bring clarity. I mean, even if I can figure out what an individual feature does, It is still very difficult trying to work out exactly how, or more specifically, when, to use it. Never understood event dispatchers, or that little red box at the top right. Always get confused with most of the tutorials covering them, or they just seem to be missing something. This was really well done, and many things started to click. Only issues now are knowing how to use all the other options besides just call and bind that the event dispatcher has. When should I unbind, and when to use dispatcher over other things; Lets say for example, over interfaces. I suppose sense this is for observing when something happens, interfaces are just more for when you actually interact with things more directly. Like communicating to the button you are pressing, or the gun trigger you are pulling without specifically targeting a specific one. At least that is where my head is on it for now.

    @merccc1@merccc120 күн бұрын
    • Hey there, I totally get where you're coming from, Unreal Engine can be quite overwhelming at times. Event dispatchers and interfaces can be a bit tricky to grasp initially, but essentially event dispatchers are great for signaling when something happens, while interfaces are more about direct interaction. Knowing when to unbind and when to use dispatchers over other options does indeed require a deeper understanding of the context and specific needs of your project. Glad to hear that things are starting to click for you, keep at it!

      @AliElZoheiry@AliElZoheiry20 күн бұрын
  • Helpful stuff bro, hope to see more. (Anything VR related would be awesome). Much love brother.

    @FollowTheFreeman@FollowTheFreeman2 ай бұрын
    • Thanks for the feedback and support, really appreciate it! I'll definitely keep it in mind and work on some VR-related content for the future. Much love to you too!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Excellent tutorial. Anyone could understand this the way you explained it.

    @PatrickTheDM@PatrickTheDM2 ай бұрын
    • Thank you! Really glad my teaching style resonates with you. I do put a lot of effort into making things as streamlined as possible ☺️🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • THIS right here is high quality teaching!! not a copy and paste video, ironically considering the topic; Software design pattern

    @ThatGhostsHost@ThatGhostsHost2 ай бұрын
    • Thank you so much for the kind words! I'm really glad to hear that you appreciate the depth of the content and my teaching approach. Your feedback means a lot to me.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thank you for sharing; Very useful information; Will continue to follow this series; Really enjoy this format; Looking forward to the next one; I am in need of a mentor; Considering on becoming an Apprentice in the future!🤙

    @WilliamElliottBeverlyIV@WilliamElliottBeverlyIV2 ай бұрын
    • You're very welcome. Thank you for your feedback, glad it was helpful. Feel free to reach out if you need any more info

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Very easy to follow! Fantastic job.

    @catryfieln2047@catryfieln20472 ай бұрын
    • Thank you so much! I'm glad you found it easy to follow. Appreciate the feedback!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • I knew it was correct to use Event Dispatchers I just didn't know why. Coupling and the ramifications down stream. Thanks for clearing that up for me.

    @chomnansaedan4788@chomnansaedan4788Ай бұрын
    • Glad to be of service! Thanks for watching 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Fantastic explanation Ali, thank you.

    @brandonvanharen2552@brandonvanharen25522 ай бұрын
    • Thank you Brandon 🙏😊 Glad you found it helpful

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • A great tutorial!!, but there is a little adjustment that I would add to make it much better: instead of dispatching an event from the enemy, 1- I would create my own GameInstance class, and this can be referenced from anywhere. 2- Now in my GameInstance class, I would add the event dispatcher that you added in the enemy 3- in the enemy, call the GameInstance event that you added 4- in the widget, just reference the GameInstance, and bind to the event the benefit: you won't need to iterate all enemies to bind so many events (consider the worst case scenario of having thousands of enemies where you will have thousands of binds). Regards!!

    @3dsakr@3dsakr2 ай бұрын
    • The game instance should only contain stuff that is necessary to "survive" level switches. Using interfaces is the best way. But in the end it doesnt really matter, as long as you are happy with it. :D

      @ByteShock@ByteShock2 ай бұрын
    • Hey 3dsakr, what you're describing is an attempt at creating the observer pattern with an event bus, which unfortunately doesn't have native support in blueprints. I will be going over a custom implementation you can use to create an event bus and prevent these hard references, but first I wanted to explain the "simple" concept first.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • @@ByteShock You still use interfaces. Just between the gameinstances and widget instead of enemy instances and the widget. This avoids hard references.

      @xForseen@xForseen2 ай бұрын
  • Great tutorial! Thank you very much. For the example you provided, I think that using the loop and bind event in multiple places might not align with best practices. I'd suggest using bind Event and the loop in single location, such as the Game Mode or Level Blueprint. This way, all necessary actions triggered by an enemy's death, like opening a door or increasing the score, can be handled in one place. I think it helps maintain best practices. Please correct me if I'm mistaken. Also, the Unreal Engine community greatly benefits from such great tutorials. Your direct and simplified approach is fantastic, and I hope you continue sharing more!

    @Hamad_S@Hamad_S2 ай бұрын
    • Hey Hamad, great catch! That is indeed not the final implementation, what you're suggesting is the observer pattern using an "Event Manager" (or event bus), and that is the topic of next lesson. "The mediator pattern", using the mediator pattern, we can implement an event manager that both the publisher and subscriber talk to, thus removing all references and loops. You're already 1 step ahead ;)

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • @@AliElZoheiry Can't wait for the next lesson! Thank you very much.

      @Hamad_S@Hamad_SАй бұрын
  • This is awesome please keep giving more knowledge on making great games.

    @sumeetmahakud@sumeetmahakud2 ай бұрын
    • Will do 😊🙏 glad you found it useful

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • you my friend explained this flawlessly thank you

    @TheAntonio322@TheAntonio3222 ай бұрын
    • You're very welcome! I'm glad you found the explanation helpful. Thank you for your comment!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • This is awesome! Thank you

    @Patrik38cz@Patrik38czАй бұрын
    • Thank you for your comment! I'm glad you found it helpful 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Amezing.. Designer patterns tutorial series in game dev ...absolute insane :) very hard topic to explain in a way everyone can follow along .. absolute amezing and can not wait for the upcomming patterns :) absolute amezing work :)

    @shadowtjnl@shadowtjnl2 ай бұрын
    • Thank you so much for your comment 😊🙏 glad you found this helpful. I'll definitely be making more

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thanks a lot. Very useful guide and tips.

    @pavelvorobev4920@pavelvorobev4920Ай бұрын
    • You're very welcome! I'm glad you found it helpful. Thank you for watching and commenting 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Thank you for sharing!!

    @joshua42777@joshua427772 ай бұрын
    • My pleasure 😊🙏 thanks for watching and commenting

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great tutorial, i will be waiting for the rest of the videos

    @yasser-_-4202@yasser-_-42022 ай бұрын
    • Thank you for your support! I'm glad to hear that you enjoyed the tutorial. More videos are in the works, stay tuned! 🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Could be super nice a serie about the good way of taking objects like swords, spells... etc, how to save them in a bag or whatever, organize them and combine it with the last serie. Thanks! U're awesome!

    @pisoleto@pisoleto2 ай бұрын
    • Hey! Thank you for the suggestion! I'll definitely consider creating a series about managing and organizing objects like swords and spells in a bag or inventory, and how to combine it with the existing series. Your support means a lot!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thank you very much for the tutorial, it would be great if you could create a series of design patterns applied to Unreal Engine since you explained this video in a perfectly understandable way. Thanks again.

    @NootRellik@NootRellik2 ай бұрын
    • Hey there! Thank you for watching and for your support! This series is indeed going to be about design patterns in unreal engine, stay tuned for more videos ;)

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Love it... You´re the best! 🙌🙌🙌

    @Eu.Claire@Eu.Claire2 ай бұрын
    • Thank you! Glad you found it helpful 🙏 always appreciate the comments

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • exactly the kind of thing I want to know, thanks!

    @DidierMichaud92@DidierMichaud922 ай бұрын
    • Really happy to hear that. Thank you for watching and commenting ☺️🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great tutorial thank you!

    @EFX612@EFX612Ай бұрын
    • You're very welcome! I'm glad you found it helpful. Thank you for watching and commenting 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • One thing to note, you don't want to decrement your enemy count variable because it can change if new enemies spawn. It's better to always get all enemies because the performance hit is negligible or have another dispatcher increase count when enemies spawn.

    @YoutubeAccountMan@YoutubeAccountMan27 күн бұрын
    • Thanks for the suggestion. In the next video in this series I tackled the issue of spawning enemies as well as killing them, make sure to check it out if you want to see how it's done

      @AliElZoheiry@AliElZoheiry27 күн бұрын
  • Great explenation. i have just subscribed as i feel like i will learn a lot . Thank you

    @bandit4493@bandit44932 ай бұрын
    • Thank you for subscribing and welcome to the channel! I'm glad you found the explanation helpful, and I hope you continue to enjoy and learn from the content.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Hey Ali, great content! Ive learned a ton from you so far! Any chance of you throwing together a tutorial for directional melee attacking and blocking? No one seems to have anything on that. Something similar to Mount and Blade games.Thanks again!

    @caleb1448@caleb1448Ай бұрын
    • Hey there! Thanks for your support and kind words. I've added your suggestion to my list of video ideas. Stay tuned for upcoming content. Cheers!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • The Observer pattern was very well explained. I would put in the title that it is about using the Observer pattern.

    @joanvillora@joanvillora2 ай бұрын
    • Thank you for your feedback! I'm glad you found the explanation of the Observer pattern helpful. The reason I don't have observer pattern in the title, is the sad truth of trying to balance making good educational content, which making sure people click on it, and the truth is, people won't click on a title called "The observer pattern in game development", believe me, I tried. So instead I tried to make it about what the observer pattern helps you avoid and why it's common to make mistakes when you don't know software patterns. That said. I will still try to fit Observer pattern somewhere in the title, or maybe the thumbnail. Thanks for your suggestion.

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • its very helpful , thank you

    @MIVSIO@MIVSIO2 ай бұрын
    • You're very welcome! I'm glad you found it helpful. Thank you for watching and commenting

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Very useful tutorial thank you

    @abdulalgharbi8784@abdulalgharbi878423 күн бұрын
    • You're very welcome! I'm glad you found it helpful. Thank you for watching and commenting 🙏

      @AliElZoheiry@AliElZoheiry21 күн бұрын
  • wow this just helped me so much. Time to go clean up my project!

    @aedfx@aedfx2 ай бұрын
    • Thats great! Glad you found this useful 😊🙏 thanks for watching and commenting

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Very insightful, thanks! I would really like to know what are the best practices when it comes to the relationship and interactions between a player controller and a player character or pawn, and the things each class should be in charge of.

    @francopizzani4075@francopizzani40752 ай бұрын
    • Hey Franco! Thanks for watching and commenting. That is indeed a very interesting topic, I had some issues figuring that out myself when I started. I'll definitely take it into consideration

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Amazing video! Thanks!

    @TizStorySoftware@TizStorySoftwareАй бұрын
    • Thank you so much! I'm glad you found it helpful. Your support means a lot to me. Keep enjoying the content!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Very good tutorial, thank you

    @nikomouklab@nikomouklabАй бұрын
    • Glad you found it helpful! Thanks for watching and commenting 🙏

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Very good, I hope I don't forget this

    @sunbleachedangel@sunbleachedangel2 ай бұрын
    • Glad you found it helpful! It's always good to have a quick reference to look back on if needed.

      @AliElZoheiry@AliElZoheiryАй бұрын
  • You could also update a variable in game mode class, the game mode could have its own event dispatcher and be called when an update occurs, and everyone listens to that ED in the game mode. This way you don't have to get all actors of class just the game mode. Game mode is accessible from anywhere so that would make it also easy to update the variables.

    @DarkoSubotin@DarkoSubotin2 ай бұрын
    • Hey there! What you're describing is the Observer Pattern using an "Event Bus" which is exactly what I'll be working towards in this series, but unfortunately to explain the concept the best way I can, I have to explain some other patterns first. You are already 2 steps ahead, well done 💪

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great Idea for Series!!!!!!!!!!!!!!!!!!!!!!

    @LuciousKage@LuciousKage2 ай бұрын
    • Thank you! I appreciate your suggestion and enthusiasm for new series ideas. Stay tuned for more content!

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • Keep it up. i think the way u start with a problem, and explain is fresh and good. u stood out in a crowd with this type of video@@AliElZoheiry

      @LuciousKage@LuciousKage2 ай бұрын
  • Great video! My one question is what if the number of enemies is changed by like a new one being spawned in? How would you bind its OnDeath dispatcher to the event like you did when the widget was constructed?

    @notbigsuprise9769@notbigsuprise97692 ай бұрын
    • Hey! Glad you liked it! In the case of an enemy being spawned, then you shouldn't set the number of enemies in your begin play, instead you should have a separate on spawn event that increments the enemy count. I'll actually be addressing that exact issue in my next video, and I will be taking care of some of the draw backs of the observer pattern, using the mediator pattern. So stay tuned for that ;)

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Great Advice! Thanks

    @MLTSR1@MLTSR118 күн бұрын
    • You're very welcome! I'm glad you found it helpful. Thank you for your comment 🙏

      @AliElZoheiry@AliElZoheiry15 күн бұрын
  • If all unreal engine tutorials were like this, I would be a much much better UE dev. ❤

    @Deiollymous@DeiollymousАй бұрын
    • Thank you so much for your kind words! I'm truly glad you found the tutorial helpful and valuable. Good luck with your Unreal Engine development journey! ❤

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Excellent explication, thans a lot!!!

    @msinclaircorp4571@msinclaircorp4571Ай бұрын
    • You're very welcome! I'm glad you found the explanation helpful. Thank you for your kind words!

      @AliElZoheiry@AliElZoheiryАй бұрын
  • Not the best solution to the problem at hand, but you've earned a sub because you're teaching a concept instead of just giving a solution to a problem.

    @souhaibbenchaker4824@souhaibbenchaker4824Ай бұрын
    • interfaces then?

      @BilalAzeem@BilalAzeemАй бұрын
    • Thanks for your comment! Glad you enjoyed the concept

      @AliElZoheiry@AliElZoheiryАй бұрын
  • This is awesome, what a terrific example and explanation to the pub/sub in Unreal. :) I wonder if maybe it would be best to manage the enemy count in something like the game mode, tho? Versus having an enemy count loop in two different places of the code.. For the sake of this demo, this works perfect but in terms of a best practice maybe? Great video, subbed and looking forward to more vids!

    @clockwerkz@clockwerkz2 ай бұрын
    • Hey there, thanks for your comment and feedback, I really appreciate it. Indeed the best way is to have a separate event manager (AKA event bus) but that's going to be part of a new video when we discuss the mediator pattern and the component design pattern. You're already one step ahead, nicely done 💪

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • Thank you, this is Awesome.

    @RoryMcC42@RoryMcC422 ай бұрын
    • You're very welcome! Glad you enjoyed it 🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
  • i wish this was the only tutorial style on youtube, best tutorials, FINALLY THEORY INSTEAD OF CLICK THIS AND THAT AND IT WORK TRUST ME BRO tutorial

    @GloriaTheAnimator@GloriaTheAnimator2 ай бұрын
    • Thank you so much for your kind words! I'm really glad to hear that you find the theory-based approach valuable 🙏

      @AliElZoheiry@AliElZoheiry2 ай бұрын
    • its much more helpful in the long term since it helps you think better and what aproaches to take to common problems, please make more theory based videos

      @GloriaTheAnimator@GloriaTheAnimator2 ай бұрын
    • Next one coming quite soon ;)@@GloriaTheAnimator

      @AliElZoheiry@AliElZoheiryАй бұрын
KZhead