Creating enemy wandering behavior
In Chapter 9, Building Smart Enemies with Artificial Intelligence, we set the default behavior for enemies as a patrolling movement between two points. While this worked well as a testbed for our hearing and seeing components and would be appropriate for a stealth-oriented game, we are going to ramp up the challenge and action of this game's experience by replacing this behavior with random wandering. This will make avoiding enemies significantly harder, encouraging more direct confrontations. To do this, we are going to return to the BT_EnemyBehavior
Behavior Tree.
Identifying a wander point with a custom task
We need to create a key in BB_EnemyBlackboard
that will store the location of the next destination that the enemy should wander to. Unlike the PatrolPoint key, our destination won't be represented by an in-game actor but, rather, by vector coordinates. Then, we will create a task to determine where in the level the enemy should...