Unreal Engine AI with Behavior Trees | Unreal Engine

preview_player
Показать описание
In this presentation, Epic's Paulo Souza uses Unreal Engine's built-in AI features to build smart enemy behaviors for a game with stealth-like mechanics.

By relying on the Gameplay Framework in Unreal, we're able to quickly create convincing AI using Behavior Trees. Behavior Trees are great for creating complex AI that can be presented in a way that is easy to understand and to debug. We also make our AI react to sight and hearing senses using the AI Perception System, but also adapt our Behavior Tree decision tree as well.

In the end, we use the Environment Query System to allow our AI to be aware of the world geometry before deciding the next move, making it look way smarter than it actually is.

**TIMESTAMPS**
00:00 Intro
00:57 Gameplay Framework
02:26 Behavior Trees
06:55 Blackboard
11:17 AI Perception
19:20 Environment Query System
Рекомендации по теме
Комментарии
Автор

For those who can't understand the "alertState task" part, I'll give you a hand:

1) Create a custom enum:
a) Content Browser -> right click -> Blueprints -> Enumeretion
b) Into the enum click to add and in display name write the three state (Alert, Neutral, Investigate)
2) Create a interface:
a) Content Browser -> right click -> Blueprints -> Blueprint interface
b) Into the interface create a new function and call it changeState
c) Into function parameter inputs add your custom enum
3) Function into BP_AI:
a) Open BP of your AI and call event changeState promote the parameter of event into a variable call it "AlertState" the type obv must be your custom enum
b) Add a "Do Once" with a custom reset function
c) Create a "Select" with variable "AlertState"
d) Link this select with a function for change walk speed
e) Finish the script with Reset function create by "Do Once"

Obviously add the task to the BT :)

snowbeat
Автор

I've learned more from this 26-minute video than I had watching a 6 hours series on youtube. Extremely well prepared and packed material.

sgamestudio
Автор

Please create more tutorials like this. Also, Let Paulo do them all. he's great at explaining it all.

GDXR
Автор

Pro tip: make sure you set the Instigator to Self (or Reference to self) for the Report Noise Event, for anyone having issues with the Hearing sense firing properly. Had this issue in UE5.1 where the On Target Perception Update event was not firing unless that Report Noise Event had an Instigator plugged into it.

I have been inching my way through this video for a little over a month now and so far, at 17 minutes in, encountered this first issue most likely caused from version differences. Good job!

RobertGameDev
Автор

More short, straight-to-the-point tutorials like this please!

Schytheron
Автор

Extremely useful tutorial. I am just about to start a horror game with hiding places, so I'm really glad I can refer to this video to make some intelligent AI.

EtzeNuegez
Автор

3 minutes into this tutorial covered what other courses couldn't cover in hours!
We really need more of this.

amrooo
Автор

I'm so happy that this wasn't one of Unreal's "live training" videos. It would have taken five times as long to give the same amount of information. Thank you for taking the time to make a structured tutorial! More videos like this and no more live trainings please! :)

denishoule
Автор

This tutorial literally saved my AI. I had random timers and branches for states in the enemy bp. It was messy and non reusable, so I finally made the switch to Behavior Trees. And honestly they are amazing.

momentime
Автор

I noticed you included some information that was not built as we went along, like the Set Alert Mode event and the Enums. That would have been good to know. But otherwise, this was very informative and like others, I hope you do more short tutorials like this in the future.

aaroncampbelldm
Автор

6:16 Holy crap, I was not ready for that sentence....

AngryPlayerGaming
Автор

Props to M. Souza, it's a very clear, concise yet complete presentation. Epic, give this man a bonus and put him in charge of more tutorials like that!

plagiats
Автор

Could you please add a separate unrelated tutorial to that awesome VFX effect of laser scans the drone actor is executing ?

ilw
Автор

This might be the best UE5-topic tutorial I have ever seen. Definitely the best produced and professional.

beanutgames
Автор

Please upload this project! It will help a lot of people learn!

yoman
Автор

This is hands down the best explanation of behavior tree. I have a complete understanding of how BTs work! You are a great teacher.

blaqueaddonnisgames
Автор

This is so great, the best tutorial about AI covering Behavior trees, keep the good work and please, more tutorials like this are always welcome!

VincenzoRavo
Автор

It's very good except that it doesn't talk about how to deactivate if the AI cannot see the player anymore. It works with "inside" the view range and the distraction which forcibly resets the patrol, but not really "outside" which I presume would work in a different manner.

BaeronBubba
Автор

Note if you have multiple pawn classes that the AI can sense but don't want them to always attack them, I created an Enum of relationships - Love, Neutral, Hate and made a Structure to add to my enemy_base class, holding a "Map" of enemy classes and the associated Enum relationship. So in let's say an enemy_wolf there will be said structure variable with every other enemy like PlayerPawn -> Hate. Just extract the "Actor" pin from "On Target Perception Updated" from AIPerception and call a "Find" to the relationships structure with that Actor, it'll give you the associated Map value - the relationship status - and if it equals Hate, THEN you can set TargetActor.

If you want them to forget the target, right click on the Stimulus pin of the "On Target Perception Updated" and split the pin, there's a bool for successfully detected. If false it means it was detected earlier and no longer is. Branch that to false to unset ( Clear Value node ) TargetActor or the AI will constantly chase you no matter what.

jeyqruw
Автор

Best explanation of Sequence vs Selector nodes to date.

Jambax