Skip to content

Spaceship combat simulator made as an artificial intelligence arena. I'm playing with reinforcement learning, dense and convolutional models with multiple inputs and outputs and neural network made from scratch.

Notifications You must be signed in to change notification settings

Chthi/Ofighters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ofighters

Spaceship combat simulator made as an artificial intelligence arena. I'm playing with reinforcement learning, dense and convolutional models with multiple inputs and outputs and neural network made from scratch.

Screenshots and captures might differ from actual version of the simulator but reflect the overall idea of the interface.

menu_demo

Installing for developpement

With conda

git clone https://github.com/Chthi/Ofighters
cd Ofighters
conda env create --file requirements.txt -n ofighters
conda activate ofighters
pip install --editable ./

Usage

python -m ofighters

Features :

ofighters_presentation

Player transfer

A ship can be directly controlled by and human by clicking the transfert player button. The player ship is gray and shoot green lasers.

random_bot_fight_player

Continuous training

Restart the game every 200 iterations. The number of iterations can be changed in ofighters.py by changing the constant MAX_TIME.

Neural network based artificial intelligence

Many bots are available, but the main one is based on a combination of convolutional and dense layers with two inputs (2D and 1D) and 2 outputs (2D cursor and 1D action vector). It also uses reinforcement learning to study its past actions and to improve, but it does not actually converge and become good (still fun to watch).

simple_untrained_network

Loss graph

Loss graph display the loss of the model used for the bot. Allows to keep track of progression.

loss_graph

Score graph

Score graph display the total score of the bot for each game. Useful to keep track of the progress on the long run.

score_graph

Exploration rate (epsilon)

There is an exploration rate that define the chances of random actions. Epsilon graph display this rate against time. The rate change is automated and can vary linearly or sinusoidally.

epsilon_graph

Action map

The action map displays the decision weights at the output of the model. The bot takes decision based on them.

action_map

Bot inputs

On top of the action map we can see some of the inputs fed to the bot.

bot_inputs

About

Spaceship combat simulator made as an artificial intelligence arena. I'm playing with reinforcement learning, dense and convolutional models with multiple inputs and outputs and neural network made from scratch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages