Smart Enemy AI | (Part 2: Patrolling & States) | Tutorial in Unreal Engine 5 (UE5)

Поділитися
Вставка
  • Опубліковано 8 лип 2024
  • In this Unreal Engine Game development Tutorial you will learn the following:
    - Patrolling: How to make an enemy AI patrol along a spline
    - States: How to switch between different states in behavior trees
    - Priority: How priority works in behaviour trees and how to abort low priority tasks for higher priority ones
    - Animation Montages: How to setup montages and montage notifies to trigger certain actions
    Link to my Patreon (Thank you for your support)
    / alizoh
    Link to part 1 of the "Smart Enemy AI" tutorial:
    • Smart Enemy AI | (Part...
    Link to the "Damage System" tutorial:
    • How to Build a Combat ...
    Link to the "Projectile System" tutorial:
    • How to Shoot Projectil...
    Link to my "AOE Damage & Healing" tutorial:
    • How to do AOE damage a...
    About me:
    I've been learning game development for over a year now, I do have a background in software engineering, but I've always wanted to create my own game.
    I am currently working on this 3rd person action adventure game as a hobby, but I am also trying to build a community, thus I am creating UA-cam tutorials to find others who are interested in game development and design.
    If you are interested in learning more or if you are interested in working together, please let me know in the comments.
    Join my Discord server to chat and mingle with the community
    / discord
    If you would like to support me on Patreon, you will get access to all the source code from every video I post as well as any custom assets that I create. Also I would be forever thankful to my early adopters
    / alizoh
    Checkout my other tutorials on my channel:
    / @alielzoheiry
    Chapters:
    00:00 Outcome of this part
    01:07 Assets used
    01:56 Creating the PatrolRoute actor
    07:48 Assign the PatrolRoute to the Enemy
    08:53 Creating a Task to Move Along Patrol Route
    10:11 Enemy AI Interface
    12:06 Implementing the task MoveAlongPatrolRoute
    13:56 Updating the Behavior Tree
    14:33 Testing the patrol behavior
    15:27 Modify Enemy Movement
    23:08 Idle when not patrolling
    25:19 Switching between States
    28:40 Using Blackboard decorators
    30:04 Testing Switching Between States
    34:18 Aborting Behavior Tree Tasks
    38:01 Sheath Sword Animation Montage
    43:13 Sheath Sword Task
    44:24 Updating Behavior Tree
    48:13 Final Outcome
    48:34 Next Up in Part 3
    #unrealengine #unrealengine5 #ue5 #gamedev #smart #enemy #combat #AI #blueprint #tutorial #behavior #tree #patrol #patrolling #state
  • Ігри

КОМЕНТАРІ • 413

  • @AliElZoheiry
    @AliElZoheiry  Рік тому +34

    For anyone having issues with the WieldSword functionality, it's good to know that I didn't show how to edit it to include an animation, but it is the same as the UnWieldSword, so if you want to add that animation make sure to also include an event dispatcher (Call onWieldSword) from your enemy blueprint, and update the task to only Finish Execution when OnWieldSword is dispatched (Just like we did in the SheathSword from 40:45 to 44:20)

    • @djtc2093
      @djtc2093 8 місяців тому +1

      When you say "update the task" - which task or do you mean create a new task for equiping it?

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому +1

      @@djtc2093 here I'm referring to the wieldSword task in the behaviour tree, because a lot of people had issues with this, and almost everyone forgot to call finish task (with success true) ONLY when the onWieldSword event is dispatched

    • @djtc2093
      @djtc2093 8 місяців тому +1

      @@AliElZoheiry 100% - thank you.

    • @tomerhertz8502
      @tomerhertz8502 7 місяців тому

      can you please add the files for this tutorial please? (if you still have the proj files that is)...still heaving problem with it, after i followed your instruction for debugging the WieldSword functionality

    • @tomerhertz8502
      @tomerhertz8502 7 місяців тому

      BTW, the problem i had, was in the SheathSword and WieldSword tasks...i was connecting the finish execute to the bind event instead to the finish custom event respectively in both tasks

  • @storeboughtrocketgames2560
    @storeboughtrocketgames2560 7 місяців тому +26

    These are seriously the best tutorials I've come across. No fluff, great pacing, and even though they're over 40 minutes long each, I know they're worth watching bcz you do such a good job explaining everything, and it's not filled with useless information like modeling a character first, or animating something, straight to the point and topic of the tutorial. Thanks for all your hard work making these AI tutorials, they couldn't have come at a better time for me since I'm implementing a combat system right now. You've definitely earned a subscriber.

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому +5

      Hey! Thank you soo much for this comment. It really keeps me motivated when I see that my content is this helpful to people, so thank you for appreciating the effort that went into this 🙏🙏

    • @nholmes
      @nholmes 5 місяців тому +1

      @@AliElZoheiry I'm a game designer with 25+ years of experience working in various proprietary engines and I'm learning UE for the first time. I cannot thank you enough for putting this video together! Teaching this old dog some new tricks! 🤣🏆🎉

  • @cursedbishstudio
    @cursedbishstudio 10 місяців тому +32

    6.5k views - 222 likes - 104 comments. come on people, don't be so lazy. such minimum effort needed but it means so much to the content creator. 👍

    • @Hobcakes
      @Hobcakes 9 місяців тому

      You're absolutely right and honestly it's a really good video.

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      I don't know how I missed this comment 7 months ago. I really appreciate the support 🙏❤️

  • @lorenfulghum2393
    @lorenfulghum2393 3 місяці тому +2

    You have by far the best, cleanest, most to the point and easiest to follow tutorials I've seen on here. This is helping me resolve a lot of little things I wasn't quite sure about in behavior trees. Now I finally know the RIGHT way to use them.

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому +2

      Thank you so much for your kind words! I'm really glad to hear that my tutorials are helping you out with behavior trees. Your feedback means a lot to me! If you have any more questions or need help with anything else, feel free to ask.

  • @D3K5
    @D3K5 28 днів тому +4

    Your tutorials are absolutely insane and I really enjoy watching them. You really find the right balance of digging into topics, tempo and - my personal highlight - level of coding quality. Looking forward to see and learn more from you!

    • @AliElZoheiry
      @AliElZoheiry  28 днів тому

      Wow! Thank you so much for the support Max. This means so much to me, I appreciate you 🙏😊

  • @HusmanGames
    @HusmanGames 4 місяці тому +2

    This series I by far the best taught content I've watched on Unreal here on UA-cam

    • @AliElZoheiry
      @AliElZoheiry  4 місяці тому

      Thank you so much for your kind words! I'm glad you found the series helpful and well-taught. Appreciate your support!

  • @trelaskillz
    @trelaskillz 6 місяців тому

    I've only been building BluePrints for about 3 weeks and I was able to follow along easily with a few minor debugs needed for my own errors. Thanks for the great work and I look forward to watching the next one in your video list!

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому

      That's great to hear! I'm very happy this was beginner friendly as well. The aim for this series is to be beginner friendly while still teaching intermediate and experts a lot of new things.

  • @leduyminh7813
    @leduyminh7813 8 місяців тому +1

    Amazing tutorials! I've been looking for a detailed tutorial on advanced AI like this for months. Thank you so much :)

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      You're very welcome! Thank you for watching and I hope you enjoy the rest 😊🙏

  • @madhisaranadasa1410
    @madhisaranadasa1410 10 місяців тому +2

    Best Unreal AI content I have seen. Amazing work!

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому

      Thank you ❤️ really glad you found it useful

  • @pwnonator
    @pwnonator 9 місяців тому +1

    This tutorial is everything i pretty much been looking for so far. Wow

    • @AliElZoheiry
      @AliElZoheiry  9 місяців тому

      Glad it was helpful! Thank you for watching 🙏

  • @sergimorpalou206
    @sergimorpalou206 8 місяців тому +1

    very well explained, without having much idea of English I understood everything! For the following videos, thank you very much! greetings from BCN

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      Hey Sergi, thank you for the support, I'm very happy you found this useful ☺️🙏

  • @twidiegamers3854
    @twidiegamers3854 8 місяців тому +1

    Amazing tutorials! Learning a lot in here. You just got yourself a new patreon! Can't wait to continue the rest of the tutorials! Keep up the good work!

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому +1

      Thank you so much Twidie 💖 really glad that you are finding my content helpful, and i'm really grateful that you joined my Patreon. I appreciate you 🙏😇

  • @Clydiie
    @Clydiie Рік тому +10

    This has really helped me alot I was so scared to get into making ai but you have made it so clear and easy to follow I still dont understand ai but I understand more than I did so thank you so much! I'll be sure to credit you when I make my game!

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +1

      Really happy I could help you Gameboy, I appreciate the support, and looking forward to teaching you more.

    • @Clydiie
      @Clydiie Рік тому

      @Ali Elzoheiry I'm currently watching and following part 3, and I'll be very excited to see what you do next!

  • @supa76
    @supa76 7 місяців тому

    thanks so much. I am quite a noob with unreal AI, and I followed along quite easily and had no problems getting to work.

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      You're most welcome Supa, always happy that I could help ☺️🙏 thank you for watching

  • @unsolvedbc
    @unsolvedbc Місяць тому

    Amazing!! As per usual, loving this series so far, thank you!

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому +1

      So happy to hear you're enjoying the series! Thank you for your support 🙏

  • @HandsOnKnowledge
    @HandsOnKnowledge 10 місяців тому +5

    Learned so much from the firs episode of this series. I didn't know anything about behaviour trees and after watching the first episode and then practising on my own I am a lot more comfortable with it. Thank you Ali you are my Unreal Sensei, keep up the excellent work :)

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому +3

      I'm very happy to hear that, you're welcome man, thank you for watching 🙏

  • @nishanthapaliya4444
    @nishanthapaliya4444 2 місяці тому

    Starting this series after completing load and save system which was fantastic. You teaching style is amazing - problem and solution based which i found very helpful in learning process. Just leaving this comment to encourage you to produce more videos in more series especially in multiplayer system login using facebook/google, messenger style chat using dedicated server , and save and load in multiplayer system. Keep up the good work man . Cheers 🎉

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому +1

      Hey, thank you so much for your kind words and suggestions! I really appreciate the support and I'll definitely keep your ideas in mind for future videos. Cheers! 🎉

  • @youseiy
    @youseiy Рік тому +4

    Thank you soo muchhhh!! im a C++ developer and making a stealth game, sadly the ai documentation is very bad and usually i take the Bp logic and translate to c++ in a optimal way. You r awsome!

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +3

      Yeah the documentation for C++ is quite lacking, I will be making some C++ tutorials as well soon because some systems are only available in C++ so stay tuned ;)

  • @oscblade1691
    @oscblade1691 2 місяці тому

    I'm loving this tutorial series so far great work keep it up

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому +1

      Thank you so much for the positive feedback! I'm glad to hear you're enjoying the tutorials.

  • @pablochamarra8246
    @pablochamarra8246 2 місяці тому

    Once again great stuff, completely devoured this tutorial. Love.

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      Thank you so much for your comment! I'm thrilled to hear that you found the tutorial helpful and enjoyed it. Stay tuned for more great content! 🙏

  • @jbtnproductions7245
    @jbtnproductions7245 2 місяці тому

    Look, I'm Brazilian and I understand very little English, but honestly what fantastic teaching, even with little understanding your content is very complete and explanatory, I would definitely buy something from you, you're very good at what you do, you deserve recognition

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      Obrigado! Estou muito feliz que você está achando útil, a sua mensagem me motiva muito. Muito obrigado pelo seu apoio!

  • @Mario543212
    @Mario543212 8 місяців тому

    Amazing channel! I'm gonna binge-watch all your videos.

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      Glad you like it that much. I appreciate your support 🙏

  • @user-xv6hh8iw8m
    @user-xv6hh8iw8m 10 місяців тому

    Awesome, thanks you Ali.这是我见过最好的AI教程

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому +1

      You're welcome 🙏 I'm very happy that you enjoyed it 😊

  • @sajjadmirshabi
    @sajjadmirshabi Рік тому

    Awesome, thanks you Ali. Been waiting for it

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Hope you enjoyed it Sajjad and thank you for the support. Part 3 is coming out soon as well

  • @user-pn3ut7rw6c
    @user-pn3ut7rw6c 5 місяців тому

    Amazing tutorials! Learning a lot in here. Keep up the good work!

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому

      Thank you so much for your kind words! I'm thrilled to hear that you are finding the tutorials helpful. I'll definitely keep them coming. Keep up the great learning!

  • @vidmaster7
    @vidmaster7 Рік тому +6

    Hi, Ali. I am learning so much from your tutorials. I do have one suggestion. Make sure that what you are referring to is visible on the screen. There are many instances where what you are typing is cut off. This is true whether it is in the window or full screen. Thank you for the hard work on these tutorials. This is helping me understand AI.

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +6

      Thank you, I indeed noticed this in a few other videos, In my latest 2 videos I started only zooming on important details which would otherwise be too small on screen, so hopefully this issue isn't happening anymore

  • @0xJarry
    @0xJarry 8 місяців тому

    Loving my journey through these tutorials... I stopped right before the end and was going to add another decorator for "IsFocused" and got hung up a bit... clicked play and 2 seconds later you went into the focus fix 🤣

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      Hahaha awesome, glad we were on the same page there

  • @ericcrary2380
    @ericcrary2380 5 місяців тому

    Ur series is amazing and you are very appreciated

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому

      Thanks so much for saying that. I appreciate you too 🙏

  • @TheFalcoGamingDK
    @TheFalcoGamingDK 5 місяців тому

    Hey Ali! Great work with the video. Proberly the best guide in the world ngl.

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому

      Thank you for the kind words! I'm really glad you found the video helpful. Your support means a lot!

  • @cliffianson4146
    @cliffianson4146 Рік тому

    oh yes ,been waiting for this. Thanks

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Thank you Cliff! Hope it has what you need, and definitely more to come soon 🙏

  • @WiseBefore
    @WiseBefore Місяць тому

    Im a complete noob and managed to follow this great (yet complexed) tutorial.. I kept leaving comments asking for help but then would follow the logic from what I asked and debug.. Then comment again with a new problem and delete as it changed aha. This is my final comment to say thank you.. Most my issues were to do with leaving a box unchecked or not connecting a pin for example I hadnt connected WeildSword to execute Bind event in the BTT_weildSword and in Sheathe sword so the BT wasn't finishing the task and getting stuck haha.. Having the comments to read through definitely helped me to fill in gaps on parts I had missed or you had done outside of the edit. Thanks for another great tutorial. Took me about 4 hrs as a noob to troubleshoot my mistakes :)

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому +1

      Hey, thanks for sharing your journey with the tutorial! It's really great to see how you were able to troubleshoot and solve the issues on your own. Your perseverance definitely paid off. Glad the comments were helpful, and I'm happy you found the tutorial useful. Keep up the great work!

  • @arturkozanowski1499
    @arturkozanowski1499 2 місяці тому

    Man you are the one of my the best explores in this year. Really. Bow for your efforts.

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      Thank you so much for your kind words! I'm thrilled to hear that my content has been helpful to you. It means a lot! 🙏

  • @gufranyesilyurt
    @gufranyesilyurt 8 місяців тому

    For anyone having issues about being stuck in A state of flip-flop, hence not being able to change states. The problem might be the keyboard key. You can try using the enhanced input system. I first had a problem with the "Tab" button, but when I used it with the enhanced input actions, the problem was solved.

  • @jedtanartkulprakrom4616
    @jedtanartkulprakrom4616 Місяць тому

    Thank you teacher Ali. Like part 1 your tutorial are very detail moreover your teaching and how you explain are really amazing.
    I also consider WieldSword function that didn't show in video as homework.
    Even now I cant count the spline point and don't know why it need to -1. The Spline point function are the last thing that I cant understand.
    Also it took me nearly 2 month to understand overall how the function operate, That make me realized how I lack of the foundation [Gonna cry in corner]

    • @DaviesMurphy
      @DaviesMurphy Місяць тому +1

      for example you have 10 spline point in your patrol
      spline point index 0 = spline point 1
      ...
      ...
      ...
      spline point index 9 = spline point 10
      index as defaulf start 0 but your point of number going 1 , 2 , 3...

    • @jedtanartkulprakrom4616
      @jedtanartkulprakrom4616 Місяць тому

      Thank you so much

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому +1

      Hey there! Thank you so much for your kind words and for sharing your thoughts. I appreciate your dedication to understanding the concepts. Don't worry, taking your time to fully grasp the material is commendable, and it's okay to take a bit longer to fully understand everything. Keep going, you're doing great! 🙏
      P.S, checkout the response from @DaviesMurphy, it sheds light on how incrementing the spline point works! Thanks for that Davies

  • @deltacake3809
    @deltacake3809 Місяць тому

    Great video, thats what I was looking for

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      Hey there! Thank you for watching and commenting! I'm glad the video was able to help you out 🙏

  • @eugeniivakulenko5281
    @eugeniivakulenko5281 3 місяці тому

    Thank you very much sir! Your tutorials are super useful!

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому +1

      You're very welcome! I'm glad you found the tutorials helpful. Thank you for watching and commenting 🙏

  • @Sebbx8
    @Sebbx8 6 місяців тому

    Excelent tutorial, you are my favorite now

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому

      Thank you! Glad you are enjoying them 😇🙏

  • @callatogames
    @callatogames 19 днів тому

    Great Tutorial, thanks man :)

    • @AliElZoheiry
      @AliElZoheiry  14 днів тому

      You're very welcome! I'm glad you found it helpful 🙏

  • @raduvady
    @raduvady 8 місяців тому

    really great tutorials, thank you very much

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      You're very welcome! Thank you for watching

  • @saucythighs
    @saucythighs 29 днів тому

    I like that the way you design these, you are using best practices for how you would set it up for an actual game. Most tutorials just focus on getting it functioning superficially for the purpose of the video.

    • @AliElZoheiry
      @AliElZoheiry  29 днів тому

      Thank you for your comment! I really appreciate it. My goal is always to make sure the tutorials I create are not only functional but also designed with a real-world game development approach in mind. I'm glad you noticed that! 🙏

  • @ryanjdevlin87
    @ryanjdevlin87 8 місяців тому

    Thank your for this series this will help me alot :) thanks so much

    • @AliElZoheiry
      @AliElZoheiry  8 місяців тому

      You're very welcome! Thank you for watching :)

  • @electronicinfection
    @electronicinfection Місяць тому

    Thanks a thousand times!

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      You're very welcome! I'm thrilled to hear that you found the content helpful. Thanks for the feedback! 🙏

  • @h9rr9r_80
    @h9rr9r_80 6 місяців тому

    This tutorial is great thank you

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому

      You're very welcome! Thank you for watching 🙏🙂

  • @DannyshRosli
    @DannyshRosli Рік тому

    Hi Ali , im really excited about the series . Im just bum out that sometimes i dont understand your math, especially the Patrol Index. Im trying my best to understand it, had to crush my head. Hopefully ill knock some sense into my own brain :D

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Hey Danny, let me try to explain it simply. The patrol index is just the point on the spline that the enemy is currently on starting at 0 (meaning the first point) so when the enemy moves to the next point we need to add 1 to that index (so then the patrol index is equal to 1 which means the enemy is at the second point in the spline) then we need to check if we reached the end of the spline, by checking if the index is equal to the number of points in the spline (but minus 1 because we started at 0 not at 1) then if we reach the end we just start subtracting 1 from the patrol index instead of adding 1 (this we change the direction to be -1) and do the reverse once we reach point 0 on the spline again. Hope it makes more sense now

    • @DannyshRosli
      @DannyshRosli Рік тому

      @@AliElZoheiry Hey Ali ! Thank you very much clearer now , thank you so much !

    • @udoma8
      @udoma8 Місяць тому

      @@AliElZoheiry My thought since has been how you figured out this particular logic, it is clean and also very uncommon while looking common

  • @newtforgegames
    @newtforgegames Рік тому +1

    These videos have been such a help! Thank you and keep it up! +SUB!

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Thank you for the support 🙏 I'm always happy to hear that my tutorials are helping people, I hope to continue helping you :)

  • @KittehBit
    @KittehBit 4 місяці тому

    These videos are really good :)

    • @AliElZoheiry
      @AliElZoheiry  4 місяці тому

      Thank you so much for your kind words! I'm really glad to hear that you're enjoying the videos. If you have any specific topics or requests, feel free to let me know. Happy learning!

  • @user-xj2pf4pl9p
    @user-xj2pf4pl9p 6 місяців тому +1

    love it very helpful

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому +1

      Great to hear that! Thanks for watching and commenting

  • @warehousevirtuals
    @warehousevirtuals 11 місяців тому

    I liked and subbed with all 3 of my accounts, i will be teaching these concept to my friends, thank you

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому +1

      Thank you for the support 🙏 really glad you find it useful

  • @muhammetemirbulut6511
    @muhammetemirbulut6511 10 місяців тому

    thks for this series

  • @tucaja1240
    @tucaja1240 10 місяців тому

    amazing bro, gracias

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому

      De nada, glad you liked it !

  • @oerealrap
    @oerealrap 11 місяців тому

    omg i figured it out all good aha thank god aha aweosme

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому

      Nice! Glad you figured it out. Mind sharing with the people here what the problem was and how you fixed it?

  • @konspiracni_teorie_official

    U ARE GOD ! MORE TUTORIAL LIKE THIS !

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +1

      Thank you Marcus. I hope you enjoy the rest of the series 🙏

    • @konspiracni_teorie_official
      @konspiracni_teorie_official Рік тому

      @@AliElZoheiry I will check every your tutorial and hope you will continue, u are doin greet job !

  • @perrobravomx4206
    @perrobravomx4206 9 місяців тому

    Awesome video! thank you so much again for your incredible capacity to explain things. 10/10 would recommend.

    • @AliElZoheiry
      @AliElZoheiry  9 місяців тому +1

      You're very welcome, I'm glad you found it useful, and I appreciate your support 🙏☺️

  • @cherrygod3787
    @cherrygod3787 3 місяці тому

    you are really best, im deleted my old ai system in only BP and im trying to use now BT. You are best man and you are best man again and you are best best man. Change your channel name to "BEST MAN"

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      Thank you so much for your kind words and support! I'm really happy to hear that you found my content helpful as you transition to using behavior trees. I appreciate your enthusiasm and encouragement!

  • @BROCKSGAMING
    @BROCKSGAMING 7 місяців тому

    The more better way instead of using a Interface or Cast is to Store Data in ActorCOmponent , this is a great feature using which we not only make Less Coupled things but also modular things

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      Hey Brock, thank you for the feedback. I indeed use actor components heavily later in the series when I start integrating a damage system and attack system

    • @BROCKSGAMING
      @BROCKSGAMING 7 місяців тому

      @@AliElZoheiry I see, that's great then and btw I loved your end result that's why I started watching, if you could make a enemy which can predict player moves like attack, flank

  • @theindiegamedude
    @theindiegamedude 11 місяців тому +1

    Great content so far! My AI has been severely lacking. And, these videos are just what I need. I'm wrapping up for the day. I've only had one issue that I cannot seem to figure out.
    When I press "1" the first time, everything works great, and I created an UnsheathSword Montage similar as you did, and spawn the sword using a Montage Notify as usual when working with Notifies. But, the Enemy will not turn to face the Player as it unsheathes the sword. It will unsheath, then turn to the Player everytime. I've tried playing around with different things, and I'm not quite sure what is going on.
    Other than that everything looks great. I've debugged the AI Behavior Tree, and it looks like it flashes by the BTT_FocusTarget(with AttackTarget as the Attack Target Key) and goes directly to the BTT_UnsheathSword I created under the BTD_IsWieldingSword Decorator. That is all within the first sequence. The numbers on the nodes look correct. I'm not sure why it is skipping the BTT_Focus Target Task though.
    EDIT: For now, I'd just added a Wait 0.5 Seconds Node to the middle of the sequence. So it will Focus wait half a second, then unsheath the sword. This gives the AI enough time to turn and face the player, even if directly behind the AI. Using 5.2.1, but don't think much has changed in this regard.

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому +1

      Thank you! Glad you've been enjoying the content
      If your AI is taking a long time to turn it could be the rotation speed of the enemy character is slow. If you're not using the default manny character and default settings, make sure to match it to the default manny settings for rotation speed and see if it helps

    • @theindiegamedude
      @theindiegamedude 11 місяців тому

      @AliElZoheiry - Thanks for the tip! I was actually thinking the same thing when I woke up this morning. Oftentimes, I wind up waking up with a proper solution XD
      Just got in from some morning endurance cycling. I'm going to get going on my projects in a half hour. And, this will be the first thing I test. Adjusting the turning/rotation speed on the ai mesh.

    • @Dominicn123
      @Dominicn123 7 місяців тому

      hey man, did you figure it out? i'm having the exact same issue as you and i don't think it's the rotation speed

    • @theindiegamedude
      @theindiegamedude 7 місяців тому

      @@Dominicn123 - Sorry. I never did figure out the issue with the enemy not facing the player. I just left in the Wait half a second node to the AI Tree which I mentioned above.
      At this point I think I'm running off a copy of one of Alizoh's source files I downloaded a while back. I didn't think of looking for the change in the source for that particular issue. When I downloaded the source project, and started working off of that.

  • @jarofpickles1246
    @jarofpickles1246 9 місяців тому

    In the behavior tree tasks that you create you are casting to the enemy base class. Do you think it would be more efficient to either update the BBkey through the enemy blueprint by using "get ai controller>get blackboard>set blackboard value as..." OR would it be better in the behavior tree to cast only once and store the enemy reference instead of casting every created task?

    • @AliElZoheiry
      @AliElZoheiry  9 місяців тому

      Once we start adding the enemy AI interface, I won't be casting as often since I'll be calling interface functions, but in general, casting isn't a performance heavy operation, so you can cast on each tick, hundreds of times and it won't be a performance issue unless it's thousands of times per tick

  • @PokeGameTCG-Oficial
    @PokeGameTCG-Oficial Місяць тому

    Excelent Video, I have a doubt, in my case my character when he appears on the map makes the animation of drawing his swords, but I want him to not move while he is doing it, so I put a wait at the beginning of the Passive State, it worked but then to advance point o'clock it is also expected, do you know how to make the wait only at the beginning and not repeat itself anymore, thank you.

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      If your character is doing an action and that action is triggered by a behavior tree task, then you shouldn't Finish the task execution until the action has ended, that's why I added the event dispatcher in the wield and sheath sword functions, to tell the task that the animation is over and you can move to the next node.
      This is what you should do as well, because a wait node won't work for all animations since they have different timings

  • @roja
    @roja Рік тому

    Amazing!1

  • @matka5130
    @matka5130 7 місяців тому

  • @hype._.
    @hype._. 3 місяці тому

    9:36 Use interface instead of casting
    (because the 'increment patrol route' function will apply to all types)

    • @hype._.
      @hype._. 3 місяці тому

      Thank you very much😲

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      Thank you for the suggestion! I appreciate your input on using interfaces for a more versatile solution.

    • @hype._.
      @hype._. Місяць тому

      8:38 (in Scene)

  • @Poske_Ygo
    @Poske_Ygo 4 місяці тому

    Nice guide. algorithm. + like.

    • @AliElZoheiry
      @AliElZoheiry  4 місяці тому

      Glad you found the guide useful! Appreciate the support 🙏

  • @ragnorucca6637
    @ragnorucca6637 Місяць тому

    Great videos @AliElzoHeiry one small thing and im not sure if its covered in a later video but the character jitters a bit in animation when it reaches the spline point. like its deciding whether to keep walking at the next spline point. can this be made smoother somehow or is it just the nature of using splines?

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      You can play around with the character movement settings, things like declaration and acceleration speeds and friction, etc.. these can help you get a smoother effect

  • @WaHBz86
    @WaHBz86 Рік тому

    Hey great video! Just one thing, in my project, when drawing the Ai's sword, the Ai slides towards me as he is playing the animation. Once sword is unsheathed. Would you have a clue as to why the Ai slides during the draw sword animation? Cheers!

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Thanks Wahbz! Regarding your issue it could be a number of things so I can't tell you exactly the cause of the issue, just make sure to retrace your steps, debug your tree and see what's firing when and why by adding print statements

  • @tc8557
    @tc8557 Місяць тому

    quality vid!

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      Thanks for the support! Glad you enjoyed it 🙌

  • @amiryari5239
    @amiryari5239 5 місяців тому

    Your great 😃

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому

      Thank you so much! I really appreciate your kind words and support. 😊

  • @kristopherjones5991
    @kristopherjones5991 Місяць тому

    Thanks for these awesome tutorials! I do have one issue with the Blackboard Decorator that is on the CombatState Selector. With it on, the enemy only runs the PassiveState side of the BT. With it off, the enemy will try to move to AttackTarget, but slingshots around the area never actually reaching the player. I don't know what the issue is, but any insight would be much appreciated.

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому

      I'm not really sure I understand the issue, but if it is regarding the decorator not succeeding/failing correctly, then I suggest checking the implementation of the decorator and seeing when it returns false/true.
      Otherwise, some common mistakes are:
      - Using "Selector" when you mean to use a "Sequence" node
      - Setting the wrong input parameter to a decorator or task

  • @Shino2213
    @Shino2213 Рік тому

    Hey Ali, i was having an issue with reversing the sheathsword animation. the enemy would'nt play the montage if its reversed, but he was able to play it unreversed. i checked the BT. and when id swap to the attack state, it would just get stuck on wield weapon and he would'nt wieldSword. If i use it not reversed, functionally it works and hes able to spawn the weapon. Im not sure why that is, everything seems correct. Could it be the anim notify ? it works fine on the sheathsword animation, but should i do something else if i reverse the play rate of the animation ?

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Hey Shino, not really sure what the issue is, but if the montage notify isn't being triggered in the reversed montage, try deleting the notify and adding it again, it often happens that notifies become null when you make changes to the montage after adding it

    • @ThadeousM
      @ThadeousM 6 місяців тому

      @Shino2213 I got stuck here to. My issue was, I had used the wrong method to reverse the animation.
      Check that you have changed the PLAY RATE by clicking the animation segment in the montage timeline
      Make sure you have not changed the RATE SCALE like I had!
      Plus reseting the also helped

  • @nholmes
    @nholmes 5 місяців тому

    These videos are great! I find myself stumbling through UE5, how did you get to the point where you could build behavior trees, tasks and functions on the fly?

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому +1

      Thank you! I'm glad you're finding the videos helpful. Building behavior trees, tasks, and functions became easier with practice and experimentation. I recommend trying out small projects to gradually build your skills and confidence in UE5. Keep experimenting and learning - you'll get there!

  • @JyotiEntertainmentProduction
    @JyotiEntertainmentProduction 2 місяці тому

    Really Appreciate your teaching Sir. Followed along with my custom Ai as Zombie from Mixamo. Everything works fine, except after SHEATHING THE SWORD, the Ai is not going back to the BTD_HasPatrolRoute Sequence. It got stuck on the BTD_ISWieldingSword Condition forever. I don't seem to figure out the problem! Can you kindly help?

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      One possible solution to this problem could be related to the event dispatchers and binding in the behavior tree task. Make sure that the event dispatcher for when the sheath sword event has finished is firing correctly and that you are binding to it correctly in the behavior tree task.
      Additionally, you can debug your code to narrow down the problem. You can check what's happening step by step to identify where the issue might be occurring.
      If you still haven't found a solution, you can also refer to my bug fixing video for some tips on troubleshooting bugs. Here is the link to the video: ua-cam.com/video/lflqdan_isw/v-deo.htmlsi=bOIk8RofIkZ9n5_I
      I hope this helps you in resolving the issue with your AI.

  • @clebo99
    @clebo99 2 місяці тому +1

    So a few things...I'm going to hang with this but you move a little too fast and I think you forgot to show what you did around 41:00 regarding the changes you made to the initial Weird Sword. But so far I'm liking it.

    • @AliElZoheiry
      @AliElZoheiry  Місяць тому +1

      Hey, thanks for your feedback! I indeed didn't show the changes to the WieldSword, because they are exactly the same as the SheathSword event, and I showed the event in the blueprint, so you can pause and see what's happening there if you'd like

  • @proxima7199
    @proxima7199 11 місяців тому

    Hey, thanks for the tuturial!
    What can you say about Advance Locomotion System library?
    Have you tried it?

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому +1

      You're welcome mate
      I haven't tried ALS myself, but I've seen it un multiple projects and it seems very good and flexible , so it's a good start for getting something done quick, but if you want your character movement to be unique for your game, then building your own is better

  • @oerealrap
    @oerealrap 11 місяців тому

    aha i for the life of me cant seem to find current index or set current index or idex only the variable but doesnt look to same and cant plug in two variables aha what do i do

  • @Darryd
    @Darryd 5 місяців тому

    Just out of curiosity, I'm just trying to make a simple Souls-Like Boss fight, I have the basics for the AI BT you've shown in the 1st episode, I was wondering what videos in order I could watch to get to the final 3 videos without missing anything important.
    For reference the character I'm following with is the boss I just don't need him patrolling/ hiding to get health if that makes sense?
    Love the series though and will definitely be coming back to learn more soon! 😄

    • @AliElZoheiry
      @AliElZoheiry  5 місяців тому

      Hey Darryd, not sure I can tell you which videos to skip because the entire series is built sequentially, so there might be a slight change I make in one video that is used in a later one.
      What you can do though is check the "chapters" that are timestamped in each video, and they will give you an idea on the contents of that video, then decide whether to skip it or not

  • @god_ozai828
    @god_ozai828 3 місяці тому

    This is probably a specific problem I had but an easy fix anyway, my set focus wasn't working so the AI didn't focus on the player before drawing the sword, then I found out that I set the AI rotation settings to Orient Rotation to Movement instead of Used Controller desired Rotation.

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      Glad to hear you found the solution! It's often the specific details that can make all the difference in debugging. Keep up the good work!

  • @NewWillStudio
    @NewWillStudio 4 місяці тому

    I gonna comment in every video

    • @AliElZoheiry
      @AliElZoheiry  4 місяці тому

      Thank you so much for your commitment and support! It really means a lot to me. Looking forward to your comments on future videos!

  • @jocslzr1
    @jocslzr1 7 місяців тому

    @AliElzoheiry Thanks so much for this tutorial, I’ve been looking for something like this for days, and finally found it on my recommendations. I am having a weird issue with the Behavior Tree where my Set Movement Speed Task keeps resetting itself to "Idle" every time I close and reopen the Engine. Do you have any idea of what could be causing this?

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      Hey, you're very welcome 🙏 I've experienced this issue with some BT tasks as well. I found that deleting the task and adding a new one sometimes fixes it

    • @jocslzr1
      @jocslzr1 7 місяців тому

      @@AliElZoheiry Yes! Thanks for replying, I fixed it by closing the BT before closing the engine, I think it might be a bug related with autosave. It’s been causing some issues for me lately.

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому +1

      Just one of those weird engine bugs I guess, glad you fixed it 💪@@jocslzr1

  • @tomashorsky3316
    @tomashorsky3316 6 місяців тому

    Hello. In the video at 32:40, you add "Cast to AIC_Enemy_Base". When I press 1, it stops right at this Node. The cast simply fails. What could be causing this? Thank you

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому +1

      The only reasons for the cast to fail is either you are casting to the wrong class, or you didn't set the AI controller to the pawn

  • @user-kv6sg3gq2d
    @user-kv6sg3gq2d 11 місяців тому

    In my UE5.2, at 29:13 in the video, the key query option does not show "Equal to", instead it shows two "Not Equal to". Do you know the cause of this?
    The cause may be the version.
    Which type of UE do you use?

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому +1

      That's very strange 😅 there should definitely be an equal to, regardless of what engine version you're using. Try restarting the engine and make sure you don't have any weird 3rd party plugins enabled that might mess with the default settings. Also check different projects to see if they have the same issue, that would narrow down if it's an engine problem or a problem with the settings of a specific project

    • @user-kv6sg3gq2d
      @user-kv6sg3gq2d 11 місяців тому

      @@AliElZoheiry
      I don't mean to deny that,
      I changed the version to 5.0.3 and it worked. LOL.
      Apparently there is a bug in 5.2.1.

  • @wtfc9835
    @wtfc9835 3 місяці тому

    Make sure your putting the debug trigger for the state switching in the player blueprint xD

  • @TheHanmaru
    @TheHanmaru 3 місяці тому

    Hi, Nice tutorial!! I have a question. I followed yours but my default AttackTarget can't find target (It shows "None") when I game start and doesn't attack me. If I toggle manually, It works good. How do I can solve my problem? Thanks!

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      Hey there, glad you enjoyed it! If you are referring to the blackboard value reverting back to none when you restart the engine, that’s unfortunately a known issue with unreal engine, if you delete the node and create a new one, it often fixes it

  • @Chatmanstreasure
    @Chatmanstreasure 10 місяців тому

    Do we make a Patrol Route for each Enemy? If we want say 5 enemies walking around in different areas? Also can you have 2 npcs on same Patrol route?

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому +1

      Right now, since the Patrol index is stored in the patrol route itself, then we can only have 1 enemy per patrol route. Otherwise if we assign 2 enemies to the same route, then when one enemy increments the index, the other will do the same as well.
      To fix that, you can just store the Patrol index on the enemy itself instead of in the patrol route, then you can have multiple enemies on the same patrol route

    • @Chatmanstreasure
      @Chatmanstreasure 10 місяців тому

      @@AliElZoheiry Thank you...appreciate it...I also noticed you respond to almost if not all comments...don't see that much. Appreciate all you videos

    • @AliElZoheiry
      @AliElZoheiry  10 місяців тому

      @@Chatmanstreasure I surly try to respond to everyone, within a day or 2 if I can, sometimes I just don't have the answers though 😅

  • @projectgg6730
    @projectgg6730 2 місяці тому

    In the tasks should you have an is valid off of controlled pawn? In my case I'm going to have a bunch of zombies. COD zombies style. And in my prototype (where I just used blueprints instead of behavior trees) I'd get all kinds of errors when they died unless I put is valid like everywhere lol

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому +1

      Hey there! It depends on how you implement the death logic. If you unpossess the pawn from the controller, then you should stop the logic of the behavior tree anyway, so it doesn't matter if there is an isValid check.
      Generally, if you're controlled pawn is ever inValid, then that means you have something else wrong in your implementation, because that case should never occur

  • @cliffianson4146
    @cliffianson4146 Рік тому

    I have just come to the section near the end and to the Behavior tree and noticed yours has changed in the passive state from the first video, but haven`t showed what you did.

    • @AliElZoheiry
      @AliElZoheiry  Рік тому

      Ahh good catch Cliff, I must have changed it when I wasn't recording and forgot to update that part. If you would like me to explain something in Discord, feel free to ask your question there and I'd be happy to answer

  • @WeAreNIM
    @WeAreNIM 6 місяців тому

    I cannot get the NPC to move to spline points. I'm not sure where the breakdown is because the AI debug says it's the current task, but the NPC doesn't move. I went back through the tutorial twice and I don't know what I'm missing. The only thing that I've changed from the original tutorial is I promoted the Acceptance Distance to an exposed variable on the AI Move To inside the BTT_MoveAlongPatrolPath task so I could modify it directly from the main behavior tree, and replaced the Scene Root Actor with a custom sprite billboard that is easier to find among all my world objects - I'm still able to assign the BP_PatrolSpline actor to the NPC, so the reference isn't broken as far as I can tell, and it's not abandoning the task when I put it on a selector to choose between patrolling and chasing, so I have no idea why it won't move. I haven't gone beyond timestamp 15:25 because AFAIK the implementation is broken somehow and it shouldn't be an issue with UE 5.3 - does anyone have any helpful advice for what I could be missing? Any help is appreciated.

    • @AliElZoheiry
      @AliElZoheiry  6 місяців тому +1

      Hey, I can't really tell what your bug is just from this description, so I suggest that you add breakpoints or print statements in the patrolPath to see if it's printing the values you expect, that will help narrow down the problem.
      If you still can't figure it out, feel free to join the discord server and ask your question in the help channel there with more details and screenshots (Link in the description)

  • @kasperlarsson7598
    @kasperlarsson7598 7 місяців тому +1

    This zooming in and out all the time is making me seasick. The quality of the sound and video is great you dont need to do all the zooming. Awesome tutorial series, learning a lot!

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому +1

      Hey Kasper, thanks for the feedback, I did indeed realize that the zooming was unnecessary and stopped doing that in the later videos of the series. Glad you're finding it useful ☺️🙏

  • @BooneyianLogic
    @BooneyianLogic 7 місяців тому

    (SOlVED)I've had an issue with the Switch on name nodes after the animation montages not executing's. I troubleshooted and found that the animation montage is blending out and completing without firing the notify. I have moved the notify to the very first frame of the animation montage, this hasn't seemed to help. I was just making notifies in the animation montage, not using the "Montage Notify" once i created These Notifies. It works

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      That's indeed a common issue. I talked specifically about that one in my "How to fix bugs" video

  • @Сма_йлик
    @Сма_йлик Рік тому +1

  • @dandimensions8897
    @dandimensions8897 11 місяців тому

    Hi I can't pull up the increment patrol route when I try and do it on my end I'm wandering if I did something wrong along my end because it doesn't feel like it?

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому

      Hey, not sure what you mean by "can't pull up the increment route"?

    • @scjohnson243
      @scjohnson243 9 місяців тому

      @@AliElZoheiryTroubleshooting what I think is the same problem now... at 13:39 you pull off of patrol route and add "Increment Patrol". I cant get that to show up (Incremenent patrol attached to the patrol route)

    • @scjohnson243
      @scjohnson243 9 місяців тому

      Ok, figured it out, I assume he drug from "Controlled Pawn" in the Event Receive ExecuteAI, but you need to drag from "Get Patrol Route" node next to it, the actual patrol route.

  • @Dominicn123
    @Dominicn123 7 місяців тому +1

    hey Ali, i've been really enjoying your lessons on this as i've been trying to do this whole playlist, everything was amazing up until about 70% through this video when it came to flip flopping between hitting the '1' key... i can see many others are having issues as well. i've tried a few fixes and i just can't figure out where the issues are, i've thoroughly scanned the nodes to make sure they're all connected exactly as yours as well, they are good. but could we skip this portion where we press the 1 key, and be good? because in the following videos we're setting up the ai to act independently, so i don't see for there to be any need to set up my ai with the 1 key, would i be able to continue and be good if i skiped the last portion of this video? because we won't be using it later right?

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      Hey Dominic, the functionality of pressing 1 to get to the enemy to follow you is just for testing, but if it's not working, that probably means you have another issue with the enemy behaviour that will still occur even if you skip that part.
      Most people who were facing this issue were having different bugs. Some related to the event dispatcher not being called or binding incorrectly, some had bugs in the behaviour tree, etc.. so it could be anything.
      If you're interested in learning how to better find and fix bugs, I have a video on that ua-cam.com/video/lflqdan_isw/v-deo.htmlsi=uuNEQicb9ihrna48

    • @Dominicn123
      @Dominicn123 7 місяців тому

      i just became a patron so i'm gonna check out your project files@@AliElZoheiry

    • @Dominicn123
      @Dominicn123 7 місяців тому

      okay so i have it downloaded from your dropbox link and have it now opened, its way different so i'm assuming this is the final project from the end of the series as well, so it has a ton of different things on it, everythings changed around from this episode, do you have project files per episode or is it all just one file?@@AliElZoheiry

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      @@Dominicn123 unfortunately I don't have the project saved after every tutorial, that would fill up all my cloud storage very quickly 😅

    • @ong8163
      @ong8163 7 місяців тому

      me too

  • @oerealrap
    @oerealrap 11 місяців тому

    aha it wont move along the path just stays still and it keep trying to find the path sha what am i doing wrong

  • @Im_pro_true16
    @Im_pro_true16 2 місяці тому

    Hi, I wonder is there any way to make the ai follow a specific patrol route when spawned, like for example an ai spawner when the ai is spawned, how to make that ai follow a specific patrol route, thank you. Btw love your vids!!

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      Hey there. This is the topic of the video, how to make a specific route and have the AI follow it, not sure if you meant something else

  • @heavenseek
    @heavenseek Рік тому +4

    In part 1 we built the "BP_Enemy_Base" code (pt 1: 37:00 - 41:07). But it looks like that code got replaced by completely new code, of unknown origin, appearing here in this Part 2 at 8:16.
    I've spent a week on this tutorial. I've redone this and part 1 a few times now, and I can't get it working. Here's how mine works:
    Press "1" the first time: Enemy just stops patrolling and stares at me.
    Press "1" twice: Enemy slides along his patrol zone and continually unsheaths
    Press "1" third time: Enemy slides, then finally runs and attacks me.
    Press "1" fourth time: Enemy sheaths a few times and returns to his Patrol Path; the sword never disappears.
    After tearing out most of my hair, I gave up and downloaded the project zip. When I open that project and play, the Enemy AI faces me, unsheathes, and then runs behind a wall, faces the wrong way, and swings at empty space a few times.
    Is there a way to get a project download at the point where the action makes sense at the end-point of this video?

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +1

      Hey Heavenseek, so the enemy blueprint was not completely replaced with something else, as mentioned at 1:14, I just changed the WieldSword event and behavior tree task to include an animation and an event dispatcher, which I proceed to explain at 38:20. It sounds like your problem is likely with the wield sword event and behavior tree task, make sure that in the WieldSword event you dispatch OnWieldSword and in your task you bind to this event dispatcher and only call Finish Execute then, just like we did for the unwield task at 43:55

    • @heavenseek
      @heavenseek Рік тому

      @@AliElZoheiry Thanks, I'll search for those and try to fix.....

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +3

      @@heavenseek Hey man, I found a bug in the engine that might be causing your issue. It happened to me today when I restarted the engine, I found that the Blackboard keys on the "BTT_MoveToIdealRange" in the tree got reset and I had to manually select them again. Meaning that I had to Change the "IdealRadius to be either the AttackRadius or the DefendRadius (depending on whether I'm attacking or strafing) and the AttackTarget set it to AttackTarget as well. Hope this helps

    • @heavenseek
      @heavenseek Рік тому

      @@AliElZoheiry Thanks very much, I will definitely check that out! 🙏

    • @vidmaster7
      @vidmaster7 Рік тому +1

      This is exactly what is happening to me. I followed the directions exactly and have gone back through them several times. I can't see where the discrepancy is. I'll take a look at Ali's suggestions here.

  • @nassergreatdeveloper3745
    @nassergreatdeveloper3745 Рік тому

    guy be carfull when you name the varible inside the blackboard because it can be valid. do not name the the same name if you have more than one blackboard and also any thing in the engine. For example, when I add blackboard in the selector and press save in behavior tree, it gives me valid and I found out the reason is I have other blackbord key has simmilar name . I just change it

    • @AliElZoheiry
      @AliElZoheiry  Рік тому +1

      Indeed, also try avoiding reserved names like "Target" or "Actor" etc..

  • @ahmetozan4754
    @ahmetozan4754 7 місяців тому

    thank you for your efforts brother. my main language is not english. Selam in Turkey. I solved my problem. Press " 1 " not moving npc. Solution in " BT_Enemy_Base " > BTT_SetMovementSpeed > Movement Speed (in right) > Spritting. Not Idle :) I hope it was helpful :)

    • @AliElZoheiry
      @AliElZoheiry  7 місяців тому

      Hey Ahmet, glad you fixed the issue, well done 💪

  • @Secretlycat31
    @Secretlycat31 11 місяців тому

    Hello, I've made progress and have gotten up to Updating the Behavior Tree at 14mins and for some reason my ai isn't moving along to the next patrol route. I've doubled checked the creation of the MoveAlongPatrolRoute and it looks right. It move along and isn't being called even though in the behaviour tree it is being called but doesn't seem to run the BP_MoveAlongPatrolRoute. Any suggestions for what is going wrong?

    • @Secretlycat31
      @Secretlycat31 11 місяців тому

      I found it, I had missed connecting one line

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому

      Everything working now?

    • @Secretlycat31
      @Secretlycat31 11 місяців тому

      Oh if only :) I've broken down my current issue is coming from the MoveToTarget part on the Behaviour Tree. Atleast when everything is disconnected it isn't running past there. It just loops it very quickly and doesn't attack or do anything. Not sure why either so thats fun@@AliElZoheiry

    • @Secretlycat31
      @Secretlycat31 11 місяців тому

      What things would effect the MoveToTarget part? as I might have messed setting on one of them but going through them I can't tell

  • @shivc03
    @shivc03 3 місяці тому

    Amazing tutorial. I do have a small problem. When the enemy reaches one of the spline points it waits for halve a second and then continues to move again, but it doesnt smoothly continue as shown in your video. Any idea why this is happening?

    • @AliElZoheiry
      @AliElZoheiry  3 місяці тому

      It could be the character movement settings you have are different, things like acceleration and friction can affect the movement of your character. I am personally using all the default settings that come with the UE mannequin (except the things I changed in the tutorial)

  • @user-qi8cg6gi3w
    @user-qi8cg6gi3w 11 місяців тому

    Hello! Firstly, thanks to the author for the detailed tutorial, it helped a lot, secondly, can anyone help tell me how to link to the patrol line for the enemy after he spawns? that is, I do not have enemies at the level, they spawn at the beginning of the game. how do they get a link to the patrol line?

    • @AliElZoheiry
      @AliElZoheiry  11 місяців тому

      You're welcome. And to link the patrol route, simply pull a pin off of your enemy reference and call "Set PatrolPath" (or whatever you named the variable) and then either spawn a patrol path using "Spawn actor from class" or get a reference of your patrol path if it's already in your level using "Get actor of class" then use that reference to set the variable in your enemy

  • @showcast4371
    @showcast4371 2 місяці тому

    @AliElZoheiry buddy my AI whenever reaches the point of the spline it slows down and almost stops for a 0.1- 0.2 sec, is it possible to nake the movement smooth so that it won't stop on these points and rather run smoothly through the spine

    • @AliElZoheiry
      @AliElZoheiry  2 місяці тому

      The AI stops because the MoveTo task finishes and there is a slight delay till the next one (but it definitely shouldn't be 0.1 -0.2 seconds, more like 0.05) if you are experiencing a longer stop that what I have in my example, try playing around the the deceleration values on the characterMovement component (things like deceleration speed, ground friction, acceleration speed, etc..)
      If you want it to be completely smooth, then you'll have to start the next MoveTo task before the enemy reaches the next point on the spline, meaning that you have to check when the enemy is "almost" at the point, and then start to move to the next one

    • @showcast4371
      @showcast4371 2 місяці тому

      @AliElZoheiry thanks i got it how to fix it. Btw Amazing work👍🏻👍🏻🔥🔥

  • @oerealrap
    @oerealrap 11 місяців тому

    ur screen is very blurry whats the thing u search for at 5:02 to get current index ?