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

Waypoints


In this chapter, waypoints represent the points that bots navigate to. We will make additional changes to our waypoints to limit who can traverse these points. This will be established by creating an array of actors on individual waypoints. When the pawns go to access the list of available waypoints, they will only add the waypoints they're allowed to. Here are the steps to perform for this:

  1. Start in the same Blueprint folder as before. Right-click on it and create a new blueprint. Go to Custom Classes and select the Target Point actor. We will use this for the sprite it provides.

  2. Name this new Target Point subclass Waypoint and hit Okay.

  3. Open our new Waypoint custom blueprint and create a new public ThirdPersonCharacter pawn array variable called Allowed Access. Then, select Editable so that we can modify this value directly from Unreal Editor:

  4. Now, place some waypoints in the world, and we want to try to make this random. This will allow our pawn's path to be more controlled when...