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

RandomStream in Unreal Engine 4


Say you want to freeze the randomly generated trees you've made. Typically, when using a random node from UE4's artillery, this information will be lost once you exit the game. With RandomStream, you can actually save the seed that generated the random output and load the same random output by calling on this seed. So in UE4, you will find a blueprint node called Make RandomStream. This node has one input pin called Initial Seed.

The reason we use a seed is because this is a pseudo random-number generator. This means that the numbers are calculated and are deterministic. Pseudo means that we will use algorithms to calculate the randomness; however, by calculating the randomness, we technically know what it will be beforehand, thus making it deterministic. The contrast is true randomness, which captures noise from a forest, waterfalls, the atmosphere, or even a TV channel. The reason this will be indefinitely more random is that the noise captured is unlikely...