This needs to be pinned: At 10:43 Ryan changes something in the behavior tree but doesnt address it. Here is the fix: From Keppersnapper - For those that need a solution to this, go to Random Location Box Task and add new variable called BB Chase Status, change it to a blackboard key selector (the same way we have been doing), make it instance editable. "Get" the BB Chase Status and drag it onto the event graph, then Set Blackboard Value as Enum.Plug up "Set Blackboard Value as Enum" in between "Set Blackboard Value as Vector" node and "Finish Execute" node, and go back to the behaviour tree and change the "BB Chase Status" on the Random Location Box Task to "Chase Status". TLDR, I copied the way he added BB Chase Status into Random Location Box from the same way he did it on the other tasks. Im not sure whether this will affect the code negatively, but it definitely allowed my AI to patrol after this.
@Fafficus3 жыл бұрын
you are a life saver thanks very much
@Seraian12 жыл бұрын
I'm not entirely sure you need that code, the sequence he made afterwards does fix this issue. Leaving in the code has no issues either but I dont think it necessary.
@Zendronee Жыл бұрын
My AI is still not patrolling after this, unfortunatly.
@HadesRage93 Жыл бұрын
What Value for the Enum Byte value is needed?
@henrijs1733 Жыл бұрын
this worked. it's fun that we're able to set such stealth mechanics up in such a short while. GG unreal engine! plus it's really creepy to have this braindead mute following me relentlessly. reminds me of that resident evil guy. :D
@DetectiveJones4 жыл бұрын
Its honestly so much fun playing hide and seek with an AI you made lol starting from a fumbling dude walking around aimlessly, to chasing after you and searching for you when you disappear, only to actually find you while searching feels so cool!
@nicolaykoriagin2 жыл бұрын
Yeeeeah :)
@xylvnking2 жыл бұрын
2 things to help development: put a light and change it according to the status to more easily tell, and also use jump or another input to register and de-registed from the ai perception so you can test it quicker
@KazimHasan3215 жыл бұрын
Just followed through the entire series (till part 7 ofc) in a binge. Ah what a beautiful binge it has been. Please continue making UE4 tutorials, much thanks!
@RyanLaley5 жыл бұрын
Will do, plenty more to come
@KazimHasan3215 жыл бұрын
Any plans for working with EQS and AI Team config?
@RyanLaley5 жыл бұрын
Yep, eqs will be episode 9or 10 I reckon and team stuff later
@jeshiabood67523 жыл бұрын
@@RyanLaley please bro u are the best out there i will watch them all thanks you soo much really thanks youuuuuu
@MRnostate5 жыл бұрын
At 10:10 The video shows the move to random location box in the behavior tree with a vector set at target location. After the plays test fails the mistake is corrected and the loop is moved in the video. The BB Chase Status is added to the the move to random location box as seen at 10:43 but this is never mentioned and instructions on how to do this correctly are never shown. My guard never searches the last seen point. Seems like something was left out in the editing process. Otherwise great video series up to this point.
@RyanSmith-if6xc5 жыл бұрын
This is where my hang up is too. Did you end up solving it? I ended up not using the 2 Change Status tasks and kept what he did at 7:11 in Chase player and in Find Random Location (just change the enum value to 1 in find random location to switch it to search)
@slozim4205 жыл бұрын
noticed this too and struggling. Followed the tutorial closely but I must be missing something because my AI will only search for the player the first time it loses sight. And other times it loses sight it does not search
@3Dcowboyvideos4 жыл бұрын
I had to come back from video 11 to find this problem. It would be great if anyone found are shared the solution to this. Thank you
@fatihgedik22554 жыл бұрын
I couldn't solve this problem and still AI is working wrong is constantly following me. What did you add to the Fin Random Location, can you write in detail?
@KepperSnapper4 жыл бұрын
For those that need a solution to this, go to Random Location Box Task and add new variable called BB Chase Status, change it to a blackboard key selector (the same way we have been doing), make it instance editable. "Get" the BB Chase Status and drag it onto the event graph, then Set Blackboard Value as Enum.Plug up "Set Blackboard Value as Enum" in between "Set Blackboard Value as Vector" node and "Finish Execute" node, and go back to the behaviour tree and change the "BB Chase Status" on the Random Location Box Task to "Chase Status". TLDR, I copied the way he added BB Chase Status into Random Location Box from the same way he did it on the other tasks. Im not sure whether this will affect the code negatively, but it definitely allowed my AI to patrol after this
@geofferywade56514 жыл бұрын
My college Pre-Cal teacher would come into class, and teach for 25 minutes, and ask if we had any questions, then we'd leave. These classes were usually 55 minutes, and after my first few classes, I got pretty frustrated. It took a few more classes before I realized that he was the best teacher I'd ever had. He could teach us in 25 minutes what other teacher took 55 minutes to try to teach, and often fail. You remind me of him. Your videos are so quick, and concise, and unbelievably informative. You're a gifted teacher, and probably a gifted designer as well.
@megtwin3 жыл бұрын
That being said, did you figure out what he did to the FindRandom Location node? He added a var called BB_ChaseStatus but didn't show us how he implemented it. Can you tell me how it was implemented? I'd really like to continue with this.
@brentk51833 жыл бұрын
Thank you for all this. One thing that was not mentioned is that Apostrophe (') and Numpad 4 while playing turns on the perception debug in the viewport. It helps troubleshoot sight and behavior trees. It will also put all the blackboard variables as well so you can see what is being set, what it is set to, etc. Left side will tell you which branches are being touched as well as count down waits, etc. Good luck and thanks so much, definitely a well earned sub!
@meltemozcelik24274 жыл бұрын
For the people whose AI stop chasing and goes back to the patrol path once it loses sight, my quick fix was adding a find player location task before the move to task in the behavior tree under havebeenchasing part. Hope it helps!
@megtwin3 жыл бұрын
I know it's been awhile but that helped, thanks so much! I wish he would have shown what he changed on the Find Random Location node, but this is a nice workaround.
@빠야-m6e2 жыл бұрын
15:00 I don't know why but, Can See Player's ChangeStatus are not working. So, I just didn't erased ChasePlayer's BB_ChaseStatus. Just writing because maybe someone need help about this.
@clebo994 жыл бұрын
I know you are the expert but what really helped me with all of this was I put print strings at each of the types of NPC actions so I knew if it was chasing, roaming or patrolling. Maybe adding that to other videos would help just to make sure the logic is as you think it should be (and then just take them out when you are done).
@djgentertainment36752 жыл бұрын
Thanks for all your hard work in making these tutorials. They are extremely helpful and much better explained than the majority on KZbin. I don't tend to subscribe to people but I have now subscribed to you. Good job.
@cyberrb255 жыл бұрын
One advice is taking out the Behavior Tree page on a separate window so you can check what the NPC is doing during the trial. It's useful when you don't want to give up yourself to see if it's working as intended.
@captaincookies72222 жыл бұрын
at 10:44 does anyone know where the bb chase status variable on the find random location came from? It isn't showing up for me as it wasn't there before it just appeared. I am very confused
@tanglefur48522 жыл бұрын
Apperently, he done it off screen and seeing one comment, he did the same thing as the the other task that has the chase status variable so in findRandomLocation task enter it make a blackboard variable call it BB_ChaseStatus Get the BB_Chase Status After SetBlackBoardValue as Bool, take out the white node ----> Set BlackBoardValue as Enum, the key is the BB_Chase Variable and value is 1((or wherever the number of the chase you done in the Enum list)) then hook it with Finish execute
@s.kanessuperbiatv64642 жыл бұрын
Mine didn't work at all until I went through the video with a fine toothed comb and saw this. Soon as I added it, it fixed my problem.
@toniconge70035 жыл бұрын
Woah! Wasn't expecting all of this to be easy enough to say in 20 minutes! My AI is working just like yours great tutorial!
@hyperatomart85 жыл бұрын
Hey! Just wanted to say thank you for these tutorials this must be the fourth or fifth unreal ai tutorial series I have done and this has really cemented a lot of concepts for me. I'm currently at uni with some students you use to teach at college by the way hahaha
@RyanLaley5 жыл бұрын
Haha no way. Which students of mine? Hope they are doing well
@hyperatomart85 жыл бұрын
@@RyanLaley Jamie, Mack, Gabe and Callum, just finished working with them on our second-year project actually, your AI tutorials helped with the AI on that too hahaha. Heres the trailer if it interests you kzbin.info/www/bejne/a6fWgml_faamacU
@nicolaykoriagin2 жыл бұрын
Damn, this is so cool. Thank you for this tutorial series!
@rektbymcgegor64825 жыл бұрын
Hey i just Discovered Your Channel and hands down u are the best Unreal Engine Guru Out there your Tutorials have taught me a bunch on Game Dev i'm glad i find this channel i will be spending a lot of time on this channel learning again thxs for putting these Tutorials for free on KZbin cuz for Beginners like Myself this Really HELPS BIG TIME with learning
@TheOneTaboo4 жыл бұрын
I like how you apply your skills to make it easier for the designers because thats what I'm Learning to do for my future job! Appreciate those little touches :D
@adriapolancootero34472 жыл бұрын
9:00 --> were I have paused to continue later :P
@marxmarjoneljovellano40914 жыл бұрын
Make sure Finish Execute Node is checked and on ChangeStatus Node, make sure BB Chase Status is in ChaseStatus not target vector
@pickard19882 жыл бұрын
Thanks! i forgot to change the chase status
@mnl_lnm5 жыл бұрын
Illuminating tutorial so far, thank you so much!
@quinnpriest95874 жыл бұрын
18:11 i dont get that probelm, My npc can still detect me during the search phase
@pathos75274 жыл бұрын
General tip throughout all these, make sure you have your Finish Executes ticked to be successful and all variables you make set to be editable; it doesn’t hurt anything if you ended up not needing to edit them so it’s a good habit to be in to just do that every time. Hope these help a bit.
@marlo3d2884 жыл бұрын
Amazing. Thx for your awesome work!
@yammidummy78252 жыл бұрын
If you have a problem with a little NPC's stuttering before he starting to chase you, just set "abort self" instead "abort both" in "Cant See Player" section. Probably it happens cause of AI perception. It rotate instantly -> sees Player -> Changes "CanSeePlayer" -> Abort both -> Start to patrol -> sees Player and etc., etc. Updated: You also can add "Rotate to face BB entry" right after "FindPathPoint" in patrol section.
@phillips77063 жыл бұрын
hey Ryan, can you continue this series and finalizing making a tutorial of how to add chase theme, it would be really helpful, thanks!
@ScoutOW25 жыл бұрын
I find it funny how i did every tutorial before this one, then just did my own thing, coming back to this realising ive already done all this exactly the same.
@michaellustig13602 жыл бұрын
I added a decorator to the Patrol Path the same as in the Searching section. If a decorator isn't added to the Patrolling section, the AI completes the current path leg before chasing the Target.
@DiegoHodgeAudio4 жыл бұрын
Everything is working until I get to 17:15 Before that, the NPC chases me, when I break line of sight it searches for me a few times and then goes back to it's patrol. When I add the Move To task at 17:15 it causes the AI to just go back to it's patrol as soon as I break the line of sight. Any ideas?
@Eigengrau6084 жыл бұрын
Move "Have Been Chasing" onto "Patrol Path"
@HandiApp5 жыл бұрын
I need some help, my AI doesnt search around, once he breaks line of sight he just goes back to his patrol path and everything is connected
@TheGhos1Face4 жыл бұрын
Same here any fix?
@Askyl4 жыл бұрын
@@TheGhos1Face my issue was that I forgot to set Change Status Task to ChaseStatus, only changed the Status to Changing. So check that after you chase the player in the tree.
@DiegoHodgeAudio4 жыл бұрын
Zackarias Åkerman I had that set correctly and still have the same problem. Everything works perfectly until I add the the move to node at 17:15, once added the NPC just returns to his patrol instead of searching.
@rigooandu4 жыл бұрын
Make sure that you check the Finish Execute in ChasePlayer!
@DangerSideburns4 жыл бұрын
@@rigooandu That helped. Thanks bro
@davidfails28664 жыл бұрын
10:18 the branch goes out but goes back and does the same 3 loops over ignoring the other branch
@CasperLind15 жыл бұрын
THe patrolling guard you made is better than most games :D that one seems hard to even get away from :D
@What_Zen3 жыл бұрын
i'm having an issue where the ai will not search the area after losing track of the player, and will just go back to patroling.
@RecklessJames3 жыл бұрын
Same
@mikhailnikitin1697 Жыл бұрын
Is there any way of testing the AI behavioural tree, apart from the actual gameplay? Unit testing, if you wish. Set up a number of input scenarios and expect a certain output.
@johncarney90495 жыл бұрын
Your tutorials are awesome, thank you for them. I was wondering about non patrolling guards however. I figured out that all that needs done is to assign a patrol path actor to the guard with no points added to the array. When they see the player they do what they should do, chase etc..if they can't find the player they return to their guard position but are always facing the direction they are walking in when they stop (meaning facing a door or wall etc) when they should turn round to face the right direction again. I know how to reset their orientation in c++ super simple, but I am not sure how this can be implemented in your system, so any suggestions would be welcome as most games have guards who do not necessarily patrol all the time. Hopefully that made sense.
@vaggelis58545 жыл бұрын
What if you give the guard a patrol that has 2~3 points, but they are position, so when he returns, he turns around. Like make point 3 your guard post, and the other two behind him. This way when he finishes chasing the player, he will go through his mini patrol and endup facing away from the door/wall
@dailysongsradio82025 жыл бұрын
One problem I think is there in the game is the fact when you get the third person character location, you get a random point navigation. So if you run from the AI sight to his back he just lost you instead of turning around.
@BaseRealityVR5 жыл бұрын
Everything was working great Until the search looping 3 times bit. where you add the change status bit. Now hes just going straight to patrol when he looses LOS and not searching :(. Ok fixed It:) I forgot the success box in the chase player Task ...Doh!
@grantharris73963 жыл бұрын
This is the fix here, folks!
@eskomaijala39852 жыл бұрын
Thank you!
@markguilard3 жыл бұрын
fantastic !!! you really are a master!!
@glasscannon36092 жыл бұрын
Put a fuckin star in hollywood for this brilliant fuck
@mofo095 жыл бұрын
hey, i dunno if you noticed but it seems the loop between target points doesnt work. I think it stopped working after you implemented the increment path index
@TB-oj3nh5 жыл бұрын
Yup, encountering the same problem. Tried to debug the thing myself, but wasn't lucky. Did you managed to correct it yourself ?
@cornelstanescu24125 жыл бұрын
it works for me, and i just did the tutorial. Try checking/unchecking the IsLooping bool, maybe?
@lordrizzimo3 жыл бұрын
Looks weird when the NPC stop chasing you when you're behind him. Is there a way to change the sight radius to a wider angle while chasing?
@LaPriseOBD3 жыл бұрын
In the perception component, under senses config -> 0 -> sense -> PeripheralVisionHalfAngleDegrees (change the angle of the sight radius)
@Restart-Gaming3 жыл бұрын
If you have time can you make a video or go over how I can have my ai come across the map and attach my base or log cabin? and if he see player in the woods they chase and start shooting thanks
@bacgaucam45234 жыл бұрын
Thanks for all these videos so far ! Are you from Manchester ?
@yasinozkan4 жыл бұрын
The behavior tree gets stuck in the ChangeStatus task in the Chase Player sequence and then doesnt move
@clebo994 жыл бұрын
So another question (sorry). So this is working great!!!!! What I wanted to do was add a few additional guards/NPCs. It's working, but I'm seeing Cast Failed when I put in some debugging when I add a second guard/NPC. It still works, meaning that the 2nd NPC does follow me, search if it loses sight and then goes back to the path, but I don't know why the Cast would fail on the 2nd NPC. Any ideas? Again, all I am doing is dragging a 2nd NPC (blueprint class asset) into the level. Ultimately, what I want to do is have several types of NPCs. Some that patrol/search/follow and others that just patrol (I want to simulate just having them go between two locations on the map) and not be affected by the players whereabouts. Thanks in advance.
@RyanLaley4 жыл бұрын
Are you using the same blueprint to add a 2nd npc or a new one? If you have a new one used then you need to create a parent npc and then have children of the parent to be your NPCs in the game
@clebo994 жыл бұрын
@@RyanLaley I am.....what I did was what I had usually done in just dragging the BP onto the map. Are you saying I need to create a parent/child? I don't think I've ever done that. Do you go over that in this series? Maybe I'm just jumping the gun. Again, really love the tutorials. These are so amazing. Thanks again.
@clebo994 жыл бұрын
@@RyanLaley I tried this and while it is still working, when I do Print Strings on the "Cast to 3rd Person" in the Peasant_AI, I am still triggering the "Cast Failed" message. Again, it's weird as it seems to be working except for this error. With one NPC (original, works and no cast failed errors). With more than 1 NPC, still works but I see the Cast Failed issue debug messages. I tried to remove the Parent and only use the Child NPCs and got the same thing. I can post screenshots if you like. I'm going to go through your earlier tutorials to make sure I didn't miss anything. Thanks again!!!!
@DronosVideos5 жыл бұрын
I dont understand i did exactly what you did and my AI doesn't search he return to his patrol path without searching
@gsrocks713214 жыл бұрын
Didn’t need to create an abort for the loop... it worked for me without one and didn’t work with it. Interesting. It looks like it’s constantly checking that first case if the AI has seen me or not, and going from that value.
@RoguePow4 жыл бұрын
is anyone having problems with the patrolling part?, my npc broke after reaching the first patrolling path point and wont move until he sees me>search for me, then he does his patrol normally
@mikedolan034 жыл бұрын
i would guess there is an issue with the patrol path task incrementing logic or the patrol path point itself being unreachable
@RoguePow4 жыл бұрын
@@mikedolan03 nahm i solve it, dont remember if i ucked up, or the uy did, but the problem was on the npc controller whe everything starts after the AI sensor instead of the begin play
@gametamergt Жыл бұрын
I can't get it to enter into the Searching loop. After I break line of sight he just goes back to the patrolling path. I tried the tips left in the comments but still no change
@Vawxel4 жыл бұрын
alright its a bit late for this comment, but for those who are finding that the ai returns to patrol after los breaks, its not the code, its the geometry (most of you are playing on the default test third person map. delete the little box in the level) how it worked for me was that the ai was getting stuck on the box. delete the box and you should be good
@TheGirl-VR4 жыл бұрын
As someone has said the find randomlocation was changed off camera causing this not to work. An update would be helpful
@HyperCazual4 жыл бұрын
When did I miss setting him to walk mode during patrol and run mode during chase?
@arnoldoroblero94324 жыл бұрын
I need help! My Ai doesnt make the searching and the patrolling function
@playerwon56602 жыл бұрын
lol chase and status are fantastic
@stinmanstew45824 жыл бұрын
is there an option at this point to turn down the acceptance radius or is that further on? im working with a large enemy AI and he clips inside my character but im afraid to start changing values lest i break something
@madmodder4 жыл бұрын
So, I found a trick to make it a lot easier to test. Ive got a keypress (F) wired up to a flip flop on the player that either registers or unregisters the player character to or from the ai sight sense. Basically, press the button and its makes you invisible to the guard.
@madmodder4 жыл бұрын
I thought it would be funny to expand on this. (F) now turns the player into a shrub and sets a bool call Player_Is_Shrub to true. Moving while Player_Is_Shrub is true re registers the player to sight_sense and the guard gets suspicious of the moving shrub. If you wanted you could do something like this with a cardboard box or something like MGS.
@langsungintinya61912 жыл бұрын
How to set patrol path when actor spawn?
@nicolafadda89023 жыл бұрын
love the series
@killisys4 жыл бұрын
Hell yeah, brother.
@Sillymonkeies4 жыл бұрын
Guys I went through all the videos again from this point just to fix the AI patrolling issue when you leave LOS, the ai starts patrolling immediately. Can anyone help??
@Sillymonkeies4 жыл бұрын
OOOOOH Took me forever to figure it out! Make sure your NavMeshBoundsVolume is spread throughout the WHOLE level! Press P to see it in green. This took me forever to figure out! DOH
@Vakkemar67002 жыл бұрын
@@Sillymonkeies You're a life saver! I had a small gap in my nav mesh and it caused a lot of trouble
@patrickjesseman3544 жыл бұрын
You are tha MAN Ry!!
@Arxontas104 жыл бұрын
hi! i made chasing the player with a boolean so i can control each NPC individualy if i want it to chase me or not, and i want to do the same with the patroling, but it seems that i lack the knowledge to do so. Any help would be highly appreciated
@BangBang-fd7de4 жыл бұрын
Blueprint Runtime Error: "Accessed None trying to read property PatrolPath". Blueprint: NPC_AI Function: Execute Ubergraph NPC AI Graph: EventGraph Node: Set Value as Bool
@michaellustig13602 жыл бұрын
PatrolPath is assigned to the NPC. You have to select it there in the Default section.
@samerjurdi45175 жыл бұрын
I finished your AI series but still have the AI not seeing me while they are in search mode right after they lose sight of you. Also for some reason they sometimes see me while I'm behind them; and they can see me through roofs although i have their collision set to "block all".
@xMarrilliamsx5 жыл бұрын
So everything is working but I'm getting an error saying that "Accessed None trying to read property Patrol_Path_Blueprint_Actor." Anyone know how or why this is happening? I have no idea why it's saying that. :O
@3Dcowboyvideos4 жыл бұрын
Ryan, could you please explain what happened to "FindRamdomLocation" and how you set up the players position? You must have made changes while not recording.
@TheBackstreetNets4 жыл бұрын
He disconnected it in the patrolling video. Simply disconnect the "Go to Random Location" sequence and move it off to the side. You don't need it anymore.
@samurai_paisa2 жыл бұрын
nice tutorials but I cant use the loop option anymore
@agentarachnid20095 жыл бұрын
How do you add hearing to AI? I have a feeling it's pretty simple but I can't find any useful tutorials. Also, is there a way to attach the sight sense to a particular part of the ai? For example, when the ai turns their head, their sight turns with them?
@soumikbhattacherjee64305 жыл бұрын
AI Hearing is like a interface event call, There is a node in every actor or it's sub class called "Make Noise" that is basically tell al perception in range to register a noise
@mortalcombat19825 жыл бұрын
So I have made some AI they move around randomly and when they spot the player they will start chasing the player, what i want is when the player gets chased the chase music will start to play and will stop playing once the chase has ended, extra marks if you can also tell me how i can make the chase music fade once the chase has ended. Thanks pls help me bro
@RyanLaley5 жыл бұрын
That will be cool to do. I'll make a video of it
@mortalcombat19825 жыл бұрын
@@RyanLaleythank you so much bro really . :D
@mortalcombat19825 жыл бұрын
@@RyanLaley video when it comes ? :)
@RyanLaley5 жыл бұрын
It will be either episode 10 or 11 and they come out every Thursday, or earlier on Patreon (currently 8 and 9 are on Patreon)
@mortalcombat19825 жыл бұрын
@@RyanLaleyty so much :)
@Jahlaric5 жыл бұрын
Can you change the "Sight" radius? Right now it's really hard to get away from the AI and it would be nice to have a bit more control in that. So maybe have a way to set a radius around the AI and if you aren't in that radius anymore he will stop following you regardless of whether you're in it's sight. Awesome tutorials series by the way!!!
@RyanLaley5 жыл бұрын
Episode 10 we will be improving the AI perception to be more 'realistic'
@Anil_Kumar_K5 жыл бұрын
Thank you 🙂
@DronX_5 жыл бұрын
It would be very helpful a tutorial of flocking like fishes or birds
@Omar-vi1vu5 жыл бұрын
Awesome
@BROCKSGAMING3 жыл бұрын
guards in metal gear solid can wait for some time and uses torch to see in dark , can you make a way for ai to do that
@CasperLind15 жыл бұрын
keep it up :D
@SuperSanSanny5 жыл бұрын
My ai was working before and after doing this now my ai wont move at all.