General Game Player

Tyler Pearson



Program that learns to play OpenAI Gym games using a TFLearn Neural Network in Python




Overview

The goal in making general game playing algorithms is to create a program that is able to successfully learn to play as many different kinds of games as possible. My approach is modeled after one published by sentdex (linked below). On a general level, it plays a large number of random games. From this population, it uses data from games that meets a certain score threshold to create a neural network that maps attributes of the current environment (ie user position, pole angle, cart velocity, etc) to the expected value of possible moves (ie move right, move left, etc).

The gifs below are screencaptures of sample runs of an agent playing different games with random moves (left side) vs a trained neural network agent playing the same games (right side). The pictures following those gifs show the scores of sample runs of a trained neural network agent. The first (left) is from CartPole with possible scores ranging from 0 (worst) to 500 (best). Next (middle) is MountainCar, -500 (worst) to 0 (best). Finally (right) Acrobot, -500 (worst) to 0 (best).

Further details including my initial goal for the project, stumbling points, shortcomings and successes are provided in my project write-up (linked below). Apologies for the chaos and general messiness of this site, it was all thrown together on limited time and webdev experience!




Sample Games


Random       vs       Trained


CartPole

Goal: Balance stick on cart for as long as possible

Random Trained

MountainCar

Goal: Get car to top of hill as quickly as possible

Random Trained

Acrobot

Goal: Raise robotic arm to threshold elevation as quickly as possible

Random Trained

Sample Trained Scores

Scores out of 500 Scores from 0 to -500 Scores fomr 0 to -500



Related Links