Skip to content
/ icyAI Public

Gym for training an AI to learn Icy Tower through neuroevolution

License

Notifications You must be signed in to change notification settings

nikp06/icyAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About IcyAI

Hello Internet! Welcome to icyAI - a project for which I recreated the game Icy Tower in Python with Pygame and built an AI that learns how to play it - here you can do so to.

Thumbnail

Click here, to see what I did in this project on YouTube.

Download the full project on itch.io (only Windows for now/I would appreciate someone making a mac or linux build and sending it to me :P -> I used pyinstaller on my windows machine).

I made use of a genetic algorithm called NEAT. NEAT evolves neural network topologies through neuroevolution. It is a known method from the domain of reinforcement learning. The concept is further explained in the video. You can also read the initial NEAT paper or browse through the NEAT documentation. This repository contains all files needed to train the AI for yourself.

AI during training

Description

This repository contains everything you need to play the game for yourself or to train your own Icy Tower AI. Feel free to play around with the configuration file. Maybe you'll find a way to make the AI learn even more complex behavior. I'd be curious to know about it in case you do.

How to use

  1. For starting the game:
py icyAI.py
  1. Choose a screen-size (large is recommended, others might change physics of the game)

  2. Simply navigate through the menu:

    • PLAY - play for yourself
    • TRAIN AI - train a new AI and specify how many generations
    • LET AI PLAY - choose a trained model and let the AI play and specify how many runs
    • HUMAN VS. AI - choose a trained model and play against this trained AI menu
  3. Enjoy the game and music, play around with the configuration file, experiment with parameters, analyze the statistics, speed up the simulation

Fitness Stats Speciation Stats Neural Network

Requirements and modules

  • python 3
  • pygame
  • pickle
  • neat
  • sys
  • os
  • numpy
  • tkinter
  • random
  • glob
  • visualize
  • re
  • shutil
  • time