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


Similar to the AI Sense project, these waypoints will have a reference to the next waypoint. This simple link between two waypoints allows us to create paths for our AI to navigate to.

Now, we should move on making these waypoints; perform the following steps:

  1. To begin, let's right-click in the space inside the Folder section and go to Blueprint. At the bottom, search in All Classes for TargetPoint. Select it and then hit Select to create it. Then, name it Waypoint and open this in EventGraph.

  2. On the left-hand side under My Blueprint, add a variable waypoint named NextWaypoint. We will use this to find the next waypoint to transverse to.

  3. Add four waypoints to the level and link them together using the NextWaypoint variable. The connection should look similar to A->B->C->D->. D should then connect to A, thus creating a loop.