Smart Enemy AI | (Part 6: Ranged Enemy Behavior) | Tutorial in Unreal Engine 5 (UE5)

  Рет қаралды 25,679

Ali Elzoheiry

10 ай бұрын

In this Unreal Engine Game development Tutorial you will learn the following:
- Ranged EQS Movement: How to create a custom EQS specifically for ranged enemies to find the best position
- Line of Sight: How to maintain Line of Sight (LoS) between the player and the enemy
- Healing: How to get the enemy to run away, hide and heal when their health drops below a certain percentage
- AI fighting Each Other: How to get your enemies to fight each other while you sit back and watch the show
Link to my Patreon (Thank you for your support)
www.patreon.com/alizoh
Link to part 1 of the "Smart Enemy AI" tutorial:
kzbin.info/www/bejne/Y6WWgZV9h8atgck
Link to the "Damage System" tutorial:
kzbin.info/www/bejne/pWTYd4ukg92qgac
Link to the "Projectile System" tutorial:
kzbin.info/www/bejne/npy0apV7rNWZjJo
Link to my "AOE Damage & Healing" tutorial:
kzbin.info/www/bejne/eaDRgGd9Zc9sras
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 and love of 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 KZbin 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.gg/AEnM4wvYzN
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
www.patreon.com/alizoh
Checkout my other tutorials on my channel:
kzbin.info/door/rrZx9bh7RMYhXvaN8BrbNg
Chapters:
00:00 Outcome of this part
00:30 Update Ranged Behavior Tree
02:50 Update Ranged Enemy Properties (Speed & Range)
04:38 EQS for Ranged Enemies
16:04 Creating the Shooting Rifle Function
20:47 Maintaining Line of Sight Between Enemy & Player
27:30 Find Cover When Health is Low
37:28 Healing When Hiding
41:35 Getting the Enemies to Fight Each other
42:52 Next Up in Part 7
#unrealengine #unrealengine5 #ue5 #gamedev #smart #enemy #combat #AI #blueprint #tutorial #behavior #tree #ranged #melee #EQS

Пікірлер: 181
@soulz-fn4230
@soulz-fn4230 7 күн бұрын
This Guy just brings a smile to my face. Your a proper legend man
@AliElZoheiry
@AliElZoheiry 6 күн бұрын
Thank you so much, your words mean a lot to me! 😊
@alexstewartallred
@alexstewartallred 10 ай бұрын
Please don't stop making these. Your tutorials are saving my game and my sanity ;)
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you! I'll make sure to keep it up, thank you for the support and I hope you enjoy the rest ;)
@Shino2213
@Shino2213 10 ай бұрын
I wanted to personally thank you for not just this series but for a bunch of your other videos too. They have been immensely helpful. And I love the fact that everything has been broadly applicable, oh and your teaching is cracked. Wishing you all the luck and success fam. thank you again.
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're very welcome Shino, and thank you for your support, I hope to continue putting out content that you enjoy 🙏
@Shizuma450
@Shizuma450 10 ай бұрын
Incredible as always. Incredible quality, careful explanation, relevant and precise. And I'm really learning some excellent things. Thank you for this incredible content! 10/10 easy
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you for the kind words, very happy to see that this is helping you and I hope to continue helping :)
@MBAalrightgames
@MBAalrightgames 7 ай бұрын
First video of the series for me, popping by to figure out how to convert my melee AI into ranged. Thanks for the series of videos - it looks like you've put a bunch of effort into this. I am very grateful, thank you!
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Thank you for saying that. I definitely put a lot of effort into making each video, they were carefully planned, scripted and executed, so I'm very happy to hear that you see that. I appreciate you 😊🙏
@oliver7garcia31
@oliver7garcia31 3 ай бұрын
Ali you are a great man, I love your methodical way of working, you make programming a lot of fun, thank you!
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Hey Oliver, thank you for your kind words! Glad you find my videos useful and fun 😊🙏
@Skittlez
@Skittlez 4 ай бұрын
I am LOVING these tutorials! Honestly one of the best AI series i have found yet. I never really fully understud how BPIs work but the way you use them and explain the usage of the functions just made it sink in so easily. Also for people having issues with the line of sight ( as i was ) if you have anything blocking the character mesh like a shield in my case make sure to also check ignore visibility for the collisions otherwise it will cause a loop in the move to line of sight!
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
Thank you 🙏 I'm really glad they were helpful and that my teaching style is working for you. I appreciate you 😊🙏
@diliupg
@diliupg 9 ай бұрын
Fantastic series. Better than the AI tutorials I've paid for on Udemy. Thank you for these great lectures.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
You're most welcome Diliupg, and thank you for all your kind words and support 🙏
@RoxRan1
@RoxRan1 2 ай бұрын
Also here after udemy purchase that didn’t give me what I needed
@Snafuey
@Snafuey 10 ай бұрын
Another great tutorial in the series! Thank you so much for doing them.
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're very welcome, and thank you for continuing to watch them and supporting me 🙏
@ryzen3327
@ryzen3327 10 ай бұрын
Thanks again, great video tutorial, I'm so excited to have found your channel 😃👍
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're most welcome, I'm also excited to have you as a viewer, thanks for the support 🙏
@hasu36
@hasu36 10 ай бұрын
thats some very advanced stuff thats insane 😁
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Glad you enjoyed it 🙏
@peterjuee558
@peterjuee558 8 ай бұрын
Thank you for your video, which can make my game's AI smarter than before.
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Awesome! Glad I could help!
@harbormaster6050
@harbormaster6050 10 ай бұрын
I just had to subscribe. These tuts are very well made.
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you for your support 🙏 happy to hear you're enjoying my videos and I hope you enjoy everything that's to come
@zipzapper9356
@zipzapper9356 9 ай бұрын
This series is really useful,I can't believe it's free
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Thank you! I'm just happy that I could help people with this knowledge, and it's also fun making these videos. Also a few people have supported me on Patreon by paying for the source code. It's a small gesture but it means a lot to me, so I'm thankful for them 🙏
@zipzapper9356
@zipzapper9356 9 ай бұрын
Can you show me how to set up a team, such as 2v2@@AliElZoheiry
@iyukisen
@iyukisen 10 ай бұрын
Thank you for this wonderful tutorial. I'm also a software developer and I've learned your different approach / way of logic. And wishing you all the luck and success especially on your on going solo game dev that you're working on. Cheers!
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're very welcome. Glad you found it useful and good luck on your journey ;)
@user-pn3ut7rw6c
@user-pn3ut7rw6c 3 ай бұрын
Thank you for these great lectures. Like.
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
You're very welcome! Thank you for your kind words and support!
@muntasirdawlut
@muntasirdawlut 6 ай бұрын
Hey Man this is an Absolute gems of tutorials and this is making my game look really good thanks a lots 🤩 For those who have an issue with the Line Of SIght at 27:00, once you did all these, make sure that the Line Trace Channel is set to VISIBILITY and then make sure that your character that you are playing with ignore the VISIBILITY trace collision in both mesh and the capsule component, this should make it work.
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
Thank you 🙏 Glad you liked them!
@user-cq7jd5ho2v
@user-cq7jd5ho2v 2 ай бұрын
Man you just saved me! Thank you. God bless you.
@Aestareth_
@Aestareth_ 2 ай бұрын
personally i added the blackboard actor to the actors to ignore array
@andrews8110
@andrews8110 2 ай бұрын
Why did it work in Ali's without that?
@muntasirdawlut
@muntasirdawlut Ай бұрын
@@andrews8110 lol i don't know, maybe he already fixed that or something as he use a fresh template and maybe we are using our own custom build onto the default template
@callatogames
@callatogames 10 ай бұрын
You are making great contents, thank you so much bro! I really appreciate that!
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're very welcome 🙏 and I appreciate the support so much
@A.D.A.M.411
@A.D.A.M.411 8 ай бұрын
Ok first off I have to say how grateful I am that you've been so generous with your knowledge of this subject. So Thank you and by the comments and they way you have replied to everyone is just rare and speaks volumes to your character. Ok with that out of the way back to the game. So I just finish with the the ranged attacker but for some reason he isnt looking at me as he fires but i do get the line trace to me and everything else is working perfectly. some things to note are i am not using any of the Manny's however have converted converted the anim bp to my character except the(control rig and disabling the LegIK) but if that is the issue let me know... Thanks again and seriosly I hope you keep blessing us with your wisdom! :)
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Hey Adam, I really appreciate your kind words and support 🙏 I love sharing my knowledge and helping people, and I'm happy that you value that as well. Regarding your issue, there are 2 things that are responsible for getting the character to look in a specific direction. 1- it's the SetFocus function that we call on the AI controller 2- it's the rotation settings on the character movement compound in your enemy pawn. You should have "Use controller desired rotation" checked and "Orient rotation to movement" unchecked. Double check these things and hopefully that will fix your issue
@MrPsycotik2002
@MrPsycotik2002 7 ай бұрын
i learned a lot! thank you so much for your hard work
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
You're most welcome 🤗 happy you find this useful and educational 🙏
@willlieberman5911
@willlieberman5911 3 ай бұрын
Amazing tutorials!
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Thank you so much! I'm really glad you're finding the tutorials helpful. 🙏
@natecoet3291
@natecoet3291 10 ай бұрын
Good stuff nice to see an AI series so we'll explained and made 😊
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you 🙏 Really happy that you're enjoying it and finding it useful
@JonWith1n
@JonWith1n 16 күн бұрын
Again a great turoial ! Well done, hope you will keep at it !! I Have so much to learn from you ^^ ! One issue tho, when the range AI doesn't find a cover point it just stop and run the query in a loop, I can't figure out how to fix it yet, but it's a good exercise !
@AliElZoheiry
@AliElZoheiry 13 күн бұрын
Hey there! Thank you for the kind words! I'm thrilled to hear that you found the tutorial helpful! As for the issue with the range AI, it sounds like an interesting challenge, and I'm sure with a bit of troubleshooting, you'll find a solution. Good luck and happy learning! 🙏
@JonWith1n
@JonWith1n 11 күн бұрын
@@AliElZoheiry Thanks for the answer :) Sadly, i think I will give up for now and just design so there is always a cover point -.- ... thought I had something with a custom task that run the querry and get the result as an array of locations but the lenght of the array is always 0 even when the EQS find a valid location... so it doesn't work either, and if the query doesn't find a valid location it will keep looping over and over, I need something I don't know yet I think so the query stop when no location is found... but I can't get my head around it ... I must keep learning I guess ^^ !
@AliElZoheiry
@AliElZoheiry 11 күн бұрын
@@JonWith1n A simple solution is to put the EQS task in a "selector" in the behavior tree, and if it can't find a location, it will fail, triggering a backup task in your selector (which should be placed on the right side) that way you can get a random location or do something else if the EQS fails to find a location
@JonWith1n
@JonWith1n 11 күн бұрын
@@AliElZoheiry Oh ... it was that simple -.-, I kinda feel dumb for not getting it on my own but I got a better understanding of the selector node now. Thanks a lot again for taking the time to answer me, if eventually you end up puting a paid course on udemy you can count me in !
@Jockyjeevan
@Jockyjeevan 10 ай бұрын
Keep doing it bro 💙
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you! I'll try ❤️
@lolaswift111
@lolaswift111 10 ай бұрын
Heel erg bedankt Ali.
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Alsjeblieft Lola 🙏
@ryan5412
@ryan5412 3 ай бұрын
Just wanted to comment an issue I had that others might. When making the Move to Line of sight sequence at 21 - 27 min If the EQS grid isn't big enough the AI will break as it can't find a move to point until the player comes back in range. PS this series is great. Thanks for the in depth tutorials
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Hey Ryan, thanks for the addition, and thank you for watching, glad you found it useful
@mikelkram
@mikelkram 5 ай бұрын
can also use node "Line of Sight To" to check the line of sight between the player and the enemy
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Thank you Mikel, you just taught me something new. I didn't know about this node 🙏
@derakon4791
@derakon4791 10 ай бұрын
Thank you
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
You're very welcome ;)
@HusmanGames
@HusmanGames 3 ай бұрын
Just an obligatory thank you again, on to part 7! Was wondering would you advice to first follow the whole damage tutorial or do you think I'll understand the workings of it if I migrate it into my project like you're doing in the next video?
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Thank you for watching and commenting ☺️🙏 I would recommend at least looking at the damage system to see how it works, and if it's clear then no need to watch the full tutorial, but if it's not clear from the code, then I suggest watching it first before moving on
@HusmanGames
@HusmanGames 3 ай бұрын
Sounds good!@@AliElZoheiry
@AdamWoolnough1981
@AdamWoolnough1981 Ай бұрын
you are doing great, should we be casting every time an enemy shoots something, interface works ok for me to get location
@AliElZoheiry
@AliElZoheiry Ай бұрын
Thank you for your comment! Glad you're enjoying the videos. Depending on your use case, a cast can be sufficient, but if you want to avoid it, of course interfaces are a good solution for that
@rezaj.mousavi7310
@rezaj.mousavi7310 10 ай бұрын
greate... pls make a video for physical animation hit reaction bullet when shooting to enemy ... thanks alot
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
In the next video I'll be covering hit reactions, but not physical animations, just regular hit reaction animations
@nikgiak2994
@nikgiak2994 5 ай бұрын
@AliElZoheiry , amazing series! TYVM! Probably a future patreon here :) Only two things. First, I'm suffering to interrupt and update the "Move to Line Of Sight". It seems that the "Can see Target" decorator from the "Evade" branch is not interrupting the other branch's "Move to". Even in your video, at 27:04 - 27:07 (it reaches first the old line of sight) ,you can see the npc not interrupting the "move to" when trying to find another new position. It reaches the old one first and then moving to a new one. Any ideas? The second is a suggestion if I may: How about another episode, creating a pet npc with its own BT (perhaps combat pet), to follow this NPC, accept commands etc. Ty again, b well!
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Hey Nikgiak, to have a decorator interrupt the currently executing branch, you need to set the value of "Observer aborts" which is an option on the decorator. Observer aborts = lower priority, means that if the value becomes true, it interrupts any lower priority branches (branches on the right) and immediately starts executing the branch with the decorator Observer aborts = self, means if it is currently executing the branch with the decorator and it becomes false, then it interrupts itself and moves on to the next branch. Hope this helps, and I will surely consider the pet AI, a few people asked for something similar as well
@nikgiak2994
@nikgiak2994 5 ай бұрын
Hey@@AliElZoheiry ! Thank you for taking the time to answer! I do have it set as "both". It does interrupt then it sees the player while searching for a line of sight position but it does not interrupt while moving to a line of sight position but the player moves again and that line of sight position is not good anymore. Instead of stopping the current move to line of sight and run again the "move to line of sight" sequence to find another position, it finishes the previous move to first. You will notice the same happening in your video/code as well at 27:04 (it reaches first the old line of sight). Now, if the query grid is big, the NPC will run far until moving to a new line of sight. Can't wait for the Pet tutorial!!!
@nikgiak2994
@nikgiak2994 5 ай бұрын
UPDATE: Ok, this is happening because the BT Decorator "can see player" remains false while the player moves in different "out of sight" positions hidden, while the NPC is trying to reach the old ones. There is no change to the decorator variable, this is why the sequence is not interrupted.
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
@@nikgiak2994 Makes sense, sounds like smart behavior. If the player remains out of sight, the enemy goes to the location where they think the player will be visible.
@nicbleu
@nicbleu 8 ай бұрын
I wonder if you know anything about the new machine learning plugins called learning agent, using machine learning can be good if you want to have unpredictable behavior, also complex terrain where an agent need to follow a player that is jumping on platform , in a un-scripted way like the nav mesh bridge for jumping. I could only imagine creating simple neural network to make tasks for the behavior tree. I think it would be very fun to combine the two. Do you think it could be done ?
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
I haven't heard of the plugin, but I've read a lot of papers doing some very cool stuff with machine learning and characters in game. It's all possible to do in Unreal, it will definitely require a good amount of knowledge of both C++ and machine learning, but it's possible
@kuchukboromdebbarma2117
@kuchukboromdebbarma2117 4 ай бұрын
the amount of training you will require is gonna be insane trust me. Almost impractical for shooter AI
@atzevr6887
@atzevr6887 8 ай бұрын
nice👍
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Thank you!
@Xsabino1
@Xsabino1 9 ай бұрын
"Hello Ali, Just dropping by to express my heartfelt gratitude for your incredible tutorials on BehaviorTree in the Unreal Engine. I'm truly impressed by how informative and easy-to-follow they are. Each video has helped me grasp the concepts in a clear and practical manner, and I now feel much more confident working with this technology. Your teaching style is engaging and user-friendly. Thank you for dedicating your time to create these high-quality tutorials. They've made a tremendous difference in my learning journey. Keep up the excellent work! I can't wait to see more content on your channel. Thanks again and keep inspiring the community! Best regards, ClarkSabino"
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hey Clark, Thank you so much for your kind words and support, I'm really happy to hear that my tutorials have been helpful, this is exactly what I make these videos and your words are really motivating, I hope you enjoy the rest 🙏
@thedefaultcube1218
@thedefaultcube1218 10 ай бұрын
Thank you. Amazing series. Subscribed. If you keep up this level of content will join patreon. Quick question, dose the system scale well? MMO with client and server, multicasting. Im looking to get a horde of zombies (say 20) and soldiers say (10) so would this sytem work with other clients and these NPCs all acting out there AI logic with eachother and players? Thank you in advance. Awesome you take the time to answer everyone
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you 🙏 glad you are enjoying it! I will try not only to keep up this level, but hopefully keep improving. The system itself will scale easily, but so far everything we've done is not server replicated, so it's going to function for single player games only, and generally speaking the AI tools in UE are made with single player in mind, though they can be extended for multiplayer with some extra effort. Regarding scaling to hordes of enemies, that is also no problem but it will highly depend on your enemies behaviors. If each enemy is running a complex EQS on every tick, then having 50 enemies at once will definitely take a toll on your machine. So you will need to optimize your behavior tree, but everything we've done so far is not programmatically expensive at all and scales well
@85matticus
@85matticus 9 ай бұрын
Best video series ever. Very informative. I am having a hiccup with the ranged character. When I hit play the range character zooms across the screen as far away as possible ignoring the eqs. Any suggestions? It seems to do this no matter what EQS I use.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
If he's moving weirdly, just like sliding very fast across the map, then that probably means that the capsule of the character is colliding with a mesh that's attached to it. Make sure your weapon collision is set to "No collision" and same goes for anything you attach to the character
@85matticus
@85matticus 9 ай бұрын
So problem solved my weapon had collision on. Now everything works great keep up the good
@85matticus
@85matticus 9 ай бұрын
@@AliElZoheiry that is so funny I just sat here and figured it out went to add a reply to the comment and didn't even see yours. thank you for the quick reply though. What gave it away was I put the range behavior on the Melee character and everything worked fine so I just thought maybe the collision LOL
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
@@85matticus awesome! Glad it works now, and better that you figured it out on your own, that's the best way to learn 😉
@vidmaster7
@vidmaster7 10 ай бұрын
Hi, Ali. I really appreciate the hard work you have put into all these tutorials. I have followed the tutorials for the Combat Damage System (that was the first one I did), Projectiles, and all the Smart Enemy AI series. I am working through AOE damage and healing. The problem I have is that there are lots of conflicts with the various systems. I'm not doing them as separate projects. I'm doing them in one project. That means, for example, that I have a BPI_EnemyAI AND a BPI_Damageable. Some of the code is calling GetMaxHealth from one and some from the other. There are other items that are named completely different names. Do you have any tips on how to untangle all this? Thanks.
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
That's exactly what I'll be tackling in the next video, integrating the damage system with the AI series, and using the BPI_damagable interface along with the BPI_enemyAI in the same project. The hint is that the Damageable interface will be responsible for health and anything to do with doing/taking damage, and the enemy AI interface will be responsible for all enemy actions
@vidmaster7
@vidmaster7 10 ай бұрын
@@AliElZoheiry That is great news. I think I'll take a break from the functionality of my game and work on the environment. I'm looking forward to the new tutorial.
@Im_pro_true16
@Im_pro_true16 5 ай бұрын
Thank you for your videos ali, one question how will I make the ranged enemy shoot an actual projectile?, because I am making an enemy that uses a bow and arrow, again thank you for your videos, please don't stop making videos :>
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
You're very welcome 🙏 for shooting projectiles, checkout the later videos where we add a player attack (where the player shoots a projectile) and checkout the mage enemy also that shoots a projectile
@Im_pro_true16
@Im_pro_true16 5 ай бұрын
@@AliElZoheiry thank you
@sanzzzen842
@sanzzzen842 3 ай бұрын
Hello Ali, thanks for the great tuto. I would like to know at 14:34 the enemy get too close to the target and I don't want he cross near me. Didn't find how to manage. It is possible to get around the target some extra blue sphere, same you did for the enemy at 12:45? Cheers
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Hey Sanz, glad you found this useful. You can definitely play around with the EQS, add some more tests such as distance to querier to make sure the enemy doesn't go too far from their current position. Or you can change the shape of the grid all together, you can think of generating points infront of the player only. Or you can also add a "Dot test" to eliminate any points behind the player. So you have options, just keep trying new things and learning about EQS and you'll find what suits you.
@POPCORNGameMovia
@POPCORNGameMovia 10 ай бұрын
Hey Ali :) Very much appreciate your time and effort put into this tutorial series, helped me a lot :) I would kindly ask you a question please: How do I spawn the enemies in world using same ABP, but to behave independently. Currently having 3 AC on my AI (combat system, Enemy Stats and Inventory), but if I do spawn them with a simple "spawner" only the first one can deal damage, the others are not, and also if I hit one of them, all of them react to the hit, regardless if they are away and not being hit. I know, I am a noob on this :)) but definitely is simple to do this, but I am missing the correct nodes and logic to spawn them. (did used "SetAicontroller", did used "SpawnAifromClass" and did selected the behavior tree and class). Any suggestion on this please? Thank you and thank you! Keep it up! :)
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Hey! Happy to hear that this has been helpful 🙏 Strange that your enemies are behaving this way, this shouldn't be the case even if they are using the same AC and same ABP, because when you spawn an enemy you create a new instance of all their components. The only reason I can think of is if your enemies share some behavior that is not part of the spawned instance, but that would be a very strange implementation 😅
@POPCORNGameMovia
@POPCORNGameMovia 10 ай бұрын
@@AliElZoheiry Thanks for your reply! Yeah the only behavior shared is the behavior tree. Somehow I think I fixed the playing animation on all instances, but the attack system still does not work. Might it be for the fact that some actions are casting to a specific actor? I mean if you cast to AI Enemy Base, it spreads on all chield and instances of that actor, altho' the Combat AI AC is individual on all instances. A weird thing i've noticed is that sometimes there are 2 enemies that can perform the Attack Line Trace, out of 10 of them like. I even tried to duplicate and implement all of the components (BT, BTT's, ABP etc) and that somehow worked, but only for the single instance of each AI. If I do spawn multiple from same class I get the same result. Have to investigate more. Thank you and waiting for the next video on the series :)
@POPCORNGameMovia
@POPCORNGameMovia 10 ай бұрын
@@AliElZoheiry UPDATE: I am sharing this here so maybe someone else will find it helpful. The AC where I have all combat logic is not shared, meaning that only the master was accessing it, but not other instances of the AI. I moved part of the logic into Base AI and now all of the instances deal damage. Now the question is why they do not work with the AC? I do want to avoid casting too much, and try to split everything so it is reusable for other AI, this is why everything I build is in AC's and interfaces. Any suggestions or opinions? PS: Combat AC is the only one not working, the other are doing just fine. Thank you!
@POPCORNGameMovia
@POPCORNGameMovia 10 ай бұрын
@@AliElZoheiry LAST UPDATE It was a bad implementation of the ATK Line Trace. All good now! We are learning everyday :)
@carlosbueno3534
@carlosbueno3534 2 ай бұрын
Hey man, your videos are great! Thank you so much for sharing this. I have managed to implement most features up to this part but I am currently having a problem with the pathfinding of the find cover. The enemy moves in small steps for some reason instead of moving directly to cover. This means that the enemy stops every two seconds, looks at me, and heals before getting to the point of interest. So basically the move to task is finished before the enemy goes where it should. Do you have an idea where the cause may lie?
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Hey there! It sounds like the enemy is actually hiding behind themselves, so they think that they are a point of cover and they move one step back, then heal (thinking they are behind cover now) then realizing later they are not (because they just moved) and then they move one step back and repeat. At least that's my assumption based on your description. If that's the case, then the line trace to find cover is being blocked by the enemy or something the enemy is holding, so make sure that the mesh and the weapon on the enemy DON'T block the "visibility channel" in their collision settings
@carlosbueno3534
@carlosbueno3534 2 ай бұрын
@@AliElZoheiry Thank you very much! That was indeed the case. Because I have hitscan weapons in my game, the collision for the visibility channel on the enemy was on. I have created a new trace channel for the hitscan weapons and disabled blocking on the visibility channel of the enemies and it works now. 👍
@Atl3m
@Atl3m 10 ай бұрын
Did you ever add loose interest when out of range or age. , Os my stuff not working for this or was it never added ? I cant see i added this anywhere
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
No, I haven't shown how to exactly do it, but I did explain in passing that similar to the CanSenseActor function we created in the AI controller, you can follow the same approach to check if you can no longer sense an actor
@Atl3m
@Atl3m 10 ай бұрын
@@AliElZoheiry but this function still have the character in memory dot it ? it wont forget the character but move to location wher character is in sight correct ? its that part of the tuthorial you are talking about ?
@hello-qq7fh
@hello-qq7fh 9 ай бұрын
Hey good tutorial, I dont like how much you do off camera and I would prefer if you disable discord notification sounds.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hey, Thanks for the suggestions, I'll definitely keep it in mind for later videos
@jingjieng1410
@jingjieng1410 6 ай бұрын
Yo, I really appreciate all your effort. I just have one problem with my project. This is regarding the last part of your video where you show how to make enemies attack each other. When I simulate the game (My player character isn't in the map), my melee enemy attacks my ranged enemy (this is not the issue), but my ranged enemy is attacking my Player Start. But when I play the game, the ranged enemy is still attacking me and not the melee enemy. Please help me fix this issue.
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
Be aware, that when you "Simulate" you spawn a "Spectator pawn", which your AI can see & attack, that's probably what you're experiencing
@sara-uh8xy
@sara-uh8xy 10 ай бұрын
XD will u cover a video on how bosses are made similar to elden or dark souls? by the end of this series
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
By the end of this series, you'll have the knowledge to create any type of enemy with complex or simple behavior, depending on your game, but I haven't decided yet whether I'll showcase a boss enemy type or not. Might be a good idea to actually do that, I'll consider it
@natecoet3291
@natecoet3291 10 ай бұрын
I plus one this comment, there are nontutoriald on Boss AI so that would be a great addition.
@indexofpixels
@indexofpixels 4 ай бұрын
im having trouble with the bpi, the function wont come up in my character.
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
Make sure to compile the interface
@Furios_Ethan
@Furios_Ethan 3 ай бұрын
Hey im stuck at this part where for some reason the ai would not move to me at all only started doing it after i connected the default attack in the Range BT i did the build level thing restart the engine nav mesh obliviously works cuase the mellee enemy does its eqs but stops before default attack and would be stuck there forever please help me
@Furios_Ethan
@Furios_Ethan 3 ай бұрын
After investigating the BT it fonds out if i take out the default attack and replace with move to it'll actually move to me so yeah its the default attack that im having an issue with if you changed it after ep 1 please let me know
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Hey Furios, it sounds like you either don't have a default attack implemented, or you don't dispatch the AttackEnd event correctly, so make sure you're doing that so that the default attack task would succeed
@ahmetozan4754
@ahmetozan4754 5 ай бұрын
In the EQS system, the character does not move smoothly. It goes and then stops. It goes for a short time and then it stops. What could be the solution?
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Hey Ahmed, if there is a wait node in your behavior tree after moving to a point then your enemy will wait a bit after moving. But in general if you move the enemy to a point, then start calculating a new point to move to, there will be a short, but noticeable delay between moving to one point from another. To get around that you have to already have a new EQS point calculated before the enemy reached their current destinations, and then have your enemy move to the new point when the get close to their current point, instead of when they actually reach it
@ahmetozan4754
@ahmetozan4754 5 ай бұрын
@@AliElZoheiry yuo are number one bro :)
@Leonardo-zb6ho
@Leonardo-zb6ho 2 ай бұрын
Hello, thank you for the tutorial, it's been very good so far. Though, I have a problem with the ranged enemy: it just moves back and forth in the same direction instead of selecting a random point in the grid. I've seen that it creates the grid around the player and assigns different values to them, but the enemy just travels from one corner to another of the grid without stopping on some intermediate points. Also my keyboard doesn't have the numpad, so I don't know how to open the debug settings during the gameplay to see the grid
@osmanbaba1485
@osmanbaba1485 2 ай бұрын
I believe to rearrange keys it was Edit > Project Settings > Gameplay Debugger then you can change to other keys. As for your other issue have you remembered to disconnect the EQM context from the player start to attack target.
@Leonardo-zb6ho
@Leonardo-zb6ho 2 ай бұрын
Nevermind, I forgot to select "25% random" in the EQS settings. I still don't know how to see the grid though
@Leonardo-zb6ho
@Leonardo-zb6ho 2 ай бұрын
I'm now seeing this, thank you so much :)
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Nice! Glad you figured it out!
@user-vd8sb8gb4t
@user-vd8sb8gb4t Ай бұрын
I have a problem where AI can't attack to each other, even thou I disconnect the condition where the player is the only target, help pls
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey there, if the AI can attack the player but not each other, then I suggest debugging the perception settings, if they perceive each other (you can find that out using the AI debugger) but they still don't attack, then it's likely related to your "attack condition" not the perception
@gamersantai7796
@gamersantai7796 9 ай бұрын
CanSeeTarget decorator makes my NPC constant pacing around between 2 points and not attacking, but it chases if Player is out of sight, is there any solution for this problem?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Not sure why that's happening, try to debug your behavior tree and see what nodes it's switching between and try checking your collision presets making sure that the trace from that decorator isn't hitting something that it should not hit
@gamersantai7796
@gamersantai7796 9 ай бұрын
@@AliElZoheiry yeah so i was using AlsV4 char as Player, changed the AlsV4 collision presets the same as ThirdPersonCharacter and it works
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
@@gamersantai7796 indeed the default third person character has the visibility channel ignored on both the mesh and the capsule, so that's important for this to work
@alawlol5459
@alawlol5459 8 ай бұрын
Hi! I've got a problem with the health. My enemy just heal 0.3% not 100% like yours and i don't know why this happens
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Make sure you're calculating the health percentage correctly and passing the right value to the heal function. If it still doesn't work, feel free to join the Discord and ask your question there (link in the video description)
@ohtontheknight3879
@ohtontheknight3879 8 ай бұрын
I got a problem for some reason if the enemy see an enemy while investigating it goes in to attack state and just goes for the player
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Check your handle sense sight and make sure it's setting the attack target correctly
@ohtontheknight3879
@ohtontheknight3879 8 ай бұрын
​@AliElZoheiry been looking at it and everything looks the same
@rugbyf0rlife
@rugbyf0rlife 9 ай бұрын
So far these guides have been fantastic, but I've run across my first major snag that I can't seem to solve despite copying these BPs and trees pretty much exactly. At 27:00 you implement the LOS interrupt decorator for the LOS search and attack and evade sequences. However, no matter what I try, I cannot get this to run properly. It only ever loops in the "get LOS" sequence, continually walking back and forth despite the player being within LOS. My decorator is set to attack target and abord is set to both. I just can't understand what I'm doing wrong at all. The only thing I can think of is if there's some issue with my line trace detection specifically with the LOS Decorator, because the EQS for both other tasks work perfectly. Everything works perfectly in fact, aside from the decorator interrupting each sequence. Any pointers would be appreciated. At this point Ive given up and moved on to other videos, but I worry that it's going to come up and bite me in future if I don't nail this bug now.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
In your CanSeeTarget decorator, is the line trace hitting something? Try adding a print statement to see if it is
@user-vd8sb8gb4t
@user-vd8sb8gb4t 9 ай бұрын
Use a branch in after the return node CanSeeTarget Decorator
@kellowattentertainment
@kellowattentertainment 9 ай бұрын
Bro, I'm having the same issue. I even did the line trace debug and the player is seen which means that it is working.
@kellowattentertainment
@kellowattentertainment 9 ай бұрын
@@user-vd8sb8gb4t ok what do I connect the branch to?
@user-vd8sb8gb4t
@user-vd8sb8gb4t 9 ай бұрын
@@kellowattentertainment its ok to use the not boolean node in the return value of CanSeeTarget, Inverse the condition of CanSeeTarget in the range behavior tree it should work
@mmmmm1438
@mmmmm1438 10 ай бұрын
can i make ai model in unreal engine 5
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
In unreal engine you can write C++ code, so if you can create your models in C++ then you can integrate it with the engine code as a regular class, but it will require a good amount of knowledge on how unreal engine works in C++
@loffy7138
@loffy7138 10 ай бұрын
Братанчик, продолжай ебашить, топовый у тебя контент
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Thank you Loffy 🙏
@projectgg6730
@projectgg6730 15 күн бұрын
I feel like there's a lot of casts?
@AliElZoheiry
@AliElZoheiry 13 күн бұрын
Thank you for your comment! 🙏 In this case, using casts is essential and has no impact on memory since the actor we are casting to is already loaded in memory, thus casting has no impact on performance
@projectgg6730
@projectgg6730 12 күн бұрын
@@AliElZoheiry I see! That's good to know thank you
@Atl3m
@Atl3m 10 ай бұрын
Oh no I'm at the end 😢
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Part 7 coming very soon
@Atl3m
@Atl3m 10 ай бұрын
​@@AliElZoheirycan't wait ❤
@haythembenhaddada9988
@haythembenhaddada9988 10 ай бұрын
Hi brother please can you make tutorial about how to parry the gun shooting with a sword
@AliElZoheiry
@AliElZoheiry 10 ай бұрын
Hey Haythem, I will be covering parrying, blocking and hit reactions quite soon in this series, hopefully it will give you what you need
@haythembenhaddada9988
@haythembenhaddada9988 10 ай бұрын
@@AliElZoheiry you are the best i'll be waiting
@pranjalbhattacharjee5601
@pranjalbhattacharjee5601 4 ай бұрын
Check out this series on my channel for a much more advanced ai system kzbin.info/aero/PLIv-clKUyrYIlyqOExegLcRRVkxs6Sskf&si=IcS5xT4zeOpBkbt3
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
Looks cool, it's a bit outdated though
@pranjalbhattacharjee5601
@pranjalbhattacharjee5601 4 ай бұрын
@@AliElZoheiry yeah but all the things apply to 5.3 aswell.....I will update the series in the future
@Smyyytth
@Smyyytth 3 ай бұрын
Hey! Love your videos and is a proud subscriber of your Patreon!! I'm very new to this and having an issue I don't understand. Everytime I start the preview to test things I get this error message, and it always take a moment for my Enemies to register me as AttackTarget- LogScript: Warning: Accessed None trying to read property Blackboard AIC_Enemy_Base_C /Game/UEDPIE_0_AttackArena.AttackArena:PersistentLevel.AIC_Enemy_Base_C_1 Function /Game/Enemies/AI/AIC_Enemy_Base.AIC_Enemy_Base_C:GetCurrentState:001E PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property Blackboard". Node: Return Node Graph: GetCurrentState Function: Get Current State Blueprint: AIC_Enemy_Base PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property Blackboard". Node: Return Node Graph: GetCurrentState Function: Get Current State Blueprint: AIC_Enemy_Base PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property Blackboard". Node: Set Value as Object Graph: SetStateAsAttacking Function: Set State as Attacking Blueprint: AIC_Enemy_Base PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property Blackboard". Node: Set Value as Enum Graph: SetStateAsAttacking Function: Set State as Attacking Blueprint: AIC_Enemy_Base I've followed your steps and redone them several times, I still get this issue. What do? :(
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
This error is saying that you don't have a blackboard. Make sure you have a blackboard next to your behavior tree in your content browser (Also if you're on an older version of UE, you have to manually assign the blackboard to the behavior tree, otherwise this blackboard variable will be null)
@Smyyytth
@Smyyytth 2 ай бұрын
@@AliElZoheiry I have a blackboard, I'm using it for all my keys. And I'm using the latest version of UE. The blackboard is next to the BT. But knowing what it means makes it a little easier to troubleshoot. Maybe I'll try to remake the blackboard! Thanks for your help.
@xanderbroadbear5980
@xanderbroadbear5980 Ай бұрын
I think that in your AI controller blueprint the cast to the BP_Enemy_Base is failing, and thats why the blackboard is none. For me it was failing because i had the weapon attached incorrectly in my BP_Enemy_Ranged .
@buga125
@buga125 17 күн бұрын
I just had this problem and I just figured it out too - for some reason only the damage event caused this error and I had another enemy spawned that I forgot about (as I was playing with this AI controller a bit and just left it stranded somewhere) and that was the one that was causing the errors as it didn't get any blackboard from the BT so if anyone has a similar problem - I recommend checking also if there are no other spawned enemies that hasn't been fully modified to fit this AI behavior. After deleting that other enemy, it all works without errors :)
Don't eat centipede 🪱😂
00:19
Nadir Sailov
Рет қаралды 22 МЛН
Последний Закат Кота Макса...
00:21
Глеб Рандалайнен
Рет қаралды 4,7 МЛН
Uma Ki Super Power To Dekho 😂
00:15
Uma Bai
Рет қаралды 57 МЛН
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 19 МЛН
suster ngesot salah culik #shorts #upinipin
0:22
Aska Boy
Рет қаралды 39 МЛН
Only sigmas do that! #shorts #minecraft #minecraftanimation
0:14
Krabster Dom
Рет қаралды 9 МЛН
Қорқынышты Майнкрафт - 3 бөлім ✅
33:07
Minecraft: Who was the best? 🤔 #Shorts
0:29
Twi Shorts
Рет қаралды 33 МЛН
Игра про змеек в реальной жизни😅 #фильм #сериал
0:59