In this multi-part series, Ian Shadden and Alexander Paschall show you how to use all of the relevant systems and features (Behavior Trees, EQS, Navigation Meshes, AnimBlueprints, AnimMontages, and more) to design, create, and optimize AI for use in a game environment with all of the requirements and restrictions that go along with that.
In Part 3, Ian and Alexander will extend on the generic interaction system to create new behaviors for AI. Also, more work with stats and visualizing values with UMG.
Tuesday, Nov 17th @ 2:00PM-3:00PM ET - Countdown]
Ian Shadden - Sr Training Content Creator
Alexander Paschall - Community Manager @UnrealAlexander](https://twitter.com/UnrealAlexander)
Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer everyone’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!
Since it kinda crapped me during the Game Jam:
Can you make the dude walk around while he’s ok, but stop his movement immediately when be gets hungry, and then run for lunch asap?
Analogy would be a Guard walking around/patrolling, stopping his patrol and running towards the player when he’s alerted.
In my (fairly simple) Behavior tree, I couldn’t get the Sequence Branch “Find Random Walk Location” - “Move To” to abort immediately and switch to “Find Player Location” - “Move To” as soon as the “Is Player nearby” Service signals; the bots kept finishing their random “Move To” before going after the player (obviously ending up in a stale location if the player moved on since).
Is AI Perception (Hearing sense) working now with blueprints in 4.10?
Yes, when using a Blackboard Based Condition Decorator, or really a number of the built in C++ decorators, there are the Notify Observer and Observer Aborts options. Setting the first to “On Value Change” and the other “Self” should immediately kill the branch, return failed, and move on to the next step in a Selector (but completely fail out of a sequence of course).
Then you just need to handle your new move to location in the next branch of the tree.
edit: Now with more image!
Hey Ian, thanks!
You kinda touched on this during the stream already, and thats when I noticed the difference to my BT. I was using an EQS Query to find “Targets” and Move to that target when found; otherwise break the sequence (by failing the EQS query) and go back up to the selector to take the “Pick a random location and move to it” sequence. There is a service in that place, but it’s doing something else, so it wasn’t changing the value being checked in the decorator (which is what should cause the subtree to abort and pick another one).
Did a quick check, and yes, the “Report Noise Event” for the “AI Perception Stimuli Source” component is firing off hearing events for the AI Perception system. I had to set the hearing sense on my pawn to detect Friendly, Enemy, and Neutral for it to work, but that’s more because I don’t quite know how to set a Stimuli Source as an Enemy/Friend/Neutral.
This was the WORST training stream ever. It ended at a point where the project was unfinished and not working correctly. Now I have to fix it myself or else it bothers me and I can’t get any sleep until I fix it. YOU ruined my life!
Joking aside thank you for doing something a little bit more in depth. I’m excited to see it finished with all the little dudes doing stuff and then applying my imagination to make my first game that really uses good Ai.
Trad with google sorry…
I have followed this " livestream " and tried to reproduce, everything works well until the end of this part 3. At launch the pawn goes patrol when then stamina become low he will eat one . But then he gets stuck and does not move until he dies . Did I miss something? It should start patrolling but do not. I checked the variable “StatChoice” become to 0 after eating food packages while health is still at 100. Thanks in advance
I still seek out that blackboardKEY " FindFoodKey " remains to True when the Stamina is 100 it would have to revert to False.
edit2: Problem resolved
I’m having a lot of trouble following this tutorial, especially in this video.
Is there any chance you might be able to provide the project files for this on github or some similar service after each video?
I was doing well until the engine crashed while I was working on a blueprint and when I reopened the project
it wasn’t working properly and I’m not sure how to fix it.
My only option now it to start over from the beginning.
BT ‘Move To’ after EQS randomly fails? 4.18.3 actually and this is based on the “Making Game Ready AI” tutorial that Ian and Alexander were doing.
So, I have a AI BT and use an EQS to find good and bad food.
This is strange as most times it works fine, but randomly, even though the Blackboard value is set to a valid existing food item, the “Move To” step craps out and the “AIS Character” blueprint character doesn’t move - he’s stuck. It could be the 1st, 3rd, 4th or 8th piece of food - like I said - random.
Even though he could be in the middle of the nav mesh with nothing around him, and lots of food to choose from. The BT freaks out and looks like it ‘aborts self’. You might think, well, he’s no longer ‘bTired’ so the BT is aborting to the ‘find random location’ sequence, but this is not the case.
In order, it ‘looks’ at the bTired condition on the find random location side, aborts that side, goes to the find food side, runs the EQS, fills the ‘desired object’ BB value, and then the Move To step craps out randomly.
So, what could I do?
I basically ripped out all the pieces for finding, moving to, and using the desired object. Now everything is ok and works. It seems there is ‘old stuff’ left behind in the BT when the underlying classes/queries/services represented in the BT are updated outside of the BT.
I hope this helps someone.
For Ian’s issues, well, at least his issues on connecting the StatBlock to the ‘OwningPawn’, just add a custom event to the StackBlock, then raise that custom event once you set ‘self’ to the variable in the AIS_Character. You don’t need a ‘delay’
See both attached pics
Necro’ing this to see if anyone has the updates / off screen changes? Or know where they might be located.