Тёмный

Unreal Engine 4 Tutorial - AI - Part 11 Damage Sensing 

Ryan Laley
Подписаться 109 тыс.
Просмотров 62 тыс.
50% 1

Опубликовано:

 

20 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 237   
@sid2898
@sid2898 4 года назад
Not sure if this was solved in a later video, but for anyone thats stuck with Investigation loops: Add the "Stop Investigating" Task to the beginning of the "Chase Player" Sequence. Also, in the CompleteSense function on the Hearing side of the IntSwitch, Add a Branch that compares the age of the Stimuli so that it can't be higher than 1(or any age you prefer.) So it will only fire the Hearing functions if the age is under 1. I'm sure there is a way easier way to fix this, but this worked for me. :)
@LukasTradingJourney
@LukasTradingJourney 4 года назад
great idea with the branch! thx. I just limited the age on the AIPerception component, which also worked but not as well as your solution :)
@ghostmasaki
@ghostmasaki Год назад
Gold, Ty!
@MastaCGaming
@MastaCGaming 4 года назад
This series could definitely use a revisit. Was so smooth until this episode when it all imploded. The damage sense kinda broke everything else
@TylerSerino
@TylerSerino 4 года назад
If you're noticing an issue where if you put more than one AI into the scene, they run straight to the player - the solution I found is casting to the player after the switch on int for whichever index sets "canseeplayer". Otherwise, the AI sees each other, canseeplayer gets set to true, and they begin chasing you. Also, make sure the object you pass into your cast is the "info target" output on the Get Actor Perception node.
@Efpariah
@Efpariah 2 года назад
excellent!!! This was my Issue! Was driving me insane!
@EyePatch012
@EyePatch012 2 года назад
im tryin to fix the same issue but if i cast the payer before get actors perception it works but damage sensing doesnt work.any solution for that?
@nicolaykoriagin
@nicolaykoriagin Год назад
Excellent advice, thank you!
@Ammaarzor
@Ammaarzor 4 года назад
Hey Ryan, thanks so much for these, really appreciate it. Since I'm doing these on 4.23, there are a few small inconsistencies popping up. First, in the last episode, I didn't have the same issue you had regarding player not seeing you when you play the sounds in the behaviour tree. With the play sound cues in the behaviour tree, it ran pretty much the same as when you moved those actions into the AI controller. Although for me it felt like it was a bit worse. But no big deal. The major issue is now. Before I moved the chasing subtree over to the left-most, it was going as in the previous episode. But after moving to the left-most, it is now exhibiting the following behaviour: 1) If I play sound cue in a place where he can't see me, it acts as normal. 2) If I play sound cue in a place where he turns around and sees me and chases me ... then he stops right in front of me and then investigates instead of attacking. He then waits in front of me until his investigation period is over and then attacks me. But for you, he chases you and attacks you immediately. Another thing I noticed was how at the end of the previous episode, my blueprint structure (the part before you collapse it into a function) is exactly like yours. Namely, the For Each Loop -> Get Actors Perception -> For Each Loop. But at the beginning of this video, that same structure (before you collapse into a function) looks slightly different because now you are missing the "Break" node (the one that breaks the perception into multiple senses pins). It looks as if your 2nd For Each Loop (the one after Get Actors Perception) is somehow merged with the Break Perception node because you have output pins that have the "Array" + . It's like a perfect merge but I don't know how you did that nor how to do that myself. Either way after the merge into function, you basically redid many of those connections and so it looks the same as yours now (you collapsed those pins in the for each loop to make it look like the one that is default, like mine). Most important is the chasing but not attacking behaviour in point 2 that I am stuck on now (and can't move on in the tutorial). Would really appreciate if you can give this some attention. I've followed exactly what you did but there is this slight difference and I don't know enough of the engine to figure this out alone. *UPDATE* Well seems like my "asker's curse" is still alive and well! :D Which is, that I seem to find solutions to problems almost immediately after I write about them. So lesson: write about your problems! lol. Anyway, it was just a matter of placing the investigating subtree underneath the "Cannot see player" selector/decorator. Previously I had it underneath the selector that is underneath root (so I had three overall subtrees in the hierarchy). In any case, beyond this I am still interested in the aforementioned node differences, the for each loop node and the break perception nodes.
@ciceAX7
@ciceAX7 4 года назад
AMG, Dig you find out why the nodes were diffrent? Same issue for me. :(
@Malukito17
@Malukito17 4 года назад
@@ciceAX7 I think is because he has split the struct pin on the array index inside the for each loop, you do this by right-clicking on the array element on the For each loop node
@ciceAX7
@ciceAX7 4 года назад
@@Malukito17 Thanks for the reply, yea i noticed that right after. But thanks any way for the comment!
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@vinayakshivankar7656
@vinayakshivankar7656 4 года назад
@@Malukito17 could you explain briefly please?
@bombum1487
@bombum1487 4 года назад
You should delete Part 10 and part 11, and make new one, very confusied with the way you plug to root selector on part 10 and then change the tree in part 11!
@JoJosDankAdventures
@JoJosDankAdventures 3 года назад
Ignore this crap plz its spam, even the second message is automated
@jamescreed4065
@jamescreed4065 3 года назад
SUCCESS!!!!! My dude! I was able to figure out how to combine this entire tutorial pretty much into the maze game you did as well. Thank you so much for helping me and everyone else with their dev skills :) You're awesome dude
@DeltaTwoZero
@DeltaTwoZero 4 года назад
For those who have next issue(s): 1. Both senses are getting triggered at the same time despite which one you're trying to trigger (e.g. AI sees you, but also hears you at the same time and vice versa); 2. Whistle -> investigation -> spotted -> chase -> break line of sights -> whistle location investigation and after that doing a search; I'm sending screenshots of my senses function and BT. In short, to fix issue #2 you have to reset "isInvestigating" when the player is spotted. It plays the sound as well. If that's not desired functionality just duplicate "StopInvestigating" task and name it "StopInvestigating_NoSound" (or whatever you want) and remove "Play sound at location" node. Regarding issue #1, 'twas hell to understand how it works. In short, every time ANY sense is triggered it runs through all of them. That's why we save "local sense" and after getting it and use it's bool to see WHICH sense was triggered. Yeah, it's complicated, took me a while, but it works. Use my screenshots as a reference. NOTE 1: I've changed the name of some BB variables to accommodate my project. NOTE 2: I don't need patrol functionality, therefore I don't have it. NOTE 3: This is BEFORE adding damage sense. Gallery - imgur.com/a/aZyvF4O
@dudusstar41
@dudusstar41 2 года назад
Hi! I'm having the same issue with both triggered senses but I can't figure it out, and also I can't see your screenshot with the senses function, only the behavior tree. Can you give me hand with this please? Thanks!
@GamePrototypes
@GamePrototypes 2 года назад
Don't really know why. but now my AI won't go into search mode. It goes straight to patrol after breaking line of sight
@AidSta666
@AidSta666 5 лет назад
Mate... I wish I'd just watched this video instead of trying to fix those bugs myself. I lost half a day! Maybe add a note to the end of the previous video saying, bugs are fixed in the next video. Cheers though. Very clear information and easy to follow. Great job and thanks :)
@hyperatomart8
@hyperatomart8 5 лет назад
Just finished the series so far, definitely the best series on this topic I have found! Look forward to adding to my AI as you release new parts.
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@PerFeldvoss
@PerFeldvoss 5 лет назад
Still a very fine tutorial - I did two changes though, the Inspection was done as a ActionStatus (enumerator #3) rather than a bool-variable. This gave a few problems using the BT, but I can set the ActionDirectly there... thus getting a better view of what is happening. (I don't know if that will mess up in the following episodes....) The first thing i did was for the pathIndex counter, I set it up so the index goes between -1 and +1 - the PathIndexIncrement will then switch when the limits is reached. The Index value is still a BB variable! Finally: for some reason the value from the local stimulus location was not Ok for target location.
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@mayankkumartarai8565
@mayankkumartarai8565 4 года назад
how to combine the for each loop with the break ai stimulus one they were separate pins in previous video
@bios.3D
@bios.3D 4 года назад
Anyone has an answer to this?
@mattgrim4905
@mattgrim4905 3 года назад
@@bios.3D Break the link to the break ai sim then right click on the node in the for each loop
@FireDemon11
@FireDemon11 4 года назад
Only issue with the hearing thing is that, if you were to make a NEW sound the AI doesn't investigate the new sound until it finished investigating the current sound. I don't want it like this. He may have fixed it later in the video but I couldn't find it. I'm completely skipping the damage sensing since I don't want the player to be able to deal damage in my game.
@ilikebananas342
@ilikebananas342 2 года назад
I made many improvments to my code during tutorial series so I can't give away straight solution but this is kinda what I did: - in NPC_BT add BlackBoard Decorator to investigation sequence - in this decorator set Black Board key to TargetLocation ... - ... Key Query to Is Set - ... Notify Observer to On Value Change - ... and Observer Aborts to Both Now every time when u use whistle, AI actor will start whole sequence again and change his destination BUT it unfortunally makes a new bug - now u can use whistling during Chasie state - Go to the Complete Sense function in NPC_AI - In the section, that makes AI hear 'Noise', add one more branch that checks if AI IS NOT chasing a player As I said my code is diffrent so yours might need some additional changes for this solution to work
@andytenshi
@andytenshi 4 года назад
I've been going through the tutorial and everything has gone smoothly until this episode. The issue I'm having is whenever the ai gets hit his "can see player" gets set to false. I can't figure out why since hit detection logic is pretty much the same as hearing yet playing a sound while he's attacking me doesn't make him lose sight. I tried adding a branch in the perception sorting function for sight, that fixes the issue of him losing sight when he gets hit, but then he's unable to lose sight of me no matter how far away I get... my attack animation is different cause my character has a weapon he's swinging horizontally with a line trace along the arc, but I don't see why that would be an issue.
@KDmadness18
@KDmadness18 3 года назад
Did you ever figure it out?
@dribbler8131
@dribbler8131 4 года назад
I agree with everyone else this episode could do with a rework and a current update, I have the issue if you whistle then after he walks back to patrolling and whistle again then CanSeePlayer is always set to true and he finds me no matter where I am.
@VergilAlucard
@VergilAlucard 3 года назад
Did you find the solution by any chance?
@dribbler8131
@dribbler8131 3 года назад
@@VergilAlucard Sorry dont think I did, I formatted my PC since doing these tutorials sorry. ;(
@VergilAlucard
@VergilAlucard 3 года назад
@@dribbler8131 it's ok, thx for the reply though
@wkch6431
@wkch6431 3 года назад
I only fixed the bug at the begining of the tutorial but my issue is that after the AI has seen me when it loses sight of me instead of going to the last seen location it goes patrolling
@JesusEffingChrist602
@JesusEffingChrist602 2 года назад
Abit late but im having this issue. Did u get it fixed?
@wkch6431
@wkch6431 2 года назад
I didn't fixed but I went to see another tutorial series from CodeLikeMe In the open world series there is a mini series on AI with Behaviour tree
@wkch6431
@wkch6431 2 года назад
Be careful because there are 2 AI mini series chose the one with BehaviourTree
@JesusEffingChrist602
@JesusEffingChrist602 2 года назад
@@wkch6431 did u start from scratch with their series or incorporate it into this one?
@wkch6431
@wkch6431 2 года назад
@@JesusEffingChrist602 Unfortunately I had to start from scratch It took a bit of time but I think it is worth it
@BaseRealityVR
@BaseRealityVR 5 лет назад
Ryan. There is an issue where the NPC ignores the player until he has investigated the noise. I can make the noise and run out from the corner, the NPC will just run past me to investigate. If he is chasing me I can make the noise and he will stop chasing me and start investigating the noise as I run away. How to fix this?
@superllama6540
@superllama6540 5 лет назад
I had the same problem, and I found out that I didn't have my investigate plugged in to my can't see player node, I had it plugged in to the main selector. You need to have it plugged in to the can't see player node. If you do have it plugged in to that, then I don't know what you did wrong.
@BaseRealityVR
@BaseRealityVR 5 лет назад
@@superllama6540 Thanks for the help : ) , I will investigate
@originallmoney9099
@originallmoney9099 5 лет назад
@@BaseRealityVR Have you had any luck? I have a similar problem, but, I've had the investigate node plugged into main selector (Didn't work) and the can't see player node (Again, didn't work).
@bombum1487
@bombum1487 4 года назад
@@originallmoney9099 i have the same problem with you.
@MaxKusari
@MaxKusari 2 года назад
@@superllama6540 2 years later, but this comment helped me from broken to fixed! thx
@jcapo1803
@jcapo1803 2 года назад
Also spamming the distraction will cause the AI to loop through the investigate phase however many times you pressed the key
@AntonioFreyre
@AntonioFreyre 4 года назад
Hi Ryan, not sure if you will answer since this video is very old. But how can I make it so if I make a sound, the AI starts investigating (but didn't finish that behavior) and then I make a new sound, they will go to the new sound instead and ignore/forget the previous sound
@marcinlapczyk5340
@marcinlapczyk5340 5 лет назад
would be cool if you made a follow-up on this about how to actually have variables in both characters and have them do damage
@Pumpkin6557
@Pumpkin6557 2 года назад
Hola! The Switch On Int node is not in the previous episode. The node path looks completely different. What happened?
@nitesabes220
@nitesabes220 5 лет назад
So the "huh" sound plays every time the ai gets line of sight on the player and the same happens for a sound i added when taking hits, any tips?
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@0u73rh34v3n
@0u73rh34v3n 4 года назад
17:10
@rigooandu
@rigooandu 4 года назад
@@Key_C0de thank you
@FranticDreamerOld
@FranticDreamerOld 4 года назад
I think i found a solution. You can add a branch after the int switch (the hearing one) and connect it to a "less than or equal to" node fır stimilus age. Works for me. imgur.com/gallery/ONAGIAO
@gamermanv
@gamermanv 4 года назад
@@FranticDreamerOld wait i dont get where the white whire goes after the branch. in your image. does it go to branch 0,1 or 2?
@FrancescosToon
@FrancescosToon 5 лет назад
Is it possible to also make like a security camera that allerts the AI when the player walks in front of it?
@RyanLaley
@RyanLaley 5 лет назад
I'll add it to the list
@cometnp4413
@cometnp4413 5 лет назад
With what you've done here, can you make a the overlap inflict damage via float and then play a death animation upon reaching zero health? Also thank you for this series, definitely the best one out there!
@stephenhidalgo7608
@stephenhidalgo7608 5 лет назад
Hi guys I have problem with the senses when I hit the AI, the behavior tree switches to Cannot See Player selector, does anyone experiencing this?
@ryangregg1916
@ryangregg1916 4 года назад
anyone know why when I press the button for it to hear something and then attack it straight away the sound then start playing each keypress ?
@genesissupernova6013
@genesissupernova6013 2 года назад
Would you please take Advanced AI series ? These kind of tutorials are so rare and I'd appreciate it.
@stealthgamesaremyjam145
@stealthgamesaremyjam145 Год назад
After adding the damage sense, after damaging the AI and hiding from them, when I whistle they go to the location they were last hit and not towards where the sound is coming form. is there a solution to this?
@originallmoney9099
@originallmoney9099 5 лет назад
Okay, is anyone else having this specific problem? My NPC won't chase me when he sees me, just say the sound cue for when he hears, then continue on his patrol. When I make my noise, he chases me. I put in print strings nodes after the switch, which seems to indicate he's both seeing me AND hearing me whenever one of the senses is triggered. I've seen people say that similar problems were because they had the investigate branch connected to the selector and NOT the can't see player node, well, I've tried it BOTH ways, and...neither seem to change anything. Anyone got any advice?
@originallmoney9099
@originallmoney9099 5 лет назад
For anyone else who may have had the same problem, I think I got it mostly fixed by NOT converting the sensing to a separate function. Instead, I created a separate Break AIStimulus node for the CanSeePlayer arm of the Branch node. Additionally, I didn't plug the Investigate branch of the BehaviorTree into the Can'tSeePlayer node, but left it plugged into the primary Selector node, then moved the CanSeePlayer branch of the BehaviorTree to the left side and added the abort conditions. My NPC now chases me when he sees me (He still loses sight a little prematurely, but, not as bad as before after resetting his peripheral vision back to 90 degrees), investigates, plays the right sounds when he can't find me, and will still chase me/attack if I make a sound while he's chasing. My only problem is that he goes "Huh?" even when he sees me, which I haven't solved yet.
@叶世杰-b2h
@叶世杰-b2h 3 года назад
OMG I want to give you a biiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiig hug . Recently Wondering how I can get different sense config and can not find a result. This Video''s "bug fix part" accidently tell me how to do it!! realllllllllllllllllllllllly thank you! And I like you UE4 AI video very much. English is not my mother tongue, Hope you can understand
@GoatOfTheWoods
@GoatOfTheWoods 5 лет назад
So, this bug fix only made the behavior worse, for me at least. The AI just came running to me, attacking and then if hearing a sound , he stood still or smthng. My way of fixing it - i don't pretend its the best, but at least it works - is like this: use the OnTargetPerceptionUpdated he fist used instead of the array one, from the actor and then execution node CastTo(your main player) then into a Branch. From the Stimulus drag a break AIStimulus, and from it's Tag drag an == to Noise, that will then go into the aforementioned Branch. The False path goes into a Get Blackboard-SetValueAsBool-MakeLiteralName with the key value being CanSeePlayer , and then bool value of the SetValueAsBool node will be the SuccesfullySensed from the Break AIStimulus node. The True path, goes into a Get Blackboard-SetValueAsBool-MakeLiteralName with the key value being IsInvestigating , and then bool value of the SetValueAsBool node will be true. Next the execution goes into a Get Blackboard-SetValueAsVector-MakeLiteralName with the KeyName value being TargetLocation, and then the vector value of SetValueAsVecto r is the StimulusLocation from the Break AIStimulus node. And thats it
@everabyss
@everabyss 5 лет назад
Please Share the Blueprint. I am having the same Issue
@GoatOfTheWoods
@GoatOfTheWoods 5 лет назад
@@everabyss paste.pics/f1ada6d3f51857af8ba329a61e55ab32
@machupoil4401
@machupoil4401 4 года назад
This worked for me as well :) thx !
@GoatOfTheWoods
@GoatOfTheWoods 4 года назад
@@machupoil4401 Glad to hear!
@astrospacemoth4267
@astrospacemoth4267 5 лет назад
Are there plans for more advanced type AI? I'm thinking of various types of enemies with various attacks and states. For example, the enemy might circle around the player until it decides to strike. Take the enemy Covenant in Halo for example. They were so dynamic in what they could do in combat and it made for some awesome gameplay. Essentially, going beyond the simple "chase and slash"
@RyanLaley
@RyanLaley 5 лет назад
Yep we are working our way up to that.
@astrospacemoth4267
@astrospacemoth4267 5 лет назад
@@RyanLaley Awesome, cannot wait. The knowledge you've been providing is invaluable
@Birdjuice91
@Birdjuice91 5 лет назад
I'm having an issue, If i whistle to get the guards attention he will investigate the noise. If I get seen he will then chase me but as soon as I break Line of Sight, instead of him searching for me he is running back to the noise source and then going back to patrolling. I assume I've got some weird ordering issue but I've triple checked and have the same as what he has in the tutorial. Unfortunately he didn't actually get seen and then break line of sight once he completed that section so I don't know if I messed up or he will also have the same issue.
@НаильНасретдинов-б5ш
I have the same problem, I think the problem is in the behavior tree, In addition, the enemy stops at the whistle and is worth some time, Ryan Laley help solve the problem
@Birdjuice91
@Birdjuice91 5 лет назад
@@НаильНасретдинов-б5ш I worked out why it was happening. It's because when you whistled it would overwrite his target location. So I got around it by creating a new bb vector called investigatelocation and had him go to that, that way when he was done he would go back to target location which remained unchanged.
@DiegoHodgeAudio
@DiegoHodgeAudio 4 года назад
When my player is being chased and the AI loses sight, it goes back to the last place that the player character whistled and investigates instead of going to the last location he saw me to investigate. Is there a fix for this? First thing that comes to mind is creating a new bool for the hearing perception instead of using "TargetLocation" but that seems like it shouldn't be necessary.
@lewismurphy1562
@lewismurphy1562 2 года назад
I have an issue with regards to successfully sensing the damage perception. I've checked in the debugs if the "Report Damage Event" fires, and it does, but when hitting the NPC character, it doesn't successfully sense them. I'm a bit boggled by that, anyone have any suggestions?
@johncarney9049
@johncarney9049 5 лет назад
The problem that I have after implementing the fix for the sensing is that when I make the noise to distract the AI, he goes to investigate (so far so good), but even if I make sure I am out of his Line of sight, the AI runs straight to me, then goes back to the spot I made the sound to complete the investigate before coming straight back to me and attacking (even though I am out of LOS). Anyone else have this issue?
@lordfalcon1111
@lordfalcon1111 4 года назад
Me too, Ryan Laley Pls fix our poroblem
@ioannaotinanai
@ioannaotinanai 4 года назад
i've got a somewhat similar problem, my player character is doing a ranged attack, when it hits the AI it starts chasing me normally, then after a few seconds it will turn and go back to the location i was when it received the damage, then after a few seconds start chasing me again. I've been trying to find out what causes this for a week now, still no luck :')
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@lebeer13
@lebeer13 4 года назад
hey i think the issue could be that your Behavior Trees Nodes need to be adjusted. I had a similar issue and it was because i was using too many variables for the concept of "where should i go to?" and that's what ended up in that confused looking behavior
@FranticDreamerOld
@FranticDreamerOld 4 года назад
I think i found a solution. You can add a branch after the int switch (the hearing one) and connect it to a "less than or equal to" node fır stimilus age. Works for me. imgur.com/gallery/ONAGIAO
@Naiden
@Naiden 5 лет назад
Hm, i think I've done something wrong or there is a bug in the behaviourtree. Whatever I do my AI will always investigate after loosing sight of me, even if I set the boolean to investigate to false. When I open the debug menu it always shows that whenever the AI looses sight of me it changes the boolean to "true". So whenever I press the key to make a sound it will investigate and then do everything just fine, but the moment he sees me he'll run towards me, when he looses track of me he'll go investigate that noise again and then go back to patrolling. It skips over the complete "Search" part. And I#ve tried a lot of things now. I alos tried to make it work with the enumeration to manually change the status, but that doesn't help either. I tried changing the position to make it a lower priority but that didn't work either. So something is seriously broken here. Anybody else having the same issue?
@rigooandu
@rigooandu 4 года назад
I have one question, how do i make so that i take damage from AI?
@LukasTradingJourney
@LukasTradingJourney 4 года назад
yep. It's the fact that the sound itself doesn't expire unless you set Max Age in the hearing settings of the AIPerception component.
@alijahlemay8789
@alijahlemay8789 4 года назад
@@LukasTradingJourney this fixed it for me. thank you
@LukasTradingJourney
@LukasTradingJourney 4 года назад
@@alijahlemay8789 someone else in the comments posted even better solution. Run a branch at the beginning of the hearing part that makes the hearing fire only if the sound age is == 0. This way you'd have better control over the behaviour.
@harshitkishore1841
@harshitkishore1841 5 лет назад
Hey, Ryan. First of all i want to thank the amazing tutorials. They have been really amazing. And to the point. I have noticed one thing. I wonder of you checked it, when you use the hearing sense, I mean we press C and the ai starts to investigate, if you hit it during investigation without being seen, The ai doesn't react to the damage sense. Until it stops investigating. Have you faced this issue with the Ai yet?
@RyanLaley
@RyanLaley 5 лет назад
Hi, I have yes. I am currently working on a bug fix that should fix this issue and all others alike this one. Busy work irl at the moment but working on it asap.
@harshitkishore1841
@harshitkishore1841 5 лет назад
@@RyanLaley I totally understand, Ryan. Thank you for these amazing tutorials. They have been really helpful!
@denseacat
@denseacat Год назад
@@RyanLaley So it was 3 years..
@ryangregg1916
@ryangregg1916 4 года назад
Also, when i press sound key it's not travelling to location of sound but near it ??
@jcapo1803
@jcapo1803 2 года назад
Whistling while being chased causes the NPC to stop chasing and check on the sound.
@georgefountain1186
@georgefountain1186 4 года назад
Hey, the tutorial is great but for some reason my Ai just refuses to sense damage, I have tried using both apply and report damage but neither update the Ai's perception. I'm at a loss to what I could have missed.
@KDmadness18
@KDmadness18 3 года назад
did you figure it out?
@georgefountain1186
@georgefountain1186 3 года назад
@@KDmadness18 Yeah I can't remember exactly which way round it was, but I put the damage sense in the wrong asset, either the controller or character.
@KDmadness18
@KDmadness18 3 года назад
@@georgefountain1186 Oh okay cool
@benvn5992
@benvn5992 3 года назад
Thanks for the tutorial ! But i have a question. When I whistle the NPC goes to the origin of the sound, but when I whistle to another location the NPC will go to the first whistle and ignore the second. I can not find any solution to this problem, despite several attempts.
@Seraian1
@Seraian1 2 года назад
Try calling the stop inventigation and the start of start investigation.
@TylerSerino
@TylerSerino 4 года назад
So, I've implemented the method here but to work with throwable objects. Basically if a throw an object it makes a sound at the source of impact and the ai goes to investigate. The problem is, no matter what blackboard conditions I put on the investigate loop (ie canseeplayer not set) he always fights to turn towards the object, and stop chasing the player.
@MrOnion951
@MrOnion951 4 года назад
I'm having the same problem, using thrown coins to make noise. The AI stops chasing to go after coin, and then won't update can see player during the investigating/search for player phases. Did you ever find a solution to this?
@xXDECAPITATIONXx
@xXDECAPITATIONXx 4 года назад
is anyone else having trouble with ai no longer hearing the whistle?
@cyberrb25
@cyberrb25 5 лет назад
There is one thing, quite small but likely happening, which is that the whistle should also retrigger all the investigating. Would it work if it gets into its own internal sequence in the Behaviour Tree along with an "Abort Both" Blackboard decorator or does it require more to fine tune that part?
@GoatOfTheWoods
@GoatOfTheWoods 5 лет назад
At the moment, really trying to solve that also. Have you found a solution ?
@AntonioFreyre
@AntonioFreyre 4 года назад
@@GoatOfTheWoods I know this is extremely late, but do you know the solution?
@yihiit
@yihiit 4 года назад
After many hours of searching online, I finally figured out why the damage sense was not working for me. Damage sense does not work inside the character blueprint for some reason. I know this because even the debugger damage indicator was not showing up when it was inside the character blueprint. Then I found out a solution; putting another AI Perception inside the AI Controller solved the problem, now it can sense damage.
@yihiit
@yihiit 4 года назад
This solution also changed the debugger settings. For some reason it only shows the Damage sense in Perception mode, before it was also showing Sight and Hearing too. However they are still working as intended, it's just annoying not being able to see them now.
@xMarrilliamsx
@xMarrilliamsx 4 года назад
Anyone know how to get rid of the error Accessed None trying to read property NPC_Patrol_Path Blueprint? It's not causing any visible issues but I imagine it's something that needs to be solved. As far as I can see everything looks the same as what Ryan Laley has done and everything seems to function just the same. Anyone else run into this issue?
@kimnorth7060
@kimnorth7060 5 лет назад
Why did you use Sphere Trace by channel and not object? I always get confused between the two ...
@RyanLaley
@RyanLaley 5 лет назад
You could use either tbh. Channel is best used when you are detecting hits by many different object types. So if you don't specifically know what you want to be 'hitting' then channel. Objects is best used when you only want to hit particular types of objects (e.g. physics objects) In this instance I could have used either.
@kimnorth7060
@kimnorth7060 5 лет назад
Ryan Laley I love the ai tutorial, learning so much. I bypassed the missing melee mesh by simply using another . Thanks man!
@mafazgames4158
@mafazgames4158 5 лет назад
Can you tell me how to make the enemy jumpscare the player ? I have the jumpscare in video file and i want if the enemy touch the player he gets jumpscare
@Jandycon
@Jandycon 4 года назад
Can someone help me out? When my character hits the AI, the AI is thrown away like it has no weight or something.
@DangerSideburns
@DangerSideburns 4 года назад
My AI is defaulting to CanSeePlayer as true a few seconds right after he hits patrol point zero. I have no idea what's causing him to do that since I'm not in either his sight or hearing range. He just comes and runs at me no matter what i do. It's really weird. Edit: I have another test pawn in the world and when he was seeing that one it was triggering the code for sensing the player. I guess the enemy ai doesn't differentiate, it just locks on to you when it detects any other pawn.
@terryadams7778
@terryadams7778 4 года назад
I've just gone through the tutorial series and up until now it's been Awesome! Really Great. But I've got an issue that sounds similar to what other people have got. If I don't make sound - the AI detects and chases me as it should. It will then do the 3-movement random search and return to patrolling. Great. I make a sound - AI stops and plays "huh" and comes to find me. If it doesn't find me it searches and goes back to patrolling. OK cool. If then - it *sees* me it plays the "huh" sound (from hearing sense - not sight) and comes to chase me - but THEN moves to the last sound/whistle spot that existed before. So the hearing is triggering - and then remaining triggered - and is getting mixed in with the sight sense after that. Only happens after the first sound/whistle. Before that all is ok. Can *anyone* help me?
@FranticDreamerOld
@FranticDreamerOld 4 года назад
I think i found a solution. You can add a branch after the int switch (the hearing one) and connect it to a "less than or equal to" node for stimilus age. Works for me. imgur.com/gallery/ONAGIAO
@Jandycon
@Jandycon 4 года назад
@@FranticDreamerOld Thank you so much! Can you post his solution as a comment? This will help a lot to others.
@FranticDreamerOld
@FranticDreamerOld 4 года назад
@@Jandycon Sure thing mate
@yihiit
@yihiit 4 года назад
@@FranticDreamerOld This solution worked for me, thanks a lot!
@FranticDreamerOld
@FranticDreamerOld 4 года назад
@@yihiit Eyw birader
@timurshahmirzof9763
@timurshahmirzof9763 3 года назад
Great video! 👍👍👍 For some reason, when my NPC dies, an error appears because BT is giving the command "MoveTo". How to disable BT after NPC dies?
@KRX01
@KRX01 5 лет назад
can u add different attacks to AI? Like grabbing ?
@discrocisboss
@discrocisboss 4 года назад
So i kind of fixed the audio cue problem everyone is having.. you have to set an age of the Hearing sense.. if you use ' then 4 you will see the AI perceptions... the audio never goes away.. so the integer is always active. So the Audio cue is always playing 9 believe this is what it means, still very new to all this). This also fixed him always returning to the same audio spot.. atleast now i can reset stuff.. the cue plays every now and then if he still sees me before the audio cue age suspends
@jaxxrr
@jaxxrr 4 года назад
I had no problems implementing everything still i'm considering dropping blackboards all together, the whole AI seems like a scuff-fest , the ai never even faces you when it hits and loses you even though its next to you etc ... also everyone makes mistakes but you should really test the stuff you are doing more often ...
@RyanLaley
@RyanLaley 4 года назад
If you want the behaviour tree to communicate to the pawn/controller you need blackboards. Can't have an effective tree otherwise. It is tested before hand. When mistakes are left in it is usually done so you can see how to fix issues. Should never just follow a tutorial (be it mine or anyone elses) blindly, instead take what is being learnt and apply to your own needs. To make the AI face you you have to tell it to focus on actor or location. It's a node we have used before. To make it so he can't lose you whilst attacking you, you can change the perception in the task so that the sense is a wider field of view.
@TheAtlantaWalkers
@TheAtlantaWalkers 4 года назад
How would i set it up so that once the enemy hits the player health would be taken away via a widget? Anyone? plz :D
@TheWitcherWolves
@TheWitcherWolves 5 лет назад
You are the best. One question, could you show how to create difficulty levels where if you choose easy all the enemys will have 75% of normal health, deal that amount od dmg, and so on. But if you select normal than all that is 100%, hard 150%. I'm wondering if a global variable will be good for this, but don't know how to do it the right way.
@mattrossi1898
@mattrossi1898 2 года назад
For some reason When the player whistles to distract the enemy, the enemy does the hmm sound, checks the location, and then heads back to patrol if nothing is found. If the enemy spots the player, or loses sight of the player it is also playing the hmm, sound. I can't seem to figure out why that is because when I look at the AI Debug I can't tell what is wrong due to it flickering so fast. If someone could help me out I'd really appreciate it. It also looks like the AI is a little jittery when chasing and I don't know if that is because he is changing states rapidly or if its something else.
@tanglefur4852
@tanglefur4852 2 года назад
Having the same problem, have you manage to figure it out?
@lalka2655
@lalka2655 3 года назад
If "CanSeePlayer" stop working try another pins on Complete Senses. For some reason Sight working on 1 and Hearing on 2 in my case.
@XMan-lp9bb
@XMan-lp9bb 4 года назад
Why your "For each loop" is so many pins ?
@Malukito17
@Malukito17 4 года назад
I think is because he has split the struct pin on the array index inside the for each loop, you do this by right-clicking on the array element on the For each loop node
@XMan-lp9bb
@XMan-lp9bb 4 года назад
thankyou so much i got it
@BquuD28123
@BquuD28123 3 года назад
How can i increase for each loop pins number?
@sonicherores
@sonicherores 5 лет назад
Hello, so I am having quite a problem for some reason when he loses sight of me he plays the sound and then he goes to check it by himself I have no idea why it happens :( I am still looking into it any idea?
@sonicherores
@sonicherores 5 лет назад
So after adding a new target location if I drop a sound event he chases after me and then if he loses sight he goes back to the sound event and then he goes to my last location to look for me.
@sonicherores
@sonicherores 5 лет назад
At 5:45 disabling that play sound seems to solve him making random noises but he stops chasing me the moment I break line of sight and doesn't investigate, So latest update I found he does not change status after he loses you and just goes back to his patrol path but his status is stuck on chasing.
@sonicherores
@sonicherores 5 лет назад
Ok next day now I figured out what happens but not the why Every time he see's be if I had dropped a sound IsInvestigating is set to true causing him to go back to the spot before searching 3 times and then going back to the loop. (sorry for the spam maybe some one can find this useful).Hiting him and then running away causes him to go back and investigate where he got hit I am so lost haha.
@johnwheel2591
@johnwheel2591 5 лет назад
There is another problem. For each loop gives all stimulus at once so it makes brunch ( stimulus = noise) both false and trues at the same time. And this is a big problem coz I cant make the same function from next episode due to this issue ( it just gives all integers at once( )
@dev_mumu6604
@dev_mumu6604 2 года назад
ha.. idk why this happen.. The enemy seems to be aware of me, but after erasing it, the enemy no longer follows.
@AssassinateThisEzio
@AssassinateThisEzio 4 года назад
So the AI will not say his voice line when i initially hit him but if i distract him with the hearing and then hit him he will say the voice line every time.
@ytlogang9365
@ytlogang9365 5 лет назад
Can you pls show how to enemy can open doors ? thx
@JoeTheSpaceGuy
@JoeTheSpaceGuy 5 лет назад
What's your recording resolution at? It looks very low in the video :P
@Cpt.Tripps
@Cpt.Tripps 5 лет назад
Noticed that as well, not a big deal, but a bit hard on the eyes. Would expect better from 1080p.
@SPSSkals
@SPSSkals 5 лет назад
Something is wrong with this setup... the switch on int triggers both 1 & 2 regardless of which sense is triggered... it keeps going down the second branch during combat, playing my "huh?" investigation sound - disabling the hearing sense still triggers the 2nd switch branch.
@SPSSkals
@SPSSkals 5 лет назад
Oh, I was trying to get this to work before moving onto damage sensing, but I see you fixed the issue at 18:30
@matthewwilliams9709
@matthewwilliams9709 4 года назад
Why is it not coming up with the Recombine Struct Pin?
@matthewwilliams9709
@matthewwilliams9709 4 года назад
Also how come your 'For each Loop' has so many pins
@timurozer6709
@timurozer6709 4 года назад
If I add more than 1 Ai, all system broke how can i fix them?
@bluebardstudios7941
@bluebardstudios7941 3 года назад
How to add character death when it senses damage?
@timurshahmirzof9763
@timurshahmirzof9763 4 года назад
now when I press the whistle button my NPC just stops at the point. but when he sees me, all the time he chase me. Please help!
@maxpowyszynski636
@maxpowyszynski636 3 года назад
Same issue, i cant solve :( ai debug says he is stuck at rotate to face bb entry ....
@rafaelwilliams1500
@rafaelwilliams1500 3 года назад
I think you forgot you changed your Blueprint before the Video it looks nothing like the instruction through PART 10.
@زيد_اليماني
@زيد_اليماني 5 лет назад
Can you make him approach the player if he hears his footsteps?
@callumrowlands1761
@callumrowlands1761 4 года назад
star نجم الالعاب games just use the ‘MakeNoise’ function for that
@ThaGuyWithCake
@ThaGuyWithCake 5 лет назад
If I copy and paste more than 1 enemy into the map (with and without patrol paths, they both auto see player, no matter where they are the BT gets stuck on 'CanSeePlayer'. Please, can someone help? Edit: Even with the Noise event, if more than one enemy is present, none respond to the noise event.
@michaellillis9897
@michaellillis9897 5 лет назад
I had the same thing, Its to-do with the complete Senses function, I have been messing around for a while, think I found a fix. The problem is there is no check in complete senses to see if the actor is actually the player character, so if it sees an actor, such as another NPC then "can see player" is set as true. After the switch on int in complete senses I added Get player character node, and then get actor location, and then == stimulus location within 500 range with true/False output going to the Bool Value in Set Blackboard value as Bool. That seems to work OK but the moment they loose sight they stop and start searching. To fix this I expanded the function back to the AI event graph, and fixed up the errors from not having the Local variable by plugging everything required back into the for each loop by expanding the pins again. Then I made a new variable "Playerhasbeenseen?", straight after the switch on Int get the new Boolean variable, and put in a branch with the set blackboard value coming off the false. This way it will only change the blackboard value if the player hasn't already been seen. Then after set BBValueAsBool set the new variable with the output of the == from earlier, then delay 4s then set the new variable as false. Basically its like an auto success, if it sees the player it wont just instantly loose sight. 4s might be too high, its pretty hard to run away now.
@ThaGuyWithCake
@ThaGuyWithCake 5 лет назад
@@michaellillis9897 Thank you so much for responding! I've tweaked mine a bit, though haven't added a new playerhasbeenseen as I want to keep it relatively simple, though I did encounter a problem where if it chases me and I launch a projectile with sound, it ignores player, investigate sound, then goes back to patrolling forever ignoring player. Any suggestions?
@KrmaStudios1
@KrmaStudios1 5 лет назад
please make a tutorial for the npc to sit down on a bench, get up and resume patrolling :P also another where the ai avoids player and other pawns
@RyanLaley
@RyanLaley 5 лет назад
It's coming soon :)
@НаильНасретдинов-б5ш
What is needed after the death of the player who the enemy returned to the patrol?
@rafaelwilliams1500
@rafaelwilliams1500 3 года назад
OMG It Works!!! I took a Second look at what was done I forgot a Pin. The one thing that happens now is the AI keep looping the notification sounds while it is chasing me. Anyone way to make it play just once from the initial sighting
@masonmids
@masonmids 4 года назад
He’s not even seeing me anymore and I’ve been at it for 5 hours Edit: been a couple weeks and I got it to work but don’t really remember how. If someone is truly struggling I could try to work it out.
@williamwriting1063
@williamwriting1063 3 года назад
I'm experiencing the same thing. Would you mind posting picture links to your NPC_AI and Blackboard, please?
@truthspeaker8243
@truthspeaker8243 5 лет назад
would be cool to see a tutorial deal with ai taking cover and shooting
@RyanLaley
@RyanLaley 5 лет назад
It's on the to do list
@CountOfWoodlands
@CountOfWoodlands 3 года назад
11:00 that typing mistake though rofl lmao
@eragon0147
@eragon0147 5 лет назад
Anybody else has problem that switch on int does not work and system calls both at same time ? i dont understand it at all , even when there was branch it called true and false at same time , im pritty pissed of.
@RyanLaley
@RyanLaley 5 лет назад
The switch on int in this for loop means that it will play through each one. When ever a sense is sensed it triggers them all to be checked. Our switch will simply go through each of our configured senses and if it has been activated, do something. Because this is in a for each loop it could lead to a branch appearing like it is reporting both true and false
@eragon0147
@eragon0147 5 лет назад
@@RyanLaley Oh, ok. Thanks for explaining and fast response . I didnt think about that this way.
@hansillenberger5437
@hansillenberger5437 4 года назад
9:06 isn't the third person character just dabbing
@Cpt.Tripps
@Cpt.Tripps 5 лет назад
Suggestion for future episodes: make the AI use nav links to climb ladders, jump down ledges. That would be fun. Great series overall.
@RyanLaley
@RyanLaley 5 лет назад
First nav link episode is already up for patrons :)
@Cpt.Tripps
@Cpt.Tripps 5 лет назад
@@RyanLaley That's great news - how many AI episodes are there in advance on Patreon?
@r2artCH
@r2artCH 5 лет назад
Doesn't work.... everytime the AI sense the player, instead getting the only the triggered sense Index, it get all the sense from the array. So when the AI Perception triggered from hearing or seeing or damage, it activated all the sense. So in this case both See and Hear and damage sense are true instead only one of them true. I test it by put a print string on each output of Switch on Int, then I triggerd the sense by sound from behind the AI character to see if the hearing sense triggered. I endup getting all of them, First I get the printstring from Seeing sense shown then hearing print string text also shown, then damage sense shown then the default pin from switch on Int also shown...no matter which sense I stimulate, all sense got triggered in order from the First to last of switch on Int Pin.... have any of you guys try this? is it work? Coz I really don't know what I'm missing here.
@RyanLaley
@RyanLaley 5 лет назад
When that event is triggered it outputs every sense. What you need to do is check the Boolean 'successfully sensed' in the stimuli structure.
@r2artCH
@r2artCH 5 лет назад
@@RyanLaley Aahh..now I get it, So the boolean in stimuli struc is actually contains value for each sense in the array. All this time I thought that boolean represent value for all senses, meaning the boolean contain true if one or more of each sense triggered and goes false if none of the senses triggered... damn, I spend two days already trying to find what am I missing. XD.... Never thought it like that, coz in my mind if that boolean contain each of the senses, there should be three boolean output pin since there are three sense index in the array. Thx man... I spend a lot of time looking for UE4 tutorial youtube and find yours are the best by far. Keep up the good work dude...we needed you :D.
@RyanLaley
@RyanLaley 5 лет назад
Thanks! Glad you like my content :) plenty more to come
@devppatabox
@devppatabox 2 года назад
strange targeting and no attack
@GameDevAraz
@GameDevAraz 3 года назад
7:39 Dmg
@MegaMrPaint
@MegaMrPaint 5 лет назад
How can i setup death NPC ?
@RyanLaley
@RyanLaley 5 лет назад
When the enemy runs out of health you just have the AI controller to cancel the behaviour tree by getting the brain component of the controller and use the node stop logic. After which you play an animation/montage
@MegaMrPaint
@MegaMrPaint 5 лет назад
@@RyanLaley Thanks
@slimelabAK
@slimelabAK 5 лет назад
My NPC is no longer moving to the patrol points. He will move if he sees or hears me but after that he just stands there.
@slimelabAK
@slimelabAK 5 лет назад
Ok, had move to in the wrong order so now he moves to the first point but doesn't move to the second.
@slimelabAK
@slimelabAK 5 лет назад
So I figured it out by putting printers right before every finish execute node and tracked what number was being set for direction and array. Found that I needed to put 0 to signal the player moving forward and negative for going along the patrol route in reverse direction. Also took out the loop path because it doesn't seem to actually do anything.
@slimelabAK
@slimelabAK 5 лет назад
It's totally fixed now.
@RyanLaley
@RyanLaley 5 лет назад
Sorry I didn't reply sooner. Glad you got it fixed :)
@heliaxx
@heliaxx 3 года назад
Added sound inside the AI is probably one of the worst things you can do.
@afroks
@afroks 5 лет назад
Part 12 Please
@TB-oj3nh
@TB-oj3nh 5 лет назад
Hey ! I was wondering, is anyone having problems when Spawning the AI (not placing it in the world) ? Mine seems to go crazy on the MoveToPathPoint thing. I was wondering if Ryan Laley, or anyone here, had any input on how to solve this problem. The AI placed in the world works perfectly, but when spawned, goes to the origin & then stops. If it's unclear, here is a video illustrating the problem : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-upfHF2kHzj8.html. If anyone could help, that would be amazing ! EDIT: The only difference between Ryan's version and mine is that the Patrol path is set at the begin play, with the only one available on the level (Get All Actors -> Get @Index 0 -> Set PatrolPath variable)
@unknowndady
@unknowndady 4 года назад
I noticed a setting in unreal that might work for you. Go to you NPC Blueprint. Then click on "NPC(self)" in the very top of the list in the components section. On the details panel in the "Pawn" Section there is a drop down called "Auto Possess AI" with options for "Disabled", "Placed in World" , "Spawned" ,or "Both". Try them out. Its "Placed in World" by default.
@moneynamazi5893
@moneynamazi5893 3 года назад
anyone else saw the get Easter egg at 11:00?
@Mdelacruzmelo
@Mdelacruzmelo 4 года назад
Hi! Can you upload this project in a drive? Just to check where did I get wrong. Please!!! Awesome course!!! You should upload content to udemy, I'd pay for it xD
@RyanLaley
@RyanLaley 4 года назад
This project along with many others is available through Patreon as a Gold tier. I will be uploading content to Udemy this Summer. Will announce when it is up :)
@davidfails2866
@davidfails2866 4 года назад
nvm
@Fhnbfr
@Fhnbfr 3 года назад
Дзякуй!
@NutTapper
@NutTapper 3 года назад
7:39
@djgentertainment3675
@djgentertainment3675 2 года назад
lol at 11:00 oops
Далее
Борщ в стиле высокой кухни!
00:57
I Made the Same Game in 8 Engines
12:34
Просмотров 4,1 млн
Why Do Video Game Studios Avoid Blender?
6:49
Просмотров 654 тыс.
AI Learns to Run Faster than Usain Bolt | World Record
10:22
Unreal Engine 4 Tutorial - AI - Part 6 Guard AI
9:39
I Paid Fiverr Game Developers to Make the Same Game
10:25
TAS Explained: Super Mario Bros. 3 in 0.2 seconds
19:39
I Created My Own Custom 3D Graphics Engine
26:29
Просмотров 97 тыс.
Борщ в стиле высокой кухни!
00:57