Hands-On Deep Learning for Games
Leverage the power of neural networks and reinforcement learning to build intelligent games
Micheal Lanham
BIRMINGHAM - MUMBAI
Hands-On Deep Learning for Games
Copyright 2019 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 author nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Larissa Pinto
Content Development Editor: Pranay Fereira
Techincal Reviewer: Yosun Chang
Technical Editor: Sachin Sunilkumar
Copy Editor: Safis Editing
Project Coordinator: Kinjal Bari
Proofreader: Safis Editing
Indexer: Rekha Nair
Graphics: Alishon Mendonsa
Production Coordinator: Shraddha Falebhai
First published: March 2019
Production reference: 1290319
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78899-407-1
www.packtpub.com
I would like to dedicate this book to my employers at Geo-Steering Solutions Inc., Neil Tice and Barbara and Darrell Joy who have gone out of their way to assist my research in helping me to finish this insurmountable book.
Micheal Lanham
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Micheal Lanham is a proven software and tech innovator with 20 years of experience. During that time, he has developed a broad range of software applications in areas including games, graphics, web, desktop, engineering, artificial intelligence, GIS, and machine learning applications for a variety of industries as an R&D developer. At the turn of the millennium, Micheal began working with neural networks and evolutionary algorithms in game development. He was later introduced to Unity and has been an avid developer, consultant, manager, and author of multiple Unity games, graphic projects, and books ever since.
This book would not be possible if it wasn't for the researchers and contributors. This book has been built on top of, including the development of the ML-Agents toolkit by Unity Technologies, with both Dr. Danny Lange and Dr. Arthur Juliani taking a leading role. This book would also not be possible without the support of my family, friends, Rhonda and my co-workers. I'd like to give a special thanks to those who attend my deep learning tutorials and have given additional feedback.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
As we enter the 21st century, it is quickly becoming apparent that AI and machine learning technologies will radically change the way we live our lives in the future. We now experience AI daily, from conversational assistants to smart recommendations in a search engine, and the average user/consumer now expects a smarter interface in anything they do. This most certainly includes games, and is likely one of the reasons why you, as a game developer, are considering reading this book.
This book will provide you, with a hands-on approach to building deep learning models for simple encoding for the purpose of building self-driving algorithms, generating music, and creating conversational bots, finishing with an in-depth discovery of deep reinforcement learning (DRL). We will begin with the basics of reinforcement learning (RL) and progress to combining DL and RL in order to create DRL. Then, we will take an in-depth look at ways to optimize reinforcement learning to train agents in order to perform complex tasks, from navigating hallways to playing soccer against zombies. Along the way, we will learn the nuances of tuning hyperparameters through hands-on trial and error, as well as how to use cutting-edge algorithms, including curiosity learning, Curriculum Learning, backplay, and i mitation learning, in order to optimize agent training.
Who this book is for
This book is for any gameor buddinggame developer who is interested in using deep learning in an aspect of their next game project. In order to be successful in learning this material, you should have knowledge of the Python programming language and another C-based language, such as C#, C, C++, or Java. In addition, a basic knowledge of calculus, statistics, and probability will aid your digestion of the materials and facilitate your learning, but this is not essential.
What this book covers
, Deep Learning for Games , covers the background of deep learning in games before moving on to cover the basics by building a basic perceptron. From there, we will learn the concepts of network layers and build a simple autoencoder.
Next page