Book Image

Unreal Engine 4 AI Programming Essentials

By : Jie Feng, Peter Newton
Book Image

Unreal Engine 4 AI Programming Essentials

By: Jie Feng, Peter Newton

Overview of this book

Unreal Engine is a powerful game development engine that provides rich functionalities to create 2D and 3D games. Developers have the opportunity to build cross-platform mobile and desktop games from scratch. This book will show you how to apply artificial intelligence (AI) techniques to your Unreal project using blueprints as your scripting language. You will start with an introduction to AI, and learn how it is applied to gaming. Then you'll jump right in and create a simple AI bot and apply basic behaviors to allow it to move randomly. As you progress, you'll find out how to implement randomness and probability traits. Using NavMesh, you will impart navigation components such as character movement, MoveTo nodes, settings, and world objects, and implement Behavior Trees. At the end of the book, you will troubleshoot any issues that might crop up while building the game.
Table of Contents (16 chapters)
Unreal Engine 4 AI Programming Essentials
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Let's start!


Open up Unreal Engine 4, and let's start a new Third Person template project. We want this so that we can use the Third Person pawn as one of our AI-controlled pawns. So, select the settings as in the following screenshot and hit Create Project:

Next, we want to create our new AIController, and this will be responsible for telling our pawn to move between two points. The plan is to introduce some obstacles to see the effect we can have on the pathing of our AI. Perform the following steps:

  1. Let's start by going into the Blueprint folder. Right-click to create a new AIController class and name it SoldierAI. This AIController will be responsible for navigating the pawn provided by the starter content.

  2. Remove the pawn from the level initially set up by Content Example. Then, we want to place two new ThirdPersonCharacter pawns in the level across from each other. Next, we want to open up this ThirdPersonCharacter blueprint and access its default values.

  3. From here, let's find this pawn...