Smart Enemy AI | (Part 17: New Magic Spell) | Tutorial in Unreal Engine 5 (UE5)

Поділитися
Вставка
  • Опубліковано 19 чер 2024
  • Learning Goals:
    1 - Customizing animations using montages
    2 - Creating multiple attacks for the mage enemy
    2 - Calculating a random spread pattern for projectiles
    3 - Using different attacks in the behavior tree based on conditions
    To download the full project files from all my videos and use any assets I create in your own games for free, then join my Patreon. Also I would be forever thankful to my early adopters
    / alizoh
    Join my Discord server to chat and mingle with the community
    / discord
    Link to the full "Smart Enemy AI" Series:
    • Smart Enemy AI Tutoria...
    Link to the "Shooting Projectiles" tutorial:
    • How to Shoot Projectil...
    Link to the "Damage System" tutorial:
    • How to Build a Combat ...
    Checkout my other tutorials on my channel:
    / @alielzoheiry
    Chapters:
    00:00 Outcome of This Part
    01:06 Animation/Montage Setup
    09:07 Adding The New Attack Function
    11:45 Adding a New Projectile
    16:50 Random Projectile Spread Pattern
    20:32 Update Mage Attack Behavior Tree Task
    26:48 Handling Attack Interrupts
    28:51 Next Up In Part 18
    Assets used:
    Paragon Gideon Asset Pack: www.unrealengine.com/marketpl...
    Animation "Standing 2h magic attack 04" (from Mixamo): www.mixamo.com/#/?page=1&quer...
    About me:
    I've been learning game development for a few years now, I do 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 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.
    #unrealengine #unrealengine5 #ue5 #gamedev #smart #enemy #combat #AI #blueprint #tutorial #behavior #tree #behaviortree #mage #barrage #spell #attack
  • Ігри

КОМЕНТАРІ • 69

  • @zrmdevelopment7260
    @zrmdevelopment7260 7 місяців тому +2

    Let's gooo, amazing as always. Keep it up Ali :)

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

      Thank you so much ZRM, and thank you for the support on Patreon. I really appreciate you 🙏

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

    I've just came here from the part 5 of this series to thank you. The content you are putting is incredible, great teacher, with a great knowledge (and a very pleasing voice to hear btw haha). Your videos are helping me inmensely to build my project, and my hopes to have success with it are greater now that i am learning with you. Thanks!!!, looking forward for what is to come!.

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

      This is the best thing I've read all week. Thank you so much for the kind words, I'm really happy to hear that my tutorials have been helping you. I hope you enjoy what's to come as well 🙏

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

      @@AliElZoheiry Thanks, i am happy to read that. Have a good day!

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

    Brilliant content as always :)
    This has been the best Unreal Engine channel for learning AI development, hands down. Keep up the great work! I'm always looking forward to seeing what you are cooking up next . Your workflow has been so easy to follow, and everything makes sense.
    Stay blessed 🙏

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

      Thank you so much as always. Very happy to hear that the videos are still living up the standard you've come to expect of me :) I appreciate your support 🙏🙏

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

      @AliElZoheiry - Of course :). I'm always sending good positive vibes your way! I saw this upload go live and couldn't wait to square away time where I could implement this in the AdvancedAI I've got going based on all your tutorials.
      It was nice to sit with this for a while yesterday. Then, I will take the time to really study the changes to really soak in the knowledge and put it to use.
      You are much appreciated in this community! I really need to get on the Discord Channel at some point.
      Enjoy your week 🤙 Looking forward to the next lesson as always 😀
      Take Care ✌️🙏

  • @George-AlexandruPuru
    @George-AlexandruPuru 7 місяців тому

    Amazing series, keep it up

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

    Your series is very usefull. Thank you a lot!
    Just a question: Are you planning adding meele attack for player? And some parry system?

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

      You're welcome 😁 when I make the boss fight I'll see if the player needs more attacks to showcase the boss's defenses, so most likely yes

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

    (After u finish the tutorial)
    For anyone wondering why the mage doesn't attack with the barrage after cooldown, use a delay until next tick in the teleport function after that branch on false.

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

      Thank you for providing that valuable tip! I'm sure other viewers will find it helpful too.

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

    wow that some crazy AI

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

      Thank you 🙏 glad you think so 😊

  • @LEE-uk9pm
    @LEE-uk9pm 6 місяців тому

    I think this video is fantastic too, thank you. I have a question, but what if I want to make the mage enemy anticipate the player's movements and fire projectiles like in 'Part 15: Long Range Melee Jump Attack'? In a jump attack, we calculated the player's position after 1 second and then jump attacked, but in the case of a projectile, it must have a constant speed, so the time it takes for the projectile to reach the player will vary depending on the player's direction of movement, so more complicated mathematical calculations are required. I'm having my own concerns, but I'd be really happy to hear your opinion.

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

      You're most welcome, glad they are helpful.
      Regarding your question, it's not very complex math to calculate the where to shoot the projectile. If you know where the player will be in X amount of seconds, you can easily calculate how long the projectile will take to get there because the velocity vector is just Speed x Direction. So you either change the speed or the direction or both

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

      @@AliElZoheiry I just tried it and it worked, thank you Ali!

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

    Hello There, i realized theres a bug with the On Death event, that doesnt trigger it, and the enemies just keep alive with their health bar at 0% Any solutions?

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

      Not really aware of any obvious issues that could cause that, but try to debug your code to narrow down the problem area.
      I have a video on my channel on how to fix bugs, check it out if you need help

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

    any plan to revisit perception system especially the hearing function? maybe a little bit more in-depth explanation

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

      Haven't planned on it, but it could be interesting, do you have something specific in mind?

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

      @@AliElZoheiry i think reacting to the sound of player's magic spell or maybe triggering an alert meter when hearing footstep at a certain threshold from seeking to investigating or more insane. just create a new NPC that have a lot of senses with wide range and its ability is to scream or roar attracting nearby NPC.. i dunno just a wild idea xD

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

      Alright, thank you for the suggestions 🙏

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

    Hi Ali,Great job.Can you tell us the total numbers of these AI lessons in future.

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

      Hey, thank you, im glad you like them.
      I dont have a the entire series planned out because it also depends on input from people like yourself on UA-cam, Discord and Patreon, so it all depends on what the community wants. For now, im working towards a boss fight that will combine a lot of the things ive covered in this series, and from then it'll grow based on requests from the community

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

    Congratulations to all your hard working making those series. By far this is the best content I've found related with AI and battle systems. I learned a lot from your series, just keep doing it if you have time! Btw I'm having some problems with the projectiles. I have implemented the projectile system but I wanted that enemy projectiles only "hit" the player and the player projectile only "hits" enemies but Im not able to do that. "Enemies keep attacking each other and projectiles collides with others aswell", I saw the video related with team members but there, the enemies use line trace instead of spawn a projectile, so I wanted to know if there is a way to fix this behavior of projectiles?

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

      Thank you! Glad you're enjoying this series.
      The team system I setup in this series only prevents enemies from damaging each other, it doesn't prevent projectiles from colliding with other enemies. Because the projectile collision settings is set to "block" on all channels.
      If you want to be able to have the projectile ignore some actors and not others, then it should be changed so that it "overlaps" with all channels instead of "block" and you have to change the collision handling from "On Hit" to "On Overlap" and then you can check if you're overlapping with a team mate, then dont so anything, but if you overlap with a foe, then do the damage and everything else

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

      @@AliElZoheiry Thank you! it worked pretty good!

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

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

    Hi can you make a video on how to bake lighting in unreal engine 5?

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

      Hey, that's not really my area of focus right now, but I'll add it to my list of community suggestions

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

    Dude shortly tell me how can switch line trace by channel?
    I am sure issue it's line trace or your AI have have big problems..
    But, tell me how can change line trace by channel

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

      Hey man, what do you mean by switch line trace by channel?
      I am not having any issues with my damage system at all, It's working perfectly.

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

    thank youuuu , i would to ask you about aiming spell for AI

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

    @15:00, why not just make it a parameter to pass into the Magic Spell, that will allow any projectile to be loaded into the Magic Spell.

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

      Hahah you're already one step ahead, very nice! In the next tutorial, I'll be refactoring the attack system so that any character can use any attack, and then I'll be making that change to make the projectile a parameter indeed.

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

    If you're taking AI requests, I'd like to request a tutorial on how to get an AI to climb a ladder and then pull a lever/switch, please. 😊

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

      Hey, thanks for the suggestion, ill add it to the list 👍

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

    Hey Ali, you do amazing content!! Would love to reach out to you about potentially consulting as we're about to start planning AI Enemies for the next phase of our game development. In the description it says reach out via comments. Let me know the best way to get in touch with you if that's something you're interested in hearing more about, Have a fantastic week and hope to hear from you 🙏great stuff regardless

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

      Hey George, thank you, I'm glad you find this useful.
      Feel free to reach out to me through Discord, you'll find the Discord link in the description.

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

    I don’t understand why your AI is freezing. When I attack AI freezing. I made a video watch Amigo. How can I fix this?
    Amigo your AI have big bug's about melee attack

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

      I responded to your other comment

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

    What about multiplayer?

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

      For multiplayer, you'd need to add replication for the AI controller and the base pawn, but all the behaviour trees, EQS, and other AI systems that I used, only run client side and don't require replication

  • @QQ-jt7rs
    @QQ-jt7rs 7 місяців тому

    Please so sorry.
    I am know it's so funny question... . You can finished in Mid December. smart AI tutorial?
    I am really needs know when you finished and after this I I need buying character and weapons and more things. Fix everything.
    Just because I am said you

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

      Hey man, like I said, I really don't know when I'll finish.
      I have a fulltime job and I make these UA-cam videos in my spare time, while working on my own game, so I can't give you an estimate when I'll be done, I'm just trying to have fun with the process and not make it a stressful job

    • @QQ-jt7rs
      @QQ-jt7rs 7 місяців тому

      @@AliElZoheiry OK. OK sorry.
      Then when you finished I am starting making. Good Luck

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

    My dear teacher really amazing AI.
    I am liked everything and I am fixed my bug's.
    But, I am changed sphere trace by objects for Melee attacks. But again AI freezin
    I am Attacking my sword afraid AI freezing after I am again attacking... AI too attacks me but, after freezing again. Why it's work's like that? My dear teacher please help me

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

      Hey cody, not sure what the problem is, there must be a bug in your code. Checkout my video on how to find and fix bugs to help you narrow down the problem ua-cam.com/video/lflqdan_isw/v-deo.html

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

      @@AliElZoheiry my dear teacher I don't know how fix AI problems.
      I am mean it's not impossible. I don't know what wrong AI just stops not attacks.
      When I am Attacking AI freezing. Why? What's wrong I can't understand.
      Behavior tree works fine. Everything work's fine but, when I am Attacking AI just stops

  • @user-xb1jc7lf8x
    @user-xb1jc7lf8x 7 місяців тому

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

    Amigo I Have video in my Ch look this. Its about AI problems. when attacking melee weapons Your AI Freezing

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

      Hey man, as I mentioned before, it's impossible for me to know what bug you have in your code based on that description, so I suggest debugging your project to find the issue. Simply narrow down the root cause of the problem and determine the fix.
      You can find a video on my channel on how to debug your game

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

    My dear teacher, I am ready to give you how much money you want. You just can help me fix the problem with freezing AI

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

      Hey Cody, sorry you're still facing issues. Have you checked out my video on how to debug your game?

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

      @@AliElZoheiry Yes. I am debugging.
      Everything works great.
      But, when I am Attacking AI freezing

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

      @@AliElZoheiry I think problem is line trace. Just because when I am Attacking AI freezing. But projectiles works good

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

    Dude I am so tired! Sorry my words but, your combat code just not work's.
    Really dude write good combat bc.
    I can't damaged when I am Change line trace it's not work's.
    And very big problem When enemies attack, damage each other. When I attack the AI just breaks down. I found the problem is due to your Combat system.

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

      It works fine for me and for the thousands of people using it. So you just have some bugs in your code. I made a nice video on how to find and fix bugs, check it out and you might be able to find your issue

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

    Dude only you know how work's your combat system.
    I am seriously tired. Your combat system works only when player mage. But, not me & other people not want making mage player.
    Please fix this issue or change your combat system or make your own melee attack or tell people how make different combat system.
    Dude I am no beginner and please believe me I can buying AI from marketplace but I am liked your amazing tutorials and your AI. Please believe me your AI or combat system have seriously problems

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

      Like I said in the other comment man, the combat system works fine for me and for everyone else, and I use it for multiple projects. Make sure to debug your code correctly and find your issue

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

      @@AliElZoheiry Dude you will helping me? Or not?
      I am already debugging issue only your combat code.

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

      @@greatma2521 chill bro