So I was looking on Youtube and I noticed that a lot of tutorials only go so far as showing AI that either patrol set points and, if it notices the player, runs up and smacks them or only does the later part. So I was wondering if any resources show how to delve into AI that does any form of decision making beyond that. I know there are a few projects on the marketplace that have AI built into them but I’d rather do my own so that I can have better control of how it functions.
It’s really just more of the same!
Look at the breakdown:
What kinds of decisions do you want to make?
What kinds of inputs/stimuli are needed to make those decisions?
What kinds of actions do you need to take based on those decisions?
Now, work backwards!
If you need “find cover” as an action, then build a behavior tree task to find cover.
If you need “press the button to open the door” as an action, build a behavior tree task to go to the button and press it.
Once you have those individual actions you can take, figure out what stimuli you need, and add the ability in your AI controller to input that stimuli.
Now, that you have the actions, and the stimuli needed, finally make the behavior tree make the appropriate decision at the appropriate times.
If you don’t want to use behavior trees, you will instead have to build the same kind of “what mode am I in, and what am I doing moment to moment?” logic in the aicontroller directly, and drive the pawn out of the Tick event. I recommend using the behavior trees, though.
For many of the kinds of actions and stimuli you’ll want (“buttons” or “cover” or whatnot) you may need to build more level markup functions – some way to place a volume or other marker that says “here’s a good place to cover” and “here’s an interactable button.”
@jwatte Are there any videos that give good examples of how to set stuff like that up?
The kind of decision making I’m looking for is more of something like this:
I have a boss character with a handful of moves it can do right. Some are distance dependent, some are health percent dependent, and the rest don’t really have any conditions it can just use them. How would I get it to intelligently decide when to do what? Right now I have it so that it chooses between melee and ranged attacks but it just gets stuck in melee because it has to stay close to my character which fulfils the condition for the melee branch.