Book Image

Hands-On Reinforcement Learning for Games

By : Micheal Lanham
Book Image

Hands-On Reinforcement Learning for Games

By: Micheal Lanham

Overview of this book

With the increased presence of AI in the gaming industry, developers are challenged to create highly responsive and adaptive games by integrating artificial intelligence into their projects. This book is your guide to learning how various reinforcement learning techniques and algorithms play an important role in game development with Python. Starting with the basics, this book will help you build a strong foundation in reinforcement learning for game development. Each chapter will assist you in implementing different reinforcement learning techniques, such as Markov decision processes (MDPs), Q-learning, actor-critic methods, SARSA, and deterministic policy gradient algorithms, to build logical self-learning agents. Learning these techniques will enhance your game development skills and add a variety of features to improve your game agent’s productivity. As you advance, you’ll understand how deep reinforcement learning (DRL) techniques can be used to devise strategies to help agents learn from their actions and build engaging games. By the end of this book, you’ll be ready to apply reinforcement learning techniques to build a variety of projects and contribute to open source applications.
Table of Contents (19 chapters)
1
Section 1: Exploring the Environment
7
Section 2: Exploiting the Knowledge
15
Section 3: Reward Yourself

Exercises

As always, the exercises in this section are here to improve your knowledge and understanding of the material. Please attempt to complete 1-3 of these exercises on your own:

  1. What other constants like π could we use Monte Carlo methods to calculate? Think of an experiment to calculate another constant we use.
  2. Open the Chapter_3_1.py sample code and change the value of n, that is, the number of darts dropped. How does that affect the calculated value for π? Use higher or lower values for n.
  3. When we calculated π, we assumed a uniform distribution of darts. However, in the real world, the darts would likely be distributed in a normal or Gaussian manner. How would this affect the Monte Carlo experiment?
  4. Refer to sample Chapter_3_2.py and change the value of n. How does that affect plot generation? Are you able to fix it?
  5. Open Chapter_3_3.py and change the...