Implementing behavior tree tasks and services
Before creating the behavior tree, it is crucial to have a clear understanding of the intended implementation. The AI agent will need to manage the following behaviors:
- Wander around the level looking for target locations
- The default movement speed is running, but if the battery level is low, the movement speed should switch to walking
- Once the battery is depleted, it should stop moving
- Once the battery is fully charged, it should return to the movement pattern
It is worth noting that the battery depletion and recharging logic has already been implemented in the BaseDummyCharacter
class, so we won’t need to worry about it – we will just need to listen to the events dispatched by the character and behave accordingly.
As I mentioned in the previous chapter, the Unreal Engine AI system provides a comprehensive collection of tasks, services, and decorators for our AIs. However, it’s worth...