Chapter 10. AI for Controlling NPCs

The role of Artificial Intelligence (AI) in your game is quite important. In this chapter, we'll cover the following recipes for controlling your NPC characters with a bit of AI:

  • Laying down a Navigation Mesh
  • Following behavior
  • Connecting a Behavior Tree to a Character
  • Constructing Task nodes
  • Using Decorators for conditions
  • Using periodic services
  • Using Composite nodes – Selectors, Sequences, and Simple Parallel
  • AI for a Melee Attacker

Introduction

AI includes many aspects of a game's NPC as well as player behavior. The general topic of AI includes pathfinding and NPC behavior. Generally, we term the selection of what the NPC does for a period of time within the game as behavior.

AI in UE4 is well supported. A number of ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.