asteroids

command module
v0.0.0-...-3548feb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2023 License: CC0-1.0 Imports: 15 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL