Gometry Friends is a 2D platform game developed at GAIPS INESC-ID, http://gaips.inesc-id.pt/geometryfriends/.
This project presents this game environment for developing game-playing AI. AI agent is trained by using reinforcement learning and inspired by the works of yanpanlau for the game of Flappy Bird.
Insall requirements.txt file
pip install -r requirements.txt
Or you can create conda environment with
conda env create -f requirements.yml
To enable gpu for Tensorflow,
pip install -U tensorflow-gpu
Only circle agent is available currently. There are 9 different setups to play. These setups are under game_setup.py file. There is one trained model available under /models directory. Training is held for 2 days with TitanX GPU for almost 1 million frames. Model specs are under output/models.csv file.
There are 3 modes available to run the game.
- Human play mode is for you to enjoy and test the environment.
- AI train mode is training the AI agent using reinforcement learning.
- AI test mode is testing the AI agent.
python main.py -g 10 --setup 2
Parameter -g sets how many times the setup will be refreshed until the game is finished. Parameter --setup chooses the setup (0-8).
Press 'q' to exit game and press 'r' to refresh setup.
To start with training mode --train option is required. -s sets model saving path, -l model loading path (not required for new model), --lr learning rate and -v is verbosity.
python main.py --train -s models/<model_name>.h5 -l models/<model_name>.h5 --lr 1e-5 -g 100 -v
python main.py --train -s models/<model_name>.h5 --lr 1e-5 -g 100 -v
To start with test mode --test option is required. And choose setup with --setup.
python main.py --test -l models/<model_name>.h5 -g 100 --setup 2 -v