Unreal Engine 4 Tutorial - AI - Part 4 Patrolling NPC

  Рет қаралды 131,554

Ryan Laley

Ryan Laley

Күн бұрын

Пікірлер
@Eric_Malbos
@Eric_Malbos 5 жыл бұрын
Works well, thank you for this very useful tutorial. As a side note for others, at first the Character just move to the point 0 then stopped. All the procedures were all right. It looked like some kind of bug because I simply delete the character from the map, the path point actor and the Navmesh, then put them again on the map and it worked! What a bizarre bug.
@chrisbushell3714
@chrisbushell3714 5 жыл бұрын
Interesting bug, your solution worked for me though. Thanks for sharing! lol
@creativeintegrationstudio3786
@creativeintegrationstudio3786 4 жыл бұрын
OMG I recreated everything from scratch three times trying to get this to work, did as you mentioned, BOOM! worked. Thank you Eric!
@GBTC2011
@GBTC2011 4 жыл бұрын
@@chrisbushell3714 It didn't work for me, I'm using version 4.25.
@varcanoart
@varcanoart 3 жыл бұрын
It didn't work for me. I did everything as in this video.
@MyDisal
@MyDisal 2 жыл бұрын
yeah same here. Replacing the PatrolPath worked for me.
@MaxMakesGames
@MaxMakesGames 3 жыл бұрын
Thanks for the video Ryan you've been great help. A little tip for those still watching now, if you want to make the patrol loop, you can set the index to the index % the array length so when it goes to the last one, it comes back to the first one or you can set a bool to then decrement instead of increment int so it goes back in reverse.
@Danha808
@Danha808 2 жыл бұрын
how do you set the index to %
@MaxMakesGames
@MaxMakesGames 2 жыл бұрын
@@Danha808 I mean like index = index % length. This is called a modulo and it is an operation.
@robo3007
@robo3007 5 жыл бұрын
Great tutorial! Just so you know, a faster way of getting the length of an array and subtracting one is just to use a "Last Index" node instead, which essentially just does the same thing.
@madmodder
@madmodder 4 жыл бұрын
@@dumbstuff2809 As a "jump and figure it out" guy who has trouble paying attention to tutorials, Im sure everything I do is cobbled together from what are probably weird methods, but that "last index" node is cool info.
@radbug
@radbug 4 жыл бұрын
or/also instead of decrementing the array length and then checking
@DinoTrnkaMusic
@DinoTrnkaMusic 4 жыл бұрын
Another thing which makes it even more convenient is to use "Is Valid Index" node on the array ;)
@kingades1013
@kingades1013 3 жыл бұрын
4:54 Something I overlooked that might’ve affected everyone else too. Tip: Remember to click on the npc and assign it’s patrol path on there aswell. We all followed the tutorial but I think a lot of us accidentally ignored this small but certainly not insignificant part of the video. Now my character is moving just fine!
@taiwanjordan7332
@taiwanjordan7332 2 жыл бұрын
You Save Me a Lot Thanks~
@saraquattrociuffi6413
@saraquattrociuffi6413 2 жыл бұрын
DUDE I WAS STRUGGLING FOR HOURS YOU LITERALLY SAVED MY LIFE THANKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@riskyumbrella4874
@riskyumbrella4874 5 ай бұрын
isnt that what they do at your timestamp??
@OsLivrosDoOdenir
@OsLivrosDoOdenir 3 жыл бұрын
If your character is going only to the first point, be sure on 19:35 you're linking the +1 to set BlackBoard as Integer. I think some people are making the mistake of linking the get BlackBoard Value as Integer directly to the set BlackBoard. If you do this, the integer will not increase and your character will stop on the first point. Good tutorial.
@ndy_1
@ndy_1 3 жыл бұрын
Thats a good tip. My NPC is still stopping at the first point. It turns to look at something which I thought was the next destination but when I move index 1 in the scene, it did not look in that direction but only stood still after going to index0 first. Any other tips if the NPC is stopping at index0?
@achuthanarayan7383
@achuthanarayan7383 2 жыл бұрын
@@ndy_1 Check if ur BB ref are connected properly to the exact references when u get bb as int or get bb as vector. I did this mistake
@mattsnotit7662
@mattsnotit7662 2 жыл бұрын
@@achuthanarayan7383 what now? can you dumb that down by like, 1000% for me?
@tingamer2508
@tingamer2508 4 жыл бұрын
if anyone is having issues with the npc not moving past the first point, please double check that at 19:38 in the video you connect the int+int node to both
@top_gaming
@top_gaming 4 жыл бұрын
also make sure the cast to npc node gets connected to the branch i was stuck for 2 days i started from scratch to get same problem then i noticed that lol
@leftright6940
@leftright6940 4 жыл бұрын
still not working. checked everything and every commend i could find. After the "bug fix" in the video it actually broke my ai.
@patrickjesseman354
@patrickjesseman354 4 жыл бұрын
Really enriching the community! Thanks for EVERYTHING Ry!!!!
@ivankorytko3387
@ivankorytko3387 3 жыл бұрын
Btw on 18:15. You can reduce 1 step. Don't take 1 from length, but use "
@GrandmasterPanch
@GrandmasterPanch Жыл бұрын
This helps a lot! My enemy wasn't moving from the first PathPoint; but with just ignoring the "Int-Int" and using the "
@xThuby
@xThuby 3 жыл бұрын
You can simplify the increment index graph by using a modulo operator instead. This will also add looping if you want that.
@DangerSideburns
@DangerSideburns 4 жыл бұрын
If you have issues make sure your navmesh is covering all your points. I've been sitting here for half an hour trying to figure out why my guy won't do the move to command more than once because my second point was out of bounds 👌😂
@pibetry
@pibetry 3 жыл бұрын
Lifesaver!!!
@wamballa5948
@wamballa5948 3 жыл бұрын
Thank you so much!!!!!!!!
@superscrub9
@superscrub9 2 жыл бұрын
geez. that's what was wrong with mine lol. thanks!
@nassergreatdeveloper3745
@nassergreatdeveloper3745 2 жыл бұрын
BRO YOU ARE COMMENT HAS BEEN FOR TOW YEARS BUT YOU SAVE MY LIFE TOO
@letterborneVods
@letterborneVods 3 жыл бұрын
14:48 you can actually straighten it up when it gets like this??? 😱 Omg, THANK YOU. You’re a LIFESAVER!
@Kenelerai
@Kenelerai 4 жыл бұрын
I also faced the problem of the character not moving at all. Сheck if you selected PatrolPathVector in your MoveTo (BT), instead of Target Location
@codycottrell9297
@codycottrell9297 3 жыл бұрын
It took me forever to figure it out but for those of you whose NPC character is not moving at all, make sure to select the NPC in the world, go to the details panel, and ensure that you've selected the patrol path from the drop down menu. It looks like each instance of the NPC bp needs this manually assigned so it's a really easy step to miss if you happened to delete your NPC and drag a new one in!
@Krieglein
@Krieglein 3 жыл бұрын
Lifesaver!!! I cannot thank you enough!!!
@martins2246
@martins2246 4 жыл бұрын
Amazing vids. Probably ancient history but as I troubleshoot my own follow along sometimes a high level view is really what I need (those 1,-1, values related to the Direction got past me) An end state, scan of all the node networks touched in a video would be a really awesome touch. Thank you for the videos!
@TheIsleNarrator
@TheIsleNarrator 5 жыл бұрын
thank you so much for these tutorials my friend! your help is much appreciated!
@twixgamingentertainment
@twixgamingentertainment 4 жыл бұрын
The ++ you corrected actually worked for me and didn't mess up on me as it has done with you. This bug is fixed as of version 4.25
@theguardiank1156
@theguardiank1156 5 жыл бұрын
Plz make a lock on target and AI Takedown system plz
@RH-of5cr
@RH-of5cr 4 жыл бұрын
In case your mannequin runs to the first point and stops: check your IncrementPathIndex file. When comparing the pathindex to the array length Ryan used a decrement box as opposed to subtraction box as part of the comparison. So, in short, go in and where you see the -- (two minus signs) box delete it, right click type minus to get the correct box and use that instead. He did correct the increment box in this video setting it to an addition box. I guess he just forgot to update it for the decrement to minus.
@Furios_Ethan
@Furios_Ethan 4 жыл бұрын
I did it but it has the same issue before I did it all correct and what you mea for minus is >= because I’m sure that’s what you meant if it’s not correct let me know Edit: I also found out that the 0 path point that he was meant to go to but for some reason he doesn’t go there he doesn’t even go to others but the middle of the map I’m using the first person map if you could help with I’ll appreciate that
@AlternativeEXP
@AlternativeEXP 4 жыл бұрын
So Guys. I've been on this video for quite awhile now. Seems that my behavior tree will not move on to 'incrementPathIndex'. The incremented value is hooked up to the 'set bb value as int' and all the rest. any ideas?
@icefire5555
@icefire5555 4 жыл бұрын
I had the same issue. The move to was set to Target location and not "PatrolPathVector"
@jeshiabood6752
@jeshiabood6752 3 жыл бұрын
How can we make the AI random check the waypoints i mean like in random form like not from 1 2 3 then 4 more like first he goes to 1 then he goes to 4 then he goes to 2 then again and so on like in random order please if u can guide me thank you so much
@kimnorth7060
@kimnorth7060 5 жыл бұрын
you could use target points to achieve the same thing instead of creating an actor plus you could have used modulus to check the array length
@RyanLaley
@RyanLaley 5 жыл бұрын
You're correct we totally could do. The reason for making the patrol route a seperate actor is that you could have multiple enemies using the same route or easily have an enemy switch to a different route at run time.
@kimnorth7060
@kimnorth7060 5 жыл бұрын
@@RyanLaley Don't get me wrong, I am learning a lot from your tutorials and very grateful :)
@migueldomingos4570
@migueldomingos4570 5 жыл бұрын
The increment task doesnt run.Pls help..
@migueldomingos4570
@migueldomingos4570 5 жыл бұрын
Thanks, but i have resolved: i made a new level and it worked.Why?It is the second time i have to do this.My advice:don´t use the default level for AI.
@destroyerofchalk6456
@destroyerofchalk6456 5 жыл бұрын
@@migueldomingos4570 You're right! I have the same problem, and I create a new level to solve it.
@nahiansharif4200
@nahiansharif4200 4 жыл бұрын
@@Key_C0de no, im using ue4 4.24, it still the same issue
@playerwon5660
@playerwon5660 2 жыл бұрын
whenever someone catches me mumbling through a problem to myself, i always remind them that im an older model and we werent equipped with as much onboard RAM so i have to run some processes externally, and they are hearing one lol.
@mofo09
@mofo09 5 жыл бұрын
Great videos! Thank you so much for making them. Looking forward to the next AI video.
@FryFish
@FryFish 5 жыл бұрын
My Behavior Tree gets stuck on IncrementPathIndex and my NPC won't move to the other points. I've followed the tutorial very carefully multiple times, checked if the NPC is assigned to the correct path and tried making new levels. Some help would be appreciated since I can't find any sollutions that work... Edit: Holy fuck, I forgot to connect the '+ increment' with the 'set blackboard value as int' aswell, it finally works now -.-
@jackmann1478
@jackmann1478 4 жыл бұрын
3:25 My patrol points are not working. They don't update when I move them and don't replicate when I add to the array.
@maxifink4544
@maxifink4544 10 ай бұрын
As a Tipp for people who are struggling with the NPC not moving: Don't forget to tick the Success boxes in the finish Execute nodes
@Cbyrne2009
@Cbyrne2009 5 жыл бұрын
My character runs to path point 0 and then stops. I've gone through the tutorial a few times but I'm failing to see what's wrong. As far as I can tell everything is hooked up but I have to be missing something simple. Nav mesh is fine, everything is saved and compiles. I have 3 patrol path nodes fairly close to each other. It doesn't exit Move To in the behavior tree to go into increment but it's ordered correctly. Sequence=1, FindPath point =2, Move To=3 and IncrementPathIndex=4
@trap-chan5850
@trap-chan5850 5 жыл бұрын
I had the same problem what fixed it for me was to go to the behavior tree, go to IncrementPathIndex's details, and set the BB_PathIndex as patrolpathindex. I hope this helps.
@slothdude9710
@slothdude9710 5 жыл бұрын
@@trap-chan5850 I already Did that, in the video, but it still just stops
@ksimpson1986
@ksimpson1986 4 жыл бұрын
Did you ever find a fix for this? this is driving me nuts! been on this issue for two days, ready to move forward.
@cupcake-gameclip5129
@cupcake-gameclip5129 4 жыл бұрын
check navmesh bounds volume size, it needs to cover the entire area of ai's path points.
@cyberrb25
@cyberrb25 5 жыл бұрын
One advice when you're checking your solutions (works best for multidisplays): have the behaviour tree visible while running the solution. It shows you if the action works
@konradk1066
@konradk1066 4 жыл бұрын
Thank you! I know I followed the instructions to a T (Random Roam/Chase works), but even with a new level, it doesnt follow the path. BT looks like its getting stuck on FindPathPoint, but its not firing to the others. I'll keep at it. Thank you!
@konradk1066
@konradk1066 4 жыл бұрын
Ok, looks like i failed to change the NPC's Patrol Path to Patrol Path. Now my BT is flipping out all sorts of crazy. At least I'm moving in the right direction! (as opposed to my NPC, lolol)
@konradk1066
@konradk1066 4 жыл бұрын
It works! I had my Move To set to an Acceptable Radius of 2000 while troubleshooting. Set it back to 5 and its all good!! Print strings for the win!!
@shantagmorelbereth1408
@shantagmorelbereth1408 2 жыл бұрын
Hello Guys, If you are sure to have cover all the points in the video BUT your NPC is not even moving to first Patrol Path nav point... well, " Save All", close your project, re-open it and... TADAAAA! It was a fix working fine for me :) Also, the patrol path for NPC, I kind of have 3 of them in the drop down list: While trying to reproduce the Patrol Path explanation, my project kept all of these attempts and gave me 3 Patrol Path in the drop down menu. So be careful with " duplicate" attempts that are remaining in your scene, only one could work among them.
@ericmatthews9894
@ericmatthews9894 Жыл бұрын
My NPC just stands there. I followed everything in the increment path index and the behavior tree, I clicked on the NPC in the world and clicked patrol path in the default section of the details panel. I went back through everything going along with the video again and he just stands there. Ok, I found 3 mistakes, little mistakes, hard to find.
@lluismartinezinavarro6174
@lluismartinezinavarro6174 3 жыл бұрын
8:30 I can't connect "as NPC" to "Get Patrol Path" because it dosen't appear. Anyone can help me? Thanks
@Raistification
@Raistification 5 жыл бұрын
So, my NPC is stuck on the first vector, behavior tree is going in circless, it looks like the path index doesn't change no matter what I do. Any ideas?
@RevengeTradingWLukas
@RevengeTradingWLukas 4 жыл бұрын
have you connected the incremented value (int) to Set Blackboard Value as Int?
@MrMurp35
@MrMurp35 2 жыл бұрын
Silly mistake I made. I'm in UE5 and when I created the Patrol Path actor I did not have a sphere. So I just added one. When my NPC got to the first patrol point he would get stuck. Turns out the sphere blocked the path to the Path point diamond so he couldn't move past point 1.
@TheGforce7204
@TheGforce7204 4 жыл бұрын
If Anyone is having any probs like the npc not moving at all, then remove the selector and directly connect the sequence with the root. Worked for me
@mikhail17
@mikhail17 3 жыл бұрын
Could you explain that again
@BridgesProductions2024
@BridgesProductions2024 3 жыл бұрын
@@mikhail17 How is that difficult to understand? 1. Remove the selector. 2: connect the sequence to the root.
@GAMEBR0VIP2462
@GAMEBR0VIP2462 2 жыл бұрын
This one saved me .
@JamalPennant
@JamalPennant 5 жыл бұрын
Need a bit of help. My NPC behaviour tree is stuck, it keeps frantically switching between find path point and move to. The NPC does not move at all. Its like it cant decide where the path is or confused which one to move to. I am new to this but in the find path point event graph how does it decide which path point to got to?
@MrGamergameplay
@MrGamergameplay 4 жыл бұрын
i made 2way PATROLLING SYSTEM. YOUR TUTORIAL AND OTHER TUT.BUT NOT WORK PATROLLING BOTH WAYS .BUT OTHER TASK ARE WORK CORRECTLY WITH BT.(CHESS PLAYER/HIDE FROM PLAYER)WTS WRONG HOW TO FIX IT
@wEEnoXD
@wEEnoXD 2 жыл бұрын
Enemy doesn't move to patrol paths then i load level from main menu level. Why?
@veneiro
@veneiro 2 жыл бұрын
If you npc get stuck at some random patrol point path check is this point is close enought to the floor. My Ncp is getting stucked all the time at 5 because the patrol point is not close enought to the level floor
@tannerfry2278
@tannerfry2278 4 жыл бұрын
Can someone explain to me at 12:02 the actor transform. I read the code and to me it seems that it should be setting each patrol point to the patrol path origin. It still works in his video so clearly not but I would like to understand exactly whats going on so I don't need to reference this every time I want to do something similar.
@UnrealMilad
@UnrealMilad 3 жыл бұрын
This Tutorial was Really Helpful I'm Here To say Thank You!!
@doufmech4323
@doufmech4323 4 жыл бұрын
Hi Ryan. First of all thank you so much for putting in so much work in your videos. They are really useful. I do have a question though. If I want multiple of the same guard blueprint but I want to give the different paths. I have a path called Patrol Path, but when I make another path called Patrol, I cannot give a guard I placed in the world the new Patrol Path called Patrol, I can only select the Patrol Path. How do I select the new Path? Hopefully my problem makes sense if not, please say so and I will try to explain it in another way.
@Manim8
@Manim8 2 жыл бұрын
Make sure that all NPC's and Patrol Paths are in the same 'Level' if you are using level streaming. If a patrol path isn't in the same level, it won't allow you to select it in the drop down or with the eye dropper :)
@sombatkhruathong829
@sombatkhruathong829 3 жыл бұрын
For my case, in the IncrementPathIndex, using
@ShalowRecord
@ShalowRecord 2 жыл бұрын
what's the point on using spline when you are using point locations
@clebo99
@clebo99 3 жыл бұрын
So here is a question. If I want to have multiple PatrolPaths, I get that you need to assign it within the individual NPC PatrolPath variable. The problem is when I do this, I get a bunch of Accessed None errors for ChangeNPCSpeed and SetMaxWalkSpeed. What I did was just duplicate the NPC to create the 2nd one with the new PatrolPath. What am I doing wrong?
@amoor_art
@amoor_art 2 жыл бұрын
Thanks for the tutorial. please need know How do I make the character at index 3 stop and start the animation or wait the player coming in a certain range or wait for a specific time and then go to index 4 and 5 ?
@M4v3RicK99
@M4v3RicK99 3 жыл бұрын
So I have an issue here where if I add in another AI to the scene, it only follows the same patrol path as the original AI, not any new patrol path I create
@AdelaideBen1
@AdelaideBen1 3 жыл бұрын
Not sure I should answer here - but as he said in the video, you can create any number of instanced paths - based on dropping a different instance of the path BP onto the map. Now, if you want to generate that based on how many NPC you spawn, then I suspect that you had best generate this procedurally (what I mean here is that there are as many paths as you want to create manually - but each NPC you place on the map you need to associate with a given path (or generate new paths procedurally at run time). I could be completely off however...
@kombatmaster1540
@kombatmaster1540 3 жыл бұрын
it works but my ai seems to dead stop at the first point
@framehistory2488
@framehistory2488 4 жыл бұрын
where is the value, patrol path came from? in 8:38, it doesn’t show up
@RyanLaley
@RyanLaley 4 жыл бұрын
It is a variable we make on the NPC but you have to make it editable to have it appear in the details panel in the editor
@ahmedgamal2567
@ahmedgamal2567 4 жыл бұрын
guys i have a problem with my npc: it goes pathpoints 0 and doesn't move beyond. Is there a solution?
@cardesignerchris
@cardesignerchris 5 жыл бұрын
My character is not moving at all?
@cupcake-gameclip5129
@cupcake-gameclip5129 4 жыл бұрын
1. check your execution pin on each blueprint then check whether your navmesh bounds volume covers the area where u put all pathpoint. happened to me.
@DannyshRosli
@DannyshRosli 2 жыл бұрын
How about i wanna him to walk to a random points in the path ?
@RafaelG92
@RafaelG92 4 жыл бұрын
I put everything the same as u did. But my npc just run straight and stops. Does anyone know why
@Levelworm
@Levelworm 5 жыл бұрын
Thanks for the video, not sure why, but when I drag the line from "Patrol Path", trying to link with Get Path Points, it shows an error that "Patrol Path Object Reference not compatible with navigation path object reference". Thanks in advance.
@Levelworm
@Levelworm 5 жыл бұрын
Don't worry, I got it. I forgot to rename the PatrolPath variable.
@FreakSheepVODS
@FreakSheepVODS 3 жыл бұрын
Question i have my default speed for patroling on 100 but how do i set it so when the chase me it changed the movement speed ?
@kevinhoward9930
@kevinhoward9930 3 жыл бұрын
Npc goes to pathpoint 0 and just stops. I've tried deleting him and the pathpoints with no joy. 😔 Just tried the ++ and this actually worked! Also just used the advice from a comment below to get him to loop. 👍
@Alaa_alshahed
@Alaa_alshahed 5 жыл бұрын
great tutorial :) but am facing problem here with my own character that if I have multi NPC using the same method that when the first character arrive to the last point all the other characters keeps moving to the last point but with out animation :(
@stinmanstew4582
@stinmanstew4582 4 жыл бұрын
Hey so I'm having troubles with the behavior tree. I have everything set up exactly in the video yet when i start play the enemy only moves to the first point and doesn't continue to the next point. In the behavior tree it appears that after it does the first move to command it stays on that move to command and doesn't go to the other 2 actions on the sequencer (findpathpoint and incrementpathindex) Any help would be appreciated as i have no idea where my error is
@RyanLaley
@RyanLaley 4 жыл бұрын
Make sure all of your points of the path are in the nav mesh area
@stinmanstew4582
@stinmanstew4582 4 жыл бұрын
@@RyanLaley I just double checked and they are well within the boundries. is there any info i can provide to help figure this out? i'm pretty new to all this
@stinmanstew4582
@stinmanstew4582 4 жыл бұрын
@@RyanLaley I can also provide screenshots via email if possible. i appreciate you reaching out to me! :)
@stinmanstew4582
@stinmanstew4582 4 жыл бұрын
@@RyanLaley I figured it out. I think it had something to do with the fact i had a custom locomotion module (probably isn't the right wording) under the character. after i started a new project and used this from scratch it worked perfectly fine :)
@jojabeca3798
@jojabeca3798 4 жыл бұрын
I'm really struggling to understand the part in the blueprint with the less than or equal to sign, please can someone explain.
@rudolfkrako7679
@rudolfkrako7679 4 жыл бұрын
Hy! In my little game the npc spawning when the player press E close to a panel. But now i cant select the path. What can i do?
@Halenriser
@Halenriser 5 жыл бұрын
Character won't move. No clue what to do. I keep rewatching this and I've followed it to a T, so I'm at a loss.
@SlumpogMillionaire
@SlumpogMillionaire 5 жыл бұрын
Check your NPC Character to see if Patrol Path is still assigned in the dropdown. Unreal is sometimes buggy and resets values when compiling.
@KarenKawas
@KarenKawas 5 жыл бұрын
Same issue, My character finds the first path point but then fails to go to the other 2 points. Have no clue what's wrong.
@gamerpotato2463
@gamerpotato2463 4 жыл бұрын
@@Somordorp plug a print string into your blueprint to see which nodes run and which don't.
@TemporalJimi
@TemporalJimi 4 жыл бұрын
@@Somordorp easy mistake to make that i made a couple of times even but noticed soon enough luckily, go back and check that your tasks return as success
@konradk1066
@konradk1066 4 жыл бұрын
@@SlumpogMillionaire This was my issue, and I completely missed this step. Hopefully this is helpful for the rest of us too!
@XMan-lp9bb
@XMan-lp9bb 5 жыл бұрын
Is anyone got this massage ? Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetPlayerCharacter_ReturnValue". Blueprint: FindPlayerLocation Function: Execute Ubergraph Find Player Location Graph: EventGraph Node: Set Blackboard Value as Vector
@SlumpogMillionaire
@SlumpogMillionaire 5 жыл бұрын
Sometimes Unreal will reset values (a bug most likely). Check your NPC Character to see if it still has the 'Patrol Paths' actor assigned in the dropdown, it most likely would've reset hence it can't access anything.
@XMan-lp9bb
@XMan-lp9bb 5 жыл бұрын
I had fixed the error, Thanks for your answer
@blueknight5448
@blueknight5448 5 жыл бұрын
I dont know why but it says convert integer to bytes. Could that cause any problems?
@megtwin
@megtwin 4 жыл бұрын
These are very well explained and very much appreciated!
@tuomassandroos
@tuomassandroos 3 жыл бұрын
Thank you for these amazing tutorials! I'm implementing path points to a flying character. If I set it's gravity to 0, it will stay in air but doesn't follow path points (ground character works well). But it will chase a player and search. I wonder is this just an error in my blueprint or do I need to specify something for flying character's path points? Also, after flying character lowers flying height, it won't rise up afterwards even though character is higher... Any ideas you could share please?
@SamFuller1989
@SamFuller1989 4 жыл бұрын
I know this is an older video, but maybe someone can help. My NPC is consistently ignoring the last patrol point index I place. Everything else is working fine, but if I want my npc to, say, follow along three patrol indexes I have to create a placeholder forth index. It's likely a simply issue, but I've been wracking my head to no avail.
@cupcake-gameclip5129
@cupcake-gameclip5129 4 жыл бұрын
check your navmesh bounds volume, it need to cover the entire area. any point outside the area, the ai wont go there
@rigooandu
@rigooandu 4 жыл бұрын
So i have made my character to chase me (without using blackboards) and when he does not see me he starts to roam around. The problem is that when he is chasing me he randomly looks back or in random directions. Can you please help me? EDIT : I just started using Blackboards , they are a lot better
@pullsardev
@pullsardev 4 жыл бұрын
Thanks for these awesome tutorials.
@brianmarkowitz
@brianmarkowitz 4 жыл бұрын
So i just want to make sure of something. If i want to have both the patrolling at and a roaming ai, i would have to have two different blackboards and trees. Right?
@RyanLaley
@RyanLaley 4 жыл бұрын
That certainly is one way of doing it yes.
@carlorodriguez1312
@carlorodriguez1312 4 жыл бұрын
I know this is a relatively old video, but what would be more efficient between using an Actor for the patrol path as opposed to a Target Point? (if anybody else in here happens to know, that'd be awesome)
@Rad_Roxxi_Music
@Rad_Roxxi_Music Жыл бұрын
old reply, but yes. The Actor Class has a lot of built-in code and utilities that the Patrol Path doesn't need and isn't going to use
@carlorodriguez1312
@carlorodriguez1312 Жыл бұрын
@@Rad_Roxxi_Music Even though the question was from awhile back, thank you for the response! :)
@jokerspirit1
@jokerspirit1 4 жыл бұрын
If you are watching this and your NPC is only running to the first point AKA the PatrolPath Actor. Open your Behaviour Tree while unreal is playing and you should see it switch between the tasks extremely fast! Click on the Increment Task and set your BB_PathIndex to the PatrolPathIndex. Mines only ran to the PatrolPath Actor and stopped because it was using TargetLocation. Hope this helps people.
@ksimpson1986
@ksimpson1986 4 жыл бұрын
Man. mine is set correctly and it still only runs to point 0 and stops...I've spent two days on this and thoroughly checked to make sure everything is exact. i just don't understand.
@DiogoMontoia
@DiogoMontoia 4 жыл бұрын
worked perfectly
@mohamedmafaz6538
@mohamedmafaz6538 4 жыл бұрын
I deleted the point path from the scene and added it again and it works, looks like a UE bug
@macalbert05
@macalbert05 3 жыл бұрын
@Ryan Laley how about a spawn AI Actor?
@Dudevid
@Dudevid 5 жыл бұрын
FWIW, I was able to use the increment node (and also add support for the index to roll back around to zero, which I'm sure you'll handle in the next episode). Here is a screenshot of my (messy) BP, if you're interested: i.imgur.com/kytqxvB.png EDIT: I should add, I love and hugely appreciate these tutorials!
@ricksanchez6110
@ricksanchez6110 3 жыл бұрын
that was so helpful omg i was stuck on that part and spent like 9 hrs trying to figure out what I did wrong TY SO MUCHHH
@Dudevid
@Dudevid 3 жыл бұрын
@@ricksanchez6110
@DraconianSG
@DraconianSG 5 жыл бұрын
do you think you can do a lobby like fortnites how it have characters standing on podiums and there is a background
@redking8585
@redking8585 3 жыл бұрын
Epic can put the Event BeginPlay, EventActorBeginOverlap and EventTick which we often delete on every BP (kinda like the default cube in blender) but having EventReceiveExecuteAI and FinishExecuteAI in the tasks is a step too far :'D
@himanshupatil7378
@himanshupatil7378 3 жыл бұрын
I am trying to use this with airsim! It works fine without Airsim, but doesn't when I run on AirsimGameMode! Any ideas?
@r11va39
@r11va39 3 жыл бұрын
Maybe incorrect NavMesh Bounds Volume size?
@roendpunt
@roendpunt 4 жыл бұрын
I think you need to fix this tutorial. Char runs to actor patrol point. But not to second one. Perhaps cuz of the updates it has changed. Tested on version 4.24.3 and 4.25
@cupcake-gameclip5129
@cupcake-gameclip5129 4 жыл бұрын
i tried this tutorial, exactly copy as he done, no problem atm, for that problem, check navmesh bounds volume cover the entire area of path points. any point outside navmesh bound, the char wont go to there
@roendpunt
@roendpunt 4 жыл бұрын
@@cupcake-gameclip5129 ill try it again then. Thx for the comment
@fishomelette4871
@fishomelette4871 5 жыл бұрын
Hi, after I made a new level and I used the same patrol path, the AI doesn't follow the points anymore. It still reacts when the player moves in front of the AI, but it fails to follow any path at all anymore. Anyone knows of a fix to this and why it may be happening? Thanks!
@r11va39
@r11va39 3 жыл бұрын
no NavMesh i think
@wEEnoXD
@wEEnoXD 2 жыл бұрын
did you find out why?
@DeliriousGames
@DeliriousGames 5 жыл бұрын
Hi Ryan ! Your Tutorial Serie is great but I have one question ? how can I put a condition using the BT ? I want my AI to chase the player only if it has not the same color than me, and if color is the same, the AI dont react to my like an enemy ? Thank you :D
@konradk1066
@konradk1066 4 жыл бұрын
This sounds like it could be solved with a variable that gets the color, and then casts it to the player. Branch it if true, chase. If false, don't chase. Adding a collision preset that changes with the color could work, too (trace channel)
@unknownprakrit2682
@unknownprakrit2682 4 жыл бұрын
My brain just got vectored
@spencerhopkins8314
@spencerhopkins8314 5 жыл бұрын
I implemented this and it's super broken and I have no idea why. for some reason my actor only moves a couple feet towards the patrol path point before stopping completely and moving on
@RyanLaley
@RyanLaley 5 жыл бұрын
Make sure to check that your nav mesh covers the whole level. Toggle it's debug visibility with the P key.
@spencerhopkins8314
@spencerhopkins8314 5 жыл бұрын
@@RyanLaley yup its covering the entire navigable area I have no idea why it's like this. it's not aborting the move to its succeeding and moving on
@slimelabAK
@slimelabAK 5 жыл бұрын
@@spencerhopkins8314 I had this same problem and I went to the FindPathPoint blueprint and saw that my transform location return value was not connected to the Set Blackboard Values as Vector. Once I connected it it ran fine.
@spencerhopkins8314
@spencerhopkins8314 5 жыл бұрын
@@slimelabAK I checked they're hooked up fine
@oliverteigaga4843
@oliverteigaga4843 5 жыл бұрын
i had a simiilar problem and it was because when transforming the path points into world location, I accidently got the tranform from my npc character and not from the control path actor 11:22. Otherwise try different path points more closer together to see if it still behaves the same way
@ksimpson1986
@ksimpson1986 4 жыл бұрын
@Ryan Laley I've gone over this video for two days, and no matter what I do the NPC only moves to point 0. that's it. I've deleted and replaced everything, and I've made sure to go step by step about ten times. not sure if something changed in 4.24.3 or what. I'm not a complete UE4 noob but I'm just diving into AI stuff. any other suggestions on why the NPC won't move to the next path point?
@RyanLaley
@RyanLaley 4 жыл бұрын
Make sure all path points are in the nav mesh. Seems to be the most common error people make.
@ksimpson1986
@ksimpson1986 4 жыл бұрын
@@RyanLaley I definitely made sure! the navmesh is covering the entire plane. Right now I just have a plane and a couple of static mesh obstacles in the area. I have 3 nav points towards the middlish of the plane so they're nowhere near the edge.
@ksimpson1986
@ksimpson1986 4 жыл бұрын
@@RyanLaley So i ran a print string on the branch inside of IncrementPathIndex, and it's returning false after reaching point zero. That seems to be the problem, Not sure what needs to be adjusted in order to set it to true? If i set the branch to complete on false instead of true, it works perfectly...? lol
@jonathantewnes1224
@jonathantewnes1224 4 жыл бұрын
@@ksimpson1986 For Me Kyle in the increment node I forgot to hook up the line from the Int plus node to the set BB key value. So the Increment node always stayed on 0 which made my AI never progress to the next point. Hope this helps
@cupcake-gameclip5129
@cupcake-gameclip5129 4 жыл бұрын
check execution pin on each blueprint you made, 1 single miss cause this to happen.
@rifz42
@rifz42 5 жыл бұрын
This patrolling is good for a robot, that repeats the same path exactly, but how would you add more randomness to the path and speed for a human? Thank you for your great tutorials!!
@RyanLaley
@RyanLaley 5 жыл бұрын
You can add points to the path in runtime
@rifz42
@rifz42 5 жыл бұрын
I'm not sure how to do that.. what if there were 10 people walking along on the path, they all follow exactly the same line to the target and it looks fake.. what if they were drunk and staggering around while moving to the next target, how would you do that? Thank you!! : )
@redragg176aj8
@redragg176aj8 5 жыл бұрын
@@rifz42 You could copy and paste the AI and give them all different speeds and what ever else
@rifz42
@rifz42 5 жыл бұрын
@@redragg176aj8 yes that would help but they would still all beeline the shortest exact same path. I'd really like a way to have AI running across a battlefield, dodging and weaving to make it harder to hit. without putting in tons of way points..
@ThatUndeadPerson
@ThatUndeadPerson 4 жыл бұрын
can you give my the code for the one please
@preston748159263
@preston748159263 3 жыл бұрын
The Increment Path logic is blowing my mind. If you see this comment please type out a short walkthrough :)
@cvoiceofficial
@cvoiceofficial 5 жыл бұрын
Kind of confused. You mentioned in one of the last videos that the whole point of the player controller was so that you can assign the whole controller to multiple AI. So why not use the player controller's blueprint here?
@Eric_Malbos
@Eric_Malbos 5 жыл бұрын
There is no player controller since the controller is yourself (your actions on the keyboard or gamepad) and you can't use the BP of your player since it is based on input (key or gamepad). What you can reuse is the animation BP of your player.
@cvoiceofficial
@cvoiceofficial 5 жыл бұрын
@@Eric_Malbos Alrighty. Thanks
@N317V
@N317V 5 жыл бұрын
Why can't I use the increment node? It seems to work fine for me. Are there any side effects I am not aware of?
@radbug
@radbug 4 жыл бұрын
id also like to have an explanation when the presenter says "we cant use this". I hate it when people just make blanket statements and dont explain the reason. absolutely enrages me. and so I am going to use the increment until it breaks.
@vast634
@vast634 4 жыл бұрын
Interesting to see how people can write AI using visual tools. But that "increment path" logic kind of already shows the limits of that, as this pretty simple logic gets quite complicated when constructing it with visual nodes. I wonder how people can handle really complex AI, without falling back to writing code here.
@aaronh248
@aaronh248 4 жыл бұрын
What is the code for this in C++ / C#?
@vast634
@vast634 4 жыл бұрын
@@aaronh248 i++; The rest depends on the context of the Ai architecture, and cant be answered in a short comment.
@aaronh248
@aaronh248 4 жыл бұрын
@@vast634 The context would be exactly what this video is doing. You said it gets overly complex, so was curious what it would look like in C++ / C# for a comparison. You said it was simple logic though which it is, even here. Just looks different since its visual. And yeah I have limited knowledge but atleast some in programming and i++, which is just the incremental part of this code structure here, would do absolutely nothing.
@vast634
@vast634 4 жыл бұрын
@@aaronh248 This would be code that could fit into that kind of environment. bool incrementPathIndex(ActorType Actor, BlackBoardType BlackBoard) { if ((NPC)Actor.PatrolPath.PathPoints.lenght>BlackBoard.PathIndex+1) {BlackBoard.PathIndex++; return true;} return false; } As I have said, the context and the architecture are important. There is a limit of using visual tools efficiently for complex logic. Thats the reason why programmers use written code. Visual tools are useful for simpler logic, or definitions (like material shaders) that are rather linear, and require lots of iterations by non-programmers.
@FF-FAN9999
@FF-FAN9999 3 жыл бұрын
the task workflow is awful(having to create a new item and renaming it) ...epic needs to fix this asap
@FlfyCats17
@FlfyCats17 4 жыл бұрын
*IRL Achievement Unlocked:* do the kind of math that bends your brain backwards in knots, resulting in a headache that you are strangely proud of because unlike in traditional school paperwork math it actually resulted in something useful that you enjoy!
@cristianodenver
@cristianodenver 4 жыл бұрын
Really Great Tutorials!!! Very Helpful. But i have an Issue when i try spawning my AI, the NPC dsnt follow the path. Please Help!! I am Kinda Stuck here.
@gamerpotato2463
@gamerpotato2463 4 жыл бұрын
I think the Patrol Path only applies to the NPC instance in the world, cuz we did it in the detail panel, so if you want following the patrol path to be the nature of your AI, you need to reference it in it's blueprint. Create a variable of Patrol Path type in your NPC.
@r.u.s.e3586
@r.u.s.e3586 5 жыл бұрын
For anyone else watching this tutorial, don't put a hidden static mesh on the actor. I tried to do that so I could see the target origin easier but for some reason it will completely kill your behavior tree.
@megtwin
@megtwin 4 жыл бұрын
Does it still affect it if you have 'can ever affect navigation' on that static object unticked?
@ScoutOW2
@ScoutOW2 5 жыл бұрын
What about many paths for different AI?
@RyanLaley
@RyanLaley 5 жыл бұрын
Do you mean a single AI following multiple paths? Or multiple airline following the same path? The latter will work with no extra changes. The former you need to change the patrol path reference variable in run time for whatever is the trigger to change to a different path
@ScoutOW2
@ScoutOW2 5 жыл бұрын
@@RyanLaley Like in Far Cry, each enemy has there own patrol path.
@RyanLaley
@RyanLaley 5 жыл бұрын
@@ScoutOW2 that's what this system in the video does. You can create another patrol route and set it to which ever AI to follow. Multiplier AI could follow the same or could be set all different ones.
@ScoutOW2
@ScoutOW2 5 жыл бұрын
@@RyanLaley Heh, sorry. I only roughly went through the video.
@ScoutOW2
@ScoutOW2 5 жыл бұрын
@@RyanLaley Youre right, its perfect to what i needed. I cant believe out of the 4 years ive used ue4 i never knew you could convert a get variable to a is valid, this is going to save time in future projects!
@TrespasserAlt
@TrespasserAlt 5 жыл бұрын
I did every thing in the tutorial right, but my AI doesn't even work! He just runs into the orb! Please help me on this!
@slothdude9710
@slothdude9710 5 жыл бұрын
Same man
@Ice247mathews
@Ice247mathews 5 жыл бұрын
@@slothdude9710 did you check to see if you put the increment path into the behavior tree and that you set the proper blackboard keys
@slothdude9710
@slothdude9710 5 жыл бұрын
@@Ice247mathews Nvm I found it out, thank you so much
@Halenriser
@Halenriser 5 жыл бұрын
@@slothdude9710 What was the solution
@slothdude9710
@slothdude9710 5 жыл бұрын
@@Halenriser its been awhile, i kindly forgot, sry
@PrecisionPrintworks
@PrecisionPrintworks 5 жыл бұрын
whats the best way for the AI to travel from the last point to the first point?
@RyanLaley
@RyanLaley 5 жыл бұрын
You will see next week :) (or now over on Patreon.com/ryanlaley)
@RyanLaley
@RyanLaley 5 жыл бұрын
If you want to try figure it out yourself, you need to think about the array index
@PrecisionPrintworks
@PrecisionPrintworks 5 жыл бұрын
👍🏻
@PrecisionPrintworks
@PrecisionPrintworks 5 жыл бұрын
@@RyanLaley Thanks, it took me awhile but i figured it out. tinypic.com/r/2hgtnjm/9
@N317V
@N317V 5 жыл бұрын
Just set the path index to zero when the branch node yields false.
@r11va39
@r11va39 3 жыл бұрын
Thank you very much
@meow75714
@meow75714 3 жыл бұрын
Good one mate. Veery useful functionality to know how to do it/
@torpid2906
@torpid2906 2 жыл бұрын
thx so much for this tutorial bro,\
@AnkitKumar-sz5wu
@AnkitKumar-sz5wu 4 жыл бұрын
It's working fine with increment also🙄
@radbug
@radbug 4 жыл бұрын
might have been an issue with that older ue version ?
@zsarfraz8938
@zsarfraz8938 3 жыл бұрын
My AI isnt moving at all, even after me watching the video 100 times. Any assistance will be appreaciated.
Unreal Engine 4 Tutorial - AI - Part 5 Patrolling NPC Continued
22:03
Unreal Engine 4 Tutorial - AI - Part 1 The Behaviour Tree
16:43
Ryan Laley
Рет қаралды 380 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
The Best Unreal Engine Sample Project you've never heard of
9:10
Unreal Engine 4 - The Easiest NPC Dialogue Tutorial EVER
9:04
Beardgames
Рет қаралды 79 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
Unreal Engine 4 - AI Damage Player
11:58
Titanic Games
Рет қаралды 96 М.
Unreal Engine 4 - AI Roam
9:22
Titanic Games
Рет қаралды 65 М.
Unreal Engine 5 - NPC - Patrol Path
13:51
Adam BPC
Рет қаралды 9 М.
Unreal Engine AI Controller Follow Player
5:24
Jayanam
Рет қаралды 62 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН