Unreal Engine 4 AI Programming Essentials
eBook - ePub

Unreal Engine 4 AI Programming Essentials

  1. 188 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Unreal Engine 4 AI Programming Essentials

About this book

Create responsive and intelligent game AI using Blueprints in Unreal Engine 4

About This Book

  • Understand and apply your Game AI better through various projects such as adding randomness and probability, and introducing movement
  • Configure and debug Game AI logic using multiple methodologies
  • Bridge the gap between your knowledge and Game AI in Unreal Engine 4

Who This Book Is For

This book is for programmers and artists who want to expand their knowledge of Game AI in relation to Unreal Engine 4. You are recommended to have some experience of exploring Unreal Engine 4 prior to this book because we jump straight into Game AI.

What You Will Learn

  • Understand the fundamental components of Game AI within Unreal Engine 4
  • Skillfully introduce Game AI within Unreal Engine 4
  • Configure, customize, and assign Navigation and AI components to your pawn
  • Create, debug, and analyze Game AI behavior
  • Design responsive Game AI using the Behavior Tree methodology
  • Create smart objects designed to interact with AI
  • Utilize advanced AI features within your project to maximize the user experience

In Detail

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.

Style and approach

This easy-to-follow project-based guide throws you directly into the excitement of Game AI in an approachable and comprehensive manner.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Unreal Engine 4 AI Programming Essentials


Table of Contents

Unreal Engine 4 AI Programming Essentials
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to Game AI
Game Artificial Intelligence
How AI affects the gaming experience
Techniques and practices of game AI
Navigation
Achieving realistic movement with Steering
Creating a character with randomness and probability
Creating complex decision making with Behavior Tree
Root
Decorators
Composites
Services
Tasks
Blackboard
Sensory systems
Machine learning
Tracing
Influence Mapping
Unreal Engine 4 tools
Summary
2. Creating Basic AI
Goal
Setting up the project
Environment
Prerequisites
Using our new AIController class
Assigning the AIController class
Placing the pawn
Sending the instructions
Small tips on MoveToLocation
Reviewing the current progress
Adding the challenge
Traces
Reviewing the current progress
The Enemy logic
Adding the Enemy AI
Summary
3. Adding Randomness and Probability
Introducing probability
Probabilistic distribution
Non-uniform distribution
RandomStream in Unreal Engine 4
The plan
Adding Wander
Setting up the project
Creating probability
Non-uniform distribution with RandomStream
Creating transitions
Fleeing and attacking
Back to the action
The results!
Summary
4. Introducing Movement
Overview
Path Finding
The A* algorithm
Navigation Mesh
RecastNavMesh
The movement component
The AIController
Let's start!
Waypoints
Navigation
Navigation Modifiers
Back in the editor
The NavArea class
The navigation cost
Summary
5. Giving AI Choices
Behavior Tree in AIController
Creating Behavior Tree
Blackboard
Designing Behavior Tree
The Behavior Tree service
State transitions
Blackboard Compare Decorator
Environment Query System
Summary
6. How Does Our AI Sense?
Overview
AI Sense
AI Perception components
State machines
Pawn detection
State transition
Resetting the state
Simulating and playing
Summary
7. More Advanced Movement
Setting up the agents
Viewing the agent
Following the agent
Follow or lead
Steering behavior: Flocking
Flocking agents
Controlling behavior through UMG
A simple UI
Summary
8. Creating Patrol, Chase, and Attack AI
Creating a Blackboard
Mid-range attack
Controllers
Waypoints
BT Composites, Task, Decorator, and Service
Creating the logic
Summary
9. What Have We Learned?
Creating basic AI
The pros and cons of using controls
Adding randomness and probability
The pros and cons of using randomness
The pros and cons of using probability
Introducing movement
Giving our AI choice
The pros and cons of using EQS
The pros and cons of using Blueprint
How does our AI sense?
More advanced movement
Creating patrol, chase, and attack AI
The pros and cons of using Behavior Tree
The pros and cons of using blueprint for AI
Summary
Index

Unreal Engine 4 AI Programming Essentials

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2016
Production reference: 1110316
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-312-0
www.packtpub.com

Credits

Authors
Peter L. Newton
Jie Feng
Reviewer
Hamad A. Al-Hasan
Commissioning Editor
Edward Bowkett
Acquisition Editor
Larissa Pinto
Content Development Editor
Merint Thomas Mathew
Technical Editor
Dhiraj Chandanshive
Copy Editor
Shruti Iyer
Project Coordinator
Judie Jose
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Production Coordinator
Aparna Bhagat
Cover Work
Apar...

Table of contents

  1. Unreal Engine 4 AI Programming Essentials

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Unreal Engine 4 AI Programming Essentials by Peter L. Newton, Jie Feng in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.