Hands-On Reinforcement Learning for Games
Implementing self-learning agents in games using artificial intelligence techniques
Micheal Lanham
BIRMINGHAM - MUMBAI
Hands-On Reinforcement Learning for Games
Copyright 2020 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: Sunith Shetty
Acquisition Editor: Reshma Raman
Content Development Editor: Nathanya Dias
Senior Editor: Ayaan Hoda
Technical Editor: Joseph Sunil
Copy Editor: Safis Editing
Project Coordinator: Aishwarya Mohan
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Production Designer: Alishon Mendonsa
First published: January 2020
Production reference: 2240120
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-83921-493-6
www.packt.com
To Larry Hamilton and his late wife Leona. They helped get me started...
Packt.com
Subscribe to our online digital library for full access to over 7,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
Fully searchable for easy access to vital information
Copy and paste, print, and bookmark content
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 such as 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.
About the reviewers
Tony V. Le works in experience design (XD) and specializes in game and web design/development. Tony graduated from DePaul University with a master of arts in experience design and from Columbia College, Chicago, with a bachelor of arts in game design. Tony currently runs and operates a small development studio known as tvledesign LLC, whose core focus is to create unique interactive experiences and help clients create better experiences for their customers.
Micael DaGraa is a professional game designer and interactive creator who works with independent video game studios and creates interactive apps focused on the health and pharmaceutical industries. He studied digital arts at the University of IESA Multimedia, Paris, and ESAD Matosinhos. He started his career as a project manager in a small studio and then gradually started working as a game developer by helping other studios to develop their games. More recently, he has been creating interactive content for the pharmaceutical industry.
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
This book is your one-stop shop for learning how various reinforcement learning (RL) techniques and algorithms play an important role in game development using Python.
The book will start with the basics to provide you with the necessary foundation to understand how RL is playing a major role in game development. Each chapter will help you implement various RL techniques, such as Markov decision processes, Q-learning, the actor-critic method, state-action-reward-state-action (SARSA), and the deterministic policy gradients algorithm, to build logical self-learning agents. You will use these techniques to enhance your game development skills and add various features to improve your overall productivity. Later in the book, you will learn how deep RL techniques can be used to devise strategies that enable agents to learn from their own actions so that you can build fun and engaging games.
By the end of the book, you will be able to use RL techniques to build various projects and contribute to open source applications.
Who this book is for
This book is for game developers who are looking to add to their knowledge by implementing RL techniques to build games from scratch. This book will also appeal to machine learning and deep learning practitioners, and RL researchers who want to understand how self-learning agents can be used in the game domain. Prior knowledge of game development and a working knowledge of Python programming are expected.
What this book covers
, Understanding Rewards-Based Learning, explores the basics of learning, what it is to learn, and how RL differs from other, more classic learning methods. From there, we explore how the Markov decision process works in code and how it relates to learning. This leads us to the classic multi-armed and contextual bandit problems. Finally, we will learn about Q-learning and quality-based model learning.
Next page