Skip to content

Asteroids game build to test how to train it with a genetic algorithm.

License

Notifications You must be signed in to change notification settings

ruloweb/asteroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asteroids

Game build using the Ebiten framework and the Kong package.

How to build

go build

How to run

The asteroids game has two commands: run and train, the former runs the game and the latter is used to train a genetic algorithm to play the game.

You can get more information about the commands by running:

./asteroids run -h

or

./asteroids train -h

The train command generates two outputs, the gene file and the results file. The gene file contains the best genome found by the genetic algorithm and the results file contains the average fitness of each generation.

In the output directory there are some examples of the outputs generated by the train command. The output/example.txt file was truncated to fit in the repository, the original contained 10000 iterations.

Examples

./asteroids train \
  --num-iter=10000 \
  --population-size=2000 \
  --max-asteroids=10 \
  --ticks-limit=5000 \
  --grid-width=4 \
  --grid-height=2 \
  --output-gen=output/example.gen \
  --output-results=output/example.txt 
./asteroids run \
  --max-asteroids=5 \
  --ticks-limit=5000 \
  --grid-width=4 \
  --grid-height=2 \
  --ticks=240 \
  --genome=output/example.gen

About

Asteroids game build to test how to train it with a genetic algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors