Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
/ rolling-balls Public archive

Collect more gift than an AI opponent in this fast-paced Christmas-themed game.

License

Notifications You must be signed in to change notification settings

ostamand/rolling-balls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rolling Balls of Christmas

logo

Introduction

Rolling Balls of Christmas is a fast-paced game where you get to play against an AI opponent trained through a reinforcement learning algorithm.

The rules are simple. Both the player (in green) and the opponent (in red) control a ball sitting on a square platform while a gift (the target) is also located on it. Each time either the player or the opponent reaches the gift it gets one point. Inversely, each time a ball falls off the platform the respective opponent gets one point. The first one to get to 20 points wins the game. Each level the opponents gets better.

logo

  • To play the game navigate to the Download section. Available for Windows and Android.
  • To watch me play a game follow this youtube link.
  • To learn more on how the opponent was trained using reinforcement learning follow this link to my blog.
  • To train your own agent using the provided training environement with 12 parallel agents use these steps

Download

The game is available for Windows & Android.

  • Link for Windows. Extract the zipped folder & double click on the .exe to play.
  • Link for Android. Download to your device and install to easily add to your apps.

To move the ball on Windows use either the arrows or the W (up), A (left), S (down) and D (down) keys. On a mobile device use the provided control at the bottom right of the screen.

Installation

To train your own agent follow the steps below.

Create a Python virtual environment.

conda create --name rolling-balls python=3.6 
activate rolling-balls

Install ml-agents.

git clone https://github.com/Unity-Technologies/ml-agents.git
cd ml-agents
git checkout 0.5.0a
cd ml-agents
pip install .

Clone this repository.

git clone https://github.com/ostamand/rolling-balls.git

Download the training environment and copy/paste the content of the extracted folder to Training/data

Train the agent using the included PPO algorithm (or use your own).

python train_rolling_ball.py