This repository contains a multi-disciplinary project combining Godot Development and Machine Learning. The core objectives are:
- Developing a Snake arcade game following the .NET standard and using Godot v4.5 for the visual.
- Developing a Machine Learning C++ Library and train a model using imitation learning to effectively play the game.
The final product demonstrates a self-learning agent capable of playing the game trained using real players data
- Game Engine: Godot Engine (Version 4.5)
- Language: C#, C++20, Python 3.11
Go to https://github.com/xaxam2001/Snake/releases/tag/v2.0.0 and download the Godot .zip archive. Extract it and launch the Snake.exe executable.
- Use the
directional arrowsorWASDto move. The difficulty is set on Normal by default. - Choose to enable the AI agent or not (if yes, you can choose a model by specifying the path of one of the bin file contained in the
Modelsfolder).
Go to https://github.com/xaxam2001/Snake/releases/tag/2.0.0 and download the .exe file. You can either:
- Launch the
.exefile like any other program. Use thedirectional arrowsorWASDto move. The difficulty is set on Normal by default. - Run it through the command line
.\Snake.v1.2.0.exe [difficulty]and choose the difficulty from0: easyto2: hard.
Corecontains the C# Library used for the Snake Game logic. It is completely separated from the visual and can be use with any game engine.ML_libcontains the C++ Library for the machine learning agents.snake-cmd-visualcontains the C# project for a simple Snake displaying in the console.snake-godot-visualcontains the Godot project for the Godot visual version of the snake game.Model trainingcontains the Python source code for testing the ML_lib.Modelscontains all the pretrained models used by the AI agent in the game.PowerPoint Presentationcontains the different presentations made for this project.Datacontains thecsvfiles recorded during gameplay for training the models.
The models are named following this convention: [NumberOfExamples]X_[Layers]_[number of iteration]_[learning rate]_[proportion of train].bin
Best model so far: 46696X_[520, 128, 64, 4]_1400000iter_0.01+0.001lr_0.9train.bin
- C# Core library to run the Snake logic.
- Command line visual for debug and play the snake game.
- Godot 2D visual for the Snake Game
- Implementing the ML_lib for the Linear Model (classification and regression).
- Implementing a recorder to start collecting the Data
- Implementing the complete ML_lib (Multi Layer Perceptron, Radial Basis Function Network).
- Build different model using the ML_lib.
- Train these different models using collected player data.
Done for now.
- Maxime Chalumeau - (https://github.com/xaxam2001)