Chapter 8. Continuing with Intelligent Enemies

This chapter continues with the previous one and completes the AI project by focusing on the theory and related coding underpinning an intelligent enemy. The enemy will demonstrate three main behaviors: patrolling, chasing, and attacking. In this chapter, we will dive into the following topics:

  • How to plan and code an AI system for enemy characters
  • How to code Finite State Machines (FSMs)
  • How to create the line-of-sight functionality

    Note

    The starting project and assets can be found in the book companion files in the Chapter08/Start folder. You can start here and follow along with this chapter if you don't have your own project already.

Enemy AI – range of sight

Let's now start developing enemy AI by thinking ...

Get Unity 2018 By Example - Second Edition 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.