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

The A* algorithm


At the core of the Path Finding system is an algorithm that calculates the shortest navigable path between two points on NavMesh. Dijkstra's algorithm is named after the computer scientist Edsger Dijstkra, who originally created it in 1956 and later published it in 1959 to find the shortest paths between two points. There are a few path finding algorithms worth mentioning, but the most commonly used in gaming is a variant of Dijkstra's algorithm. The variant is called the A* algorithm. A* works by having a list of traversable points. Then, from the start position, we want to search for the shortest path in each available direction. We can determine this by heuristic values. These values will tell us how much it costs to traverse to the next point based on some predefined rules. In A*, we traverse from a point to another point to reduce the exploration cost. The big difference between the two algorithms is the fact in A* that you have a heuristic value, which affects your...