You have really taken this ai series to the next level. I have never seen anything so complex anywhere on the internet and man haven't I searched! Brilliant!
Awesome walkthrough here! After part 3 I tried tackling the AI forgetting stimuli myself and tried using that On Target Perception Forgot event. Man does that event not do what I thought it would. Huge rabbit hole. Ended up refactoring to what you have here and it works perfectly. You're the man!
Hey, I'm glad to hear you found the refactor helpful! The On Target Perception Forgot event can definitely be tricky. Thanks for sharing your experience! 🙏
Glad you're still finding it interesting. It's getting pretty deep indeed, sometimes I even have to learn new things before teaching them, which is great for me too :D
Very instructive video, always so elegantly explained :P Thank you so much Ali for taking your time and sharing your knowledge with us, thanks to you I'm starting to search unreal much more independently, whereas at first I was rather shy because I was afraid of breaking something haha. In any case, your lessons give us a lot more confidence in our own abilities! Thank you so much!
Something that I would love to see in a future part is how to setup different audio for example the AI can hear running from further away however if you are walking you can get much closer without being detected
I briefly touch on this in the perception tutorial ua-cam.com/video/gsyZdKYAT_4/v-deo.html at 9:17 where I talk about Loudness and MaxRange, so you can try that out, but know that it will require some trial and error to get it right
As an idea for one of the next videos - improve enemy AI in the way, that for example - > 1 player vs 5 enemies (3 melee, 2 ranged) -> 3 melee enemies try to attack from the front of the player position, 2 ranged enemies try to attack from the flangs (1 from the left , one from the right)
Ahh, so have enemies decide on their position based on where other enemies are, their type, and distance, etc.. That would be really interesting, it would complicate things a lot, but definitely possible. I'll consider it
@@AliElZoheiry mb it will be interested for you. I've found a video with some cool combat AI features. I really don't remember the games which I've played in where such smart enemies logic have been implemented) ua-cam.com/video/PLchlSvrSpc/v-deo.html
Caught up to Part 7, with your series. Was away for a while. But I would love to see (1) Enemy AI Dodge your attacks, (2) Player Parry Enemy Attacks (3) a Boss AI and (4) Groups of Enemies working together like a single entity. Like, if one enemy sees the target it can call the other enemies to this position.
Thanks for the suggestions, I've been planning on a couple of those things, mainly the group of enemies and the boss AI, so that will come soon hopefully 🤞
Would lovely and interesting to see how you make an enemy attack structures that you hide on top or behind them. For example if you have a base and the enemy follows you or see you in the base they will melee attack the walls or structures. Hope this idea will pass :) Thanks for all the great info you provide us, much appreciated. Take care and all the best!
You don't need to check something manually. If you put the EQS query in a left branch of a "Selector" node, and it fails, then the selector will automatically try to run whatever is on the right branch, because if you recall how selectors work, they go from left to right and stop execution when a branch succeeds, so if something fails, it will keep moving to the right. Knowing that, you can put the EQS in a selector node, and to the right of that EQS query, you can put whatever you want to happen if it fails. I hope it makes sense. Feel free to join the Discord server btw, and I can show screenshots as well there (Link in the description)
@@AliElZoheiry I do have one question though, how would you make it so the AI doesnt instantly go into seeking and has kind of like a 2 second grace peroid on the chase? Because as soon as I turn a corner it instantly begins seeking
@@newtforgegames Yeah, I was indeed thinking of modifying that a bit. So when the enemy loses sight of the player, a timer starts (let's say a 3 second timer) then if the timer expires, the enemy goes to seeking, but if the enemy sees the player while the timer is running, then the timer get's cancelled and as if nothing happened. That's how you would implement that "grace period"
About usage of the OnTargetPerceptionForgotten You need to enable the Forget Stale Actors in project settings (Engine - AI System) And it looks like working as it should - fire when the age of the sense stimulus expired
Another excellent video, thank you Ali. The only thing I want to ask is that we set the field of view of our characters to 60 degrees. How were we increasing it? The reason why it is wanted to be increased is that sometimes the characters are next to each other and do not see each other.
Hey! Thanks for the kind words! To increase the field of view, you can adjust the 'Field of View' property in your camera settings. Just make sure to set it to the desired angle. This should help your characters see each other better.
4:14 The actor accidentally gets unpinned from the 'Remove Item' node, I was having an issue with the AI constantly getting set to the 'Passive' state after losing the sight of the player, check here and reconnect if you're having a similar issue.
Amazing vedios. I only found them today and by the time I found your channel I was already exhausted from a day of developing. But in the 1 hour I binged, I fully fleshed out my DOT and projectile system. I also realized your modular design for stats was much better than my buggy mess, so tomorrow I'll be going through that video and implementing your system. I'm on my 4th day learning UE5 with zero coding or programming knowledge, but I'm a good way towards getting my first boss battle built. I have most systems down, but what I'm really missing is an in-depth damage state system (effects and modifiers), as well as the higher boss logic for phases and choosing rotations. Gonna be binging your videos over the weekend, and if I have a request it would be a video about lock on and hit mechanics (tab targeting and setting up "hitboxes" for large attacks. Not sure if you've already made a video on thism but I don't see one.
Thank you so much! Glad you liked them, and I'm always happy to hear that my videos are being binged 😅 I'll definitely consider your request, I'll add it to the list 🙏
I did not know, the EQS-Pawn will trigger the Sight-Sense. Since I tested during the video, I was baffled for half an hour, why my NPC can see me trhough walls haha.
Great tutorial series Ali! I am loving every moment of it. I do have a question though. I am not sure when it happened by my AI no longer move along a set patrol path any longer.
Hey, thank you for your kind words! I'm happy to hear that you're loving the tutorial series. I don't really know why your AI stopped moving, but make sure they still have a patrol path assigned to them when placed in the world
*Update* After doing your Jumping/Nav Link tutorial and when you implemented the "SeekAttackTargetTimer" clear and invalidate timer by handle updates this somehow fixed my AI Patrolling issues. They started to use the patrol routes set out for them...Strange one...but any way your tutorials are amazing and you are doing an excellent job sharing your knowledge with us. I commend you sir!
Hi Ali! Amazing Tutorial Series so far, one of the best! I've been following this series without too much problems execpt in this video, I've re-watched it multiple times thinking I forgot something, but I seem to be stuck. 1. My Enemy_Base just freezes when he see's me and wont ever do anything else after wards. (dont know when that started happening) 2. I can never get the ennemies to forget me, even with the Print, i can never have it to prrint, it's as if they cant forget me X). 3. Mayeb it's because of issue #2, but my Enemy_Melee once he see's me always seems to know where I am no matter how far or how many obstacles I hide behind with. Thanks for any help given!
Once Again, took a 3-4 hour break and found what was wrong! On the Set Timer by Event, I had forgotten to check "looping" as True... I want to cry for how long I pulled my hair out looking for the answer but I'm Happy I figured it out. Though for Issue number 3 and 1 I still haven't figured it out
Hey, glad you figured it out. It's usually these small things that take a long time to find, but you learn a lot from the process. Keep up the good work!
Both are used. Get known perceived actors get's actors will get more actors that currently perceived actors, because it also keeps a history of previously perceived actors
when I try the sight sense it works fine, When he sees me, he tries to find me,then 5 times loop, then goes passive, and the same if he sees me again. but when I damage him or make a sound after a seek cycle, things weird happen,if I damage him he doesn't atttack, if I make a noise at the other side of a block, he doesn't go
@@AliElZoheiry I just realize that enemy forget actor and set passive state till he see actor again. but enemy unable to investigate sound as every 0.5 sec he turning passive state. Could you please help to fix that?
Right now it takes the location at the moment of losing sight, so the last place where they saw them, you can of course change it to be a random point in a radius around that location
hi just wondering what video did you do the first sub_trees for the different state types I feel like I'm making a huge over sight in not finding them - also please keep up the great work on your videos they have been helping me greatly as a newbie in all of this!
Thank you for the video! I haven't watched new videos yet, so decided to ask there :) Have you added some changes in blocking mechanic in newer videos? Because now if a player attacks - > enemy starts blocking and wait to OnBlockEnd event to finish the blocking. So if a player makes a hit/shot and by some reason it doesn't hit the enemy -> he will be in the blocking state until the player hit the enemy one more time.
Hey! I indeed made a very nice improvement to the block functionality in the first chapter of this video ua-cam.com/video/UIAazOgww_I/v-deo.html I made it a lot simpler, and fixed some issues with multiple enemies blocking, hope that's what you're looking for
Hi Ali, thanks for this tutorial! I am new to unreal and I'm trying to learn as much as possibile and you are a guide. I have a problem: when I set the status walking or jogging in the behaviour tree, the enemy continue to run (even if I set idle); the same if I change the value in the blueprint (idle, walk, jogging and sprint), doesn't seem that anything change. I debug the BT as you suggested in a video but I don't understand the problem. Have you any suggestion?
Hey there! Thank you for your comment. You need to make sure that changing the enemy actually has different speeds setup for jogging, walking, idle, etc.. using the interface function implementation.
@@AliElZoheiry Thanks Ali, I set up different speeds as you showed in your video (walking 150 - Jogging 300, Sprint 500), but when I changed the value in the BP_EnemyMelee nothing change in game. I'll try to put some print on Discord to show you my situation. Thanks for the answer
Hi, very good serie. I Watched next videos, but with this system i don't understand how to prevent a enemy to switch his attack target when he's already attacking an enemy, because it's always updated from his sight
Hey, thank you 🙏 if you followed the series from the beginning, you will see that in the HandleSensedSight function of the AI controller, I first check what the current state is before changing it to attacking, and if it's already attacking (which means the enemy has a target already) then I don't do anything
thank you for the tutorial, the melee AI worked perfectly. but i did a test run for the ranged AI and the find cover sequence and movetolineofsight does not work anymore, if the ranged AI is low in health it escaped but not regenerating health or if the player is out of sight it simply entered passive state
Indeed, that's a bug I have yet to fix. I have a list of bugs and improvements that I'm planning on tackling in a separate video in the future and that is one of them. If you want to know how I plan on fixing it, I have 2 possible approaches: 1- first, is to make the healing its own state, that way you can't be both investigating and healing 2- Second approach, is to keep remembering the player when the enemy goes to heal, that way they never trigger the investigation state
Hey, thanks for your comment! I don't currently have a tutorial on that specific topic, but that's a great idea for a future video. I'll definitely consider it for the upcoming content. Thanks for the suggestion!
I'm having an issue where after setting up the seeking behavior the melee just gets stuck in move to (go to last known location) when I check in the debug it says point of interest invalid. The enemy attacks if I trigger the attack key that was for testing but if I walk up to it it just equip weapon then goes to idle @@AliElZoheiry
I'm having an issue where after setting up the seeking behavior the melee just gets stuck in move to (go to last known location) when I check in the debug it says point of interest invalid. The enemy attacks if I trigger the attack key that was for testing but if I walk up to it it just equip weapon then goes to idle @@AliElZoheiry
So I'm having a problem where when the enemy also detects another enemy, it breaks the ai and they no longer chase me if they look at me again, and im not entirely sure how to fix it.
You can prevent enemies from reacting when detecting each other in the handleSenseSight in the AI controller. By checking if the sensed pawn is the player or another enemy, and if it's another enemy, just don't do anything, and if it's the player, then proceed to attack
@@AliElZoheiryI got it fixed now thank you, I am now running into another bug where I think the enemy senses both sound and sight, it messed it up and all continues sound will be heard and immediately ignored. Also to note is we have footsteps making sounds.
hey at 14:38 y noticed that after you check the attack target is equal the actor to forget the actor is not plugged in remove item anymore. should it be like that? i mean it does nothing if is not connected
Hey! You are correct, when I pulled off of attack target to do the check, this got disconnected automatically from the remove node. I didn't want that to happen and i believe i fixed it later on (or maybe off camera) but very good catch, you should keep it connected
Hi Ali, will you talk about behavior tree in multiplayer in your future tutorials? Currently I'm trying to Replicate shooting logic in the Behavior Tree Tasks but it just doesn't work. Moving the logic to the AI controller or AI BP is the only way? thx.
Hey Lola, I'm currently focusing on single player only, as multiplayer wouldn't be so much AI related, but mainly replication of the enemy actor and the AI controller, so it's possible that I will touch on it in the future, but unfortunately not now
@@AliElZoheiry Many thanks for your replies Ali. The current series are great. Please continue as planne. Love all the videos. Making videos takes lots of effort. Really appreciate your work. And for the multiplayer stuff, I've figured it out with the help of some experienced developer. Indeed needed to do the replication of the enemy actor and leave the behavior tree out of it.
Hello, will you be making a tutorial series on ranged ai as well as close ranged? I'm trying to make a simple system with behaviour trees and haven't found many tutorials for it in ue5.
@@AliElZoheiry I really want to learn how to make an ai that has the ability to just walk around randomly (easy enough and managed to find tutorials in that part), but then after a set trigger happens they pull out guns and start attacking the player which the player will in turn become invincible and also have a gun. Whether they can hide behind cover would be nice but not necessary. Trying to make some for a university project with some friends. And having this switch in narrative of puzzles to then fps shooter. So the ai needs to somehow just be randomly walking around in the level and then an after and event they can then start attacking the player with guns and then also be killed by the player. :)
@@Secretlycat31 that's pretty much what we have in this series, have you checked the earlier videos as well? Because I do have a patrolling state (which is randomly walking around as you described it) and I have a ranged enemy that can shoot the player and can die
@@AliElZoheiry oh ok, I got a bit stuck on the first video with creating the initial blue prints as for some reason the attack animation wasn’t triggering. So I didn’t look through the rest too closely. I’ll try give it another go though.
Hey I followed this series from video 1 to 3 and then jump to this video part 9. However is there anywhere in the code u make it so the AI only detect the player. For some reason my AI is detecting other AI
Hey there! I'm glad to hear you've been following the series! I recommend following it in order though, I don't really remember when certain things were added
No idea why, when the moveto under go to last known location is called in the Behavior Tree, it gets stuck, debug says Point of Interest returns invalid. not always but randomly
In the HandleSenseSight, you can check if the current actor is seeing another team mate by comparing their team number. Usually after that we do nothing, because they are on the same team. Instead, what you can do, is an additional check, if the teammate I just saw, is in an "Attacking" state (based on their currentState variable in their AI controller), if yes? then you can get their attackTarget (also a variable in the AI controller) and set the current actor's state to attacking that attackTarget
Please answer my question from india 🇮🇳 i am a middle class guy so bought i3 11 gen laptop with 8gb ram and 512 gb storage with integrated graphics can it possible for game creation if not what type game it can run hope u answer this Love ❤from india
With an integrated GPU, it would be very difficult to run Unreal Engine, it will probably open, but it will be very slow and will crash often, so unfortunately I don't think you can use that laptop for game development
Dear Ali Elzoheiry, Could you please help me. I don't know why it doesn't work. Here are the values that PrintString gives: I've made this functionality 5 min - 11 min 30 s.
KnownSeenActors + Length: when AI doesn't see me = 0; when AI sees me = 1; when AI sees me again = 1; AIPerception + Get Known Perceived Actors (AISense Sight) + Length: when AI doesn't see me = 0; when AI sees me = 1; when AI sees me again = 1; when AI sees me = 1 then I die = 0!!!!; It means that the values are the same in both cases and "branch !=" gives false And value values differs only when I die.)))) UE4 v.4.26.2 Thx in advance! =)
Hey, I'm not really sure I understand what's going on here, it's really hard to debug just based on that description. Though I do see you're using UE4, and even though most things should work the same, some things might work a bit differently, I can't tell you exactly what since I never implemented any of this in UE4. I suggest joining the Discord server and asking your question there with some screenshots, then someone can help you better with some visual clarity
@@AliElZoheiry I've found the mistake of mine))))) I didn't add the 5 sec "Max age" in AISense_Sight! =) I'm SO happy!!! Merry Christmas and a lot of presents!!! =))))
Awesome! glad you fixed it. Strange that the link expired, I have it set to never expire, can you try this one discord.com/invite/AEnM4wvYzN@@itsroachtime5243
You can download it all for free (with a 7 day trial) on my Patreon (www.patreon.com/Alizoh) but I would of course greatly appreciate it if you stick around after the trial and pay the $5 😇
@@AliElZoheiry Yea. I am not willing to be a freeloader for such a great content. Let alone if i can learn something on the way. :D Btrees was scaring me but it looks pretty accesible as everything in UE after all. And what is you licence? Is this code free to use in commercial projects? Credited of course or some kind of licence? It will probably never gonna happen but what if... :D
@@jiwik731 I appreciate the support 🙏 thank you. And I'm very happy to hear that my content is helping you. You're free to use any of my code and assets royalty free without attribution, although it's always appreciated to get credited for it, but you are under no obligation to do so
I am building my game differently but does anybody elses enemy stop working if i jump and they lose sight of me mid air they just stop. i think it cant reach the spot so it is always moving to it
Hello... i'm having an issue whereby the length of the Known seen Actors array and the Known Perceived Actors array is always equal even when i get out of range... 7:55 I tried making the event specific to the attack target but it's still not losing sight of me. Any insight on what could be going on would be helpful.
😅once more.i'm back again answering my own problems To anyone else having the above issue you probably ignored the part in this series where Ali put a Max Age of 5 Seconds for the Sight perception....so if you never touched the max age it's probably at 0.0 by default. Which therefore means the AI will never forget you no matter where you go
I believe in Part 7 of this series, there is some info about having the AI fight other AI. If I'm remembering correctly, that is the section of the series where the ranged and the melee enemies duke it out :) AI working as a team would be cool to see. Perhaps having them call out to other AI enemies to help search for a target or something of that sort.
You have really taken this ai series to the next level. I have never seen anything so complex anywhere on the internet and man haven't I searched! Brilliant!
Thanks so much Diliupg, I appreciate you saying that, and I hope to keep this standard up in all future videos as well :)
I can't thank you enough!
Most valuable Unreal Engine tutorial content on UA-cam for sure.
A thousand times THANKS!
Thank you so much for your kind words! I'm really happy to know that you found the content valuable. Happy to help! 🙏
Awesome walkthrough here! After part 3 I tried tackling the AI forgetting stimuli myself and tried using that On Target Perception Forgot event. Man does that event not do what I thought it would. Huge rabbit hole. Ended up refactoring to what you have here and it works perfectly. You're the man!
Hey, I'm glad to hear you found the refactor helpful! The On Target Perception Forgot event can definitely be tricky. Thanks for sharing your experience! 🙏
I love how deep we are getting with the series bro Ive got a lot of catching up to do since Ive been away for a while!
Glad you're still finding it interesting. It's getting pretty deep indeed, sometimes I even have to learn new things before teaching them, which is great for me too :D
Thanks for another great update to this series! Very well thought out and explained :)
Keep up the great work, and stay blessed 🙏
You're very welcome, and thank you for the support as always 🙏
Very instructive video, always so elegantly explained :P
Thank you so much Ali for taking your time and sharing your knowledge with us, thanks to you I'm starting to search unreal much more independently, whereas at first I was rather shy because I was afraid of breaking something haha.
In any case, your lessons give us a lot more confidence in our own abilities!
Thank you so much!
You're most welcome 🤗 I'm really happy to see your growth and advancement, and I appreciate your support as always 🙏
Every your tutorials AI just better & Better! Thank you so much for everything. You really very helpful me
You're very welcome Roy, and thank you as always for your kind words and support.
@@AliElZoheiry I am grateful for your help.
Thank you so much for everything. I wish you God always helps you
Something that I would love to see in a future part is how to setup different audio for example the AI can hear running from further away however if you are walking you can get much closer without being detected
I briefly touch on this in the perception tutorial ua-cam.com/video/gsyZdKYAT_4/v-deo.html at 9:17 where I talk about Loudness and MaxRange, so you can try that out, but know that it will require some trial and error to get it right
Very useful tutorials!
Thank you!
It would be interesting to teach the enemies to act as a team.
Indeed, that will be coming soon in one of the next parts
Спасибо тебе за твой труд и что делишься своими знаниями с нами. Ты как всегда на высоте!
Спасибо большое за ваш комментарий! Я очень рад, что мои видео приносят пользу.
As an idea for one of the next videos - improve enemy AI in the way, that for example - > 1 player vs 5 enemies (3 melee, 2 ranged) -> 3 melee enemies try to attack from the front of the player position, 2 ranged enemies try to attack from the flangs (1 from the left , one from the right)
Ahh, so have enemies decide on their position based on where other enemies are, their type, and distance, etc..
That would be really interesting, it would complicate things a lot, but definitely possible. I'll consider it
@@AliElZoheiry mb it will be interested for you.
I've found a video with some cool combat AI features. I really don't remember the games which I've played in where such smart enemies logic have been implemented)
ua-cam.com/video/PLchlSvrSpc/v-deo.html
as always great brilliant and easy to understand and follow tutorial. keep up the good work man
Much appreciated! Really happy you found it interesting and thank you for your continued support 🙏
Caught up to Part 7, with your series. Was away for a while. But I would love to see (1) Enemy AI Dodge your attacks, (2) Player Parry Enemy Attacks (3) a Boss AI and (4) Groups of Enemies working together like a single entity. Like, if one enemy sees the target it can call the other enemies to this position.
Thanks for the suggestions, I've been planning on a couple of those things, mainly the group of enemies and the boss AI, so that will come soon hopefully 🤞
Thanks for the effort, I am learning a lot from this series ♥
You're very welcome. Happy to see it's helpful
Would lovely and interesting to see how you make an enemy attack structures that you hide on top or behind them. For example if you have a base and the enemy follows you or see you in the base they will melee attack the walls or structures. Hope this idea will pass :)
Thanks for all the great info you provide us, much appreciated. Take care and all the best!
Thank you for the suggestion 🙏 I'll add it to the list and I'll let you know if I do it of course
Thanks for this another great part. Idea for part 10: If the AI chasing you, and there is a table or box in the way, maybe the AI jump on/over it?
Cool idea! I'm considering a tutorial on NavLinks, which are responsible for similar behavior, thanks for the suggestion
Thanks Ali for such interesting videos! excellent learning material! Greetings from Argentina
Thank you Hernan, glad you're finding this useful ☺️🙏
Awesome series! I would like to see how you handle a situation when there is no valid EQS point like the one we had in this video.
Thank you. For handling EQS failure, it would simply be another branch of the tree under a selector node
@@AliElZoheiry so do we check if the PointOfInterest is valid or not or is there another way to check if an EQS failed?
You don't need to check something manually. If you put the EQS query in a left branch of a "Selector" node, and it fails, then the selector will automatically try to run whatever is on the right branch, because if you recall how selectors work, they go from left to right and stop execution when a branch succeeds, so if something fails, it will keep moving to the right.
Knowing that, you can put the EQS in a selector node, and to the right of that EQS query, you can put whatever you want to happen if it fails. I hope it makes sense.
Feel free to join the Discord server btw, and I can show screenshots as well there (Link in the description)
Such amazing content as usual! Thank you for this!
You're very welcome. Thank you for always watching ☺️
@@AliElZoheiry I do have one question though, how would you make it so the AI doesnt instantly go into seeking and has kind of like a 2 second grace peroid on the chase? Because as soon as I turn a corner it instantly begins seeking
@@newtforgegames Yeah, I was indeed thinking of modifying that a bit. So when the enemy loses sight of the player, a timer starts (let's say a 3 second timer) then if the timer expires, the enemy goes to seeking, but if the enemy sees the player while the timer is running, then the timer get's cancelled and as if nothing happened. That's how you would implement that "grace period"
@@AliElZoheiry That exactly! Thanks for your help as always 👍🏻
Thank you god of ue5 tutorial👍👍👍
You're very welcome! Thank you for your support 🙏
Excellent As Always!
Thank you! I'm glad you enjoyed it!
About usage of the OnTargetPerceptionForgotten
You need to enable the Forget Stale Actors in project settings (Engine - AI System)
And it looks like working as it should - fire when the age of the sense stimulus expired
Hey there! Thank you for your comment and sharing that tip with us. It's really helpful for anyone encountering the same issue. Keep up the good work!
Very useful tutorials! Thank you! Like.
Glad to hear that you found the tutorials useful! Your support is much appreciated! Keep on creating!
Another excellent video, thank you Ali. The only thing I want to ask is that we set the field of view of our characters to 60 degrees. How were we increasing it? The reason why it is wanted to be increased is that sometimes the characters are next to each other and do not see each other.
Hey! Thanks for the kind words! To increase the field of view, you can adjust the 'Field of View' property in your camera settings. Just make sure to set it to the desired angle. This should help your characters see each other better.
This is what I was waiting keep making more videos
Thank you Amar
4:14 The actor accidentally gets unpinned from the 'Remove Item' node, I was having an issue with the AI constantly getting set to the 'Passive' state after losing the sight of the player, check here and reconnect if you're having a similar issue.
Hey, thanks for the heads up! I appreciate you pointing that out for others who might encounter the same issue. Keep up the good work!
@@AliElZoheiry Sure thing! Thanks for all the tutorials, your lessons have been incredibly valuable
Amazing vedios. I only found them today and by the time I found your channel I was already exhausted from a day of developing. But in the 1 hour I binged, I fully fleshed out my DOT and projectile system. I also realized your modular design for stats was much better than my buggy mess, so tomorrow I'll be going through that video and implementing your system.
I'm on my 4th day learning UE5 with zero coding or programming knowledge, but I'm a good way towards getting my first boss battle built. I have most systems down, but what I'm really missing is an in-depth damage state system (effects and modifiers), as well as the higher boss logic for phases and choosing rotations.
Gonna be binging your videos over the weekend, and if I have a request it would be a video about lock on and hit mechanics (tab targeting and setting up "hitboxes" for large attacks.
Not sure if you've already made a video on thism but I don't see one.
Thank you so much! Glad you liked them, and I'm always happy to hear that my videos are being binged 😅
I'll definitely consider your request, I'll add it to the list 🙏
Just what I needed ❤🎉
Glad you find it useful ;)
I did not know, the EQS-Pawn will trigger the Sight-Sense. Since I tested during the video, I was baffled for half an hour, why my NPC can see me trhough walls haha.
Haha, classic Unreal Engine surprises! Glad you figured it out 🤔 Have fun experimenting with the features!
Great tutorial series Ali! I am loving every moment of it. I do have a question though. I am not sure when it happened by my AI no longer move along a set patrol path any longer.
Hey, thank you for your kind words! I'm happy to hear that you're loving the tutorial series. I don't really know why your AI stopped moving, but make sure they still have a patrol path assigned to them when placed in the world
@@AliElZoheiry They have a path set to them. Is there a way to test if the AI is picking up the patrol path?
*Update* After doing your Jumping/Nav Link tutorial and when you implemented the "SeekAttackTargetTimer" clear and invalidate timer by handle updates this somehow fixed my AI Patrolling issues. They started to use the patrol routes set out for them...Strange one...but any way your tutorials are amazing and you are doing an excellent job sharing your knowledge with us. I commend you sir!
@@andrewvanderwalt8494 Open your behavior tree while the game is running and check that it goes into the patrol branch
you are great Please keep going ❤❤❤❤❤❤
Thank you very much, I'll do my best to keep it up
Hi Ali! Amazing Tutorial Series so far, one of the best! I've been following this series without too much problems execpt in this video, I've re-watched it multiple times thinking I forgot something, but I seem to be stuck. 1. My Enemy_Base just freezes when he see's me and wont ever do anything else after wards. (dont know when that started happening)
2. I can never get the ennemies to forget me, even with the Print, i can never have it to prrint, it's as if they cant forget me X).
3. Mayeb it's because of issue #2, but my Enemy_Melee once he see's me always seems to know where I am no matter how far or how many obstacles I hide behind with.
Thanks for any help given!
Once Again, took a 3-4 hour break and found what was wrong! On the Set Timer by Event, I had forgotten to check "looping" as True... I want to cry for how long I pulled my hair out looking for the answer but I'm Happy I figured it out. Though for Issue number 3 and 1 I still haven't figured it out
Hey, glad you figured it out. It's usually these small things that take a long time to find, but you learn a lot from the process. Keep up the good work!
And wouldn't it be more optimized if we only did it in the on perception updated event instead of doing it every 0.5 seconds?
Also answered in previous parts :D
or why we use knownseenactors array instead of get currently perceived actors node
Also, we use both. I feel like you may have skipped a few older tutorials.
@@AliElZoheiry I want to watch them all when I have time, but unfortunately I don't have that much time, but ı will look previous part
why we are doing that with get known perceived actors , why we dont do with get currently perceived actors
Both are used. Get known perceived actors get's actors will get more actors that currently perceived actors, because it also keeps a history of previously perceived actors
when I try the sight sense it works fine, When he sees me, he tries to find me,then 5 times loop, then goes passive, and the same if he sees me again. but when I damage him or make a sound after a seek cycle, things weird happen,if I damage him he doesn't atttack, if I make a noise at the other side of a block, he doesn't go
Sounds like he might be stuck in some state and not switching, debug the tree while this is happening to see which state the enemy is in
@@AliElZoheiry I just realize that enemy forget actor and set passive state till he see actor again. but enemy unable to investigate sound as every 0.5 sec he turning passive state. Could you please help to fix that?
Maybe seeking should not go directly to the target but but random location in radius of target. Just a idea.
Right now it takes the location at the moment of losing sight, so the last place where they saw them, you can of course change it to be a random point in a radius around that location
hi just wondering what video did you do the first sub_trees for the different state types I feel like I'm making a huge over sight in not finding them - also please keep up the great work on your videos they have been helping me greatly as a newbie in all of this!
I believe that was in Part 5, where I started to create different enemy types ua-cam.com/video/UDsbwnuD22Q/v-deo.html
@@AliElZoheiry thank you so much this is a big help !
Thank you for the video! I haven't watched new videos yet, so decided to ask there :)
Have you added some changes in blocking mechanic in newer videos? Because now if a player attacks - > enemy starts blocking and wait to OnBlockEnd event to finish the blocking. So if a player makes a hit/shot and by some reason it doesn't hit the enemy -> he will be in the blocking state until the player hit the enemy one more time.
Hey! I indeed made a very nice improvement to the block functionality in the first chapter of this video ua-cam.com/video/UIAazOgww_I/v-deo.html
I made it a lot simpler, and fixed some issues with multiple enemies blocking, hope that's what you're looking for
@@AliElZoheiryCool, thanks! I'll check it out
Hi Ali, thanks for this tutorial! I am new to unreal and I'm trying to learn as much as possibile and you are a guide. I have a problem: when I set the status walking or jogging in the behaviour tree, the enemy continue to run (even if I set idle); the same if I change the value in the blueprint (idle, walk, jogging and sprint), doesn't seem that anything change. I debug the BT as you suggested in a video but I don't understand the problem. Have you any suggestion?
Hey there! Thank you for your comment. You need to make sure that changing the enemy actually has different speeds setup for jogging, walking, idle, etc.. using the interface function implementation.
@@AliElZoheiry Thanks Ali, I set up different speeds as you showed in your video (walking 150 - Jogging 300, Sprint 500), but when I changed the value in the BP_EnemyMelee nothing change in game. I'll try to put some print on Discord to show you my situation. Thanks for the answer
Hi, very good serie. I Watched next videos, but with this system i don't understand how to prevent a enemy to switch his attack target when he's already attacking an enemy, because it's always updated from his sight
Hey, thank you 🙏 if you followed the series from the beginning, you will see that in the HandleSensedSight function of the AI controller, I first check what the current state is before changing it to attacking, and if it's already attacking (which means the enemy has a target already) then I don't do anything
thank you for the tutorial, the melee AI worked perfectly. but i did a test run for the ranged AI and the find cover sequence and movetolineofsight does not work anymore, if the ranged AI is low in health it escaped but not regenerating health or if the player is out of sight it simply entered passive state
Indeed, that's a bug I have yet to fix. I have a list of bugs and improvements that I'm planning on tackling in a separate video in the future and that is one of them.
If you want to know how I plan on fixing it, I have 2 possible approaches:
1- first, is to make the healing its own state, that way you can't be both investigating and healing
2- Second approach, is to keep remembering the player when the enemy goes to heal, that way they never trigger the investigation state
Is there any tutorial on how to add more depth to this kind of AI stealth system by checking if the player is in the shadow or not?
Hey, thanks for your comment! I don't currently have a tutorial on that specific topic, but that's a great idea for a future video. I'll definitely consider it for the upcoming content. Thanks for the suggestion!
I'm having an issue where after setting up the seeking behavior the melee just gets stuck in move to (go to last known location) when I check in the debug it says point of interest invalid. The enemy attacks if I trigger the attack key that was for testing but if I walk up to it it just equip weapon then goes to idle @@AliElZoheiry
I'm having an issue where after setting up the seeking behavior the melee just gets stuck in move to (go to last known location) when I check in the debug it says point of interest invalid. The enemy attacks if I trigger the attack key that was for testing but if I walk up to it it just equip weapon then goes to idle @@AliElZoheiry
Please add to this stealth execution kill
Hey there! Thanks for your suggestion. Stealth execution kill is a great idea, I’ll look into adding that in a future video. Appreciate your input!
So I'm having a problem where when the enemy also detects another enemy, it breaks the ai and they no longer chase me if they look at me again, and im not entirely sure how to fix it.
You can prevent enemies from reacting when detecting each other in the handleSenseSight in the AI controller. By checking if the sensed pawn is the player or another enemy, and if it's another enemy, just don't do anything, and if it's the player, then proceed to attack
@@AliElZoheiryI got it fixed now thank you, I am now running into another bug where I think the enemy senses both sound and sight, it messed it up and all continues sound will be heard and immediately ignored. Also to note is we have footsteps making sounds.
I think it might be something with the handle lost actor because it keeps skipping over the seeking as well
Ali How do you get an AI to enter the door??
So you're interested in an AI interaction system (where the AI interacts with objects in the world)?
@@AliElZoheiry Yes (and I Sorry for asking more than once 😅)
@@essa4436 No worries, I'll definitely consider this in the following parts
hey at 14:38 y noticed that after you check the attack target is equal the actor to forget the actor is not plugged in remove item anymore. should it be like that? i mean it does nothing if is not connected
Hey! You are correct, when I pulled off of attack target to do the check, this got disconnected automatically from the remove node. I didn't want that to happen and i believe i fixed it later on (or maybe off camera) but very good catch, you should keep it connected
@AliElZoheiry thank you. I was confussed
Hi Ali, will you talk about behavior tree in multiplayer in your future tutorials? Currently I'm trying to Replicate shooting logic in the Behavior Tree Tasks but it just doesn't work. Moving the logic to the AI controller or AI BP is the only way? thx.
Hey Lola, I'm currently focusing on single player only, as multiplayer wouldn't be so much AI related, but mainly replication of the enemy actor and the AI controller, so it's possible that I will touch on it in the future, but unfortunately not now
But to add to that, it is definitely possible to replicate all this behaviour in multiplayer
@@AliElZoheiry Many thanks for your replies Ali. The current series are great. Please continue as planne. Love all the videos. Making videos takes lots of effort. Really appreciate your work. And for the multiplayer stuff, I've figured it out with the help of some experienced developer. Indeed needed to do the replication of the enemy actor and leave the behavior tree out of it.
Hello, will you be making a tutorial series on ranged ai as well as close ranged? I'm trying to make a simple system with behaviour trees and haven't found many tutorials for it in ue5.
Hey, what are you looking to learn exactly? Let me know and I'll definitely consider it
@@AliElZoheiry I really want to learn how to make an ai that has the ability to just walk around randomly (easy enough and managed to find tutorials in that part), but then after a set trigger happens they pull out guns and start attacking the player which the player will in turn become invincible and also have a gun. Whether they can hide behind cover would be nice but not necessary. Trying to make some for a university project with some friends. And having this switch in narrative of puzzles to then fps shooter. So the ai needs to somehow just be randomly walking around in the level and then an after and event they can then start attacking the player with guns and then also be killed by the player. :)
@@Secretlycat31 that's pretty much what we have in this series, have you checked the earlier videos as well? Because I do have a patrolling state (which is randomly walking around as you described it) and I have a ranged enemy that can shoot the player and can die
@@AliElZoheiry oh ok, I got a bit stuck on the first video with creating the initial blue prints as for some reason the attack animation wasn’t triggering. So I didn’t look through the rest too closely. I’ll try give it another go though.
Hey I followed this series from video 1 to 3 and then jump to this video part 9. However is there anywhere in the code u make it so the AI only detect the player. For some reason my AI is detecting other AI
Hey there! I'm glad to hear you've been following the series! I recommend following it in order though, I don't really remember when certain things were added
@@AliElZoheiry hey I figured it out by adding a tag to the player. And then check if that actor has tag in the “perception updated” event
No idea why, when the moveto under go to last known location is called in the Behavior Tree, it gets stuck, debug says Point of Interest returns invalid. not always but randomly
ah.. I get it now, Didn't see the general notes. It is in fact because of the environment
Glad you figured it out. Well done 💪
@@1tapeoka1what does this mean
Im having this exact issue what was your solution @@1tapeoka1
@@AliElZoheirycan you help me with this issue please
How do you have another enemy that see a teammate attacking set them selves to attacking and attack the target they are fighting?
In the HandleSenseSight, you can check if the current actor is seeing another team mate by comparing their team number. Usually after that we do nothing, because they are on the same team.
Instead, what you can do, is an additional check, if the teammate I just saw, is in an "Attacking" state (based on their currentState variable in their AI controller), if yes? then you can get their attackTarget (also a variable in the AI controller) and set the current actor's state to attacking that attackTarget
Please answer my question from india 🇮🇳 i am a middle class guy so bought i3 11 gen laptop with 8gb ram and 512 gb storage with integrated graphics can it possible for game creation if not what type game it can run hope u answer this
Love ❤from india
With an integrated GPU, it would be very difficult to run Unreal Engine, it will probably open, but it will be very slow and will crash often, so unfortunately I don't think you can use that laptop for game development
Dear Ali Elzoheiry,
Could you please help me. I don't know why it doesn't work. Here are the values that PrintString gives:
I've made this functionality 5 min - 11 min 30 s.
KnownSeenActors + Length:
when AI doesn't see me = 0;
when AI sees me = 1;
when AI sees me again = 1;
AIPerception + Get Known Perceived Actors (AISense Sight) + Length:
when AI doesn't see me = 0;
when AI sees me = 1;
when AI sees me again = 1;
when AI sees me = 1 then I die = 0!!!!;
It means that the values are the same in both cases and "branch !=" gives false
And value values differs only when I die.))))
UE4 v.4.26.2
Thx in advance! =)
Hey, I'm not really sure I understand what's going on here, it's really hard to debug just based on that description. Though I do see you're using UE4, and even though most things should work the same, some things might work a bit differently, I can't tell you exactly what since I never implemented any of this in UE4.
I suggest joining the Discord server and asking your question there with some screenshots, then someone can help you better with some visual clarity
@@AliElZoheiry Hello the discord link is expired.
@@AliElZoheiry I've found the mistake of mine)))))
I didn't add the 5 sec "Max age" in AISense_Sight! =)
I'm SO happy!!!
Merry Christmas and a lot of presents!!! =))))
Awesome! glad you fixed it. Strange that the link expired, I have it set to never expire, can you try this one discord.com/invite/AEnM4wvYzN@@itsroachtime5243
@@AliElZoheiry Hey! Eventually discord link works. It appeared I have to start discord first and only then follow the link. Well, live and learn.)))
This is amazing. Is it avaliable on the marketplace to buy?
You can download it all for free (with a 7 day trial) on my Patreon (www.patreon.com/Alizoh) but I would of course greatly appreciate it if you stick around after the trial and pay the $5 😇
@@AliElZoheiry Yea. I am not willing to be a freeloader for such a great content. Let alone if i can learn something on the way. :D Btrees was scaring me but it looks pretty accesible as everything in UE after all. And what is you licence? Is this code free to use in commercial projects? Credited of course or some kind of licence? It will probably never gonna happen but what if... :D
@@jiwik731 I appreciate the support 🙏 thank you. And I'm very happy to hear that my content is helping you.
You're free to use any of my code and assets royalty free without attribution, although it's always appreciated to get credited for it, but you are under no obligation to do so
The likes were at "420", so I didn't want to click especially because Amsterdam. But I had to ¯\_(ツ)_/¯
Hahaha, I understand the struggle! Glad you couldn't resist clicking the like button in the end 😄
I am building my game differently but does anybody elses enemy stop working if i jump and they lose sight of me mid air they just stop. i think it cant reach the spot so it is always moving to it
Made a custom move to Task that accepts fails
Indeed that's an excellent way of solving this
Hello... i'm having an issue whereby the length of the Known seen Actors array and the Known Perceived Actors array is always equal even when i get out of range... 7:55
I tried making the event specific to the attack target but it's still not losing sight of me.
Any insight on what could be going on would be helpful.
😅once more.i'm back again answering my own problems
To anyone else having the above issue you probably ignored the part in this series where Ali put a Max Age of 5 Seconds for the Sight perception....so if you never touched the max age it's probably at 0.0 by default.
Which therefore means the AI will never forget you no matter where you go
Haha I was just about to reply telling you to check your MaxAge 😉 good job figuring it out 👍
Hey would this whole ai setup with with animals
Yup, the concepts are pretty general and can be applied to any pawn of any type.
Hi add ai vs ai?
Team working?
I believe in Part 7 of this series, there is some info about having the AI fight other AI.
If I'm remembering correctly, that is the section of the series where the ranged and the melee enemies duke it out :)
AI working as a team would be cool to see. Perhaps having them call out to other AI enemies to help search for a target or something of that sort.
Indeed! Thank you for helping me answer questions, I appreciate it 🙏
@@AliElZoheiry - Sure thing!
We are a community like any other. I like to help where/when I can.
Have a great weekend :)