• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NeuroBlast is a classic arcade space shooter with ML-powered AI.

NeuroBlast

Overview

NeuroBlast is a classic arcade space shooter with ML-powered AI using TensorFlow. In this short demo intended to demonstrate the accessibility of open source tools for machine learning, you can train an enemy AI using machine learning.

How it Works

If you want to learn more about how the game works under the hood, and for a tour of the insides, see these two blog posts:

You can also watch my GopherCon 2017 Lightning talk about the game or view the slides.

Installation - Requirements

Before you start, you will require the following external libraries/tools:

Note: TensorFlow for Go is only available of macOS/Linux. Windows is NOT supported.

For any package dependencies, you can either install them via pip/dep or you can also install ActivePython 3.5.3 or ActiveGo 1.8 to have an environment with nearly all dependencies already pre-installed.

Windows Setup Instructions

To setup the game to run on Windows in Python 3:

  1. git clone https://github.com/ActiveState/neuroblast.git
  2. pip3 install -r requirements.txt
  3. Launch rungame.cmd (which will launch the Mongo server).

MacOS/Linux Setup Instructions

To setup the game to run on MacOS/Linux in Python 3:

  1. git clone https://github.com/ActiveState/neuroblast.git
  2. cd neuroblast
  3. mkdir db
  4. pip3 install -r requirements.txt
  5. Launch Mongo server: mongod --dbpath ./db
  6. Launch the game python3 game.py

Note: If you previously had Keras installed on your machine, and had run it using a different backend, make sure you configure your Keras backend to run using TensorFlow by following these instructions.

To setup the game to run on MacOS/Linux in Go 1.8:

Reminder: You must have the TensorFlow C libraries installed as per these instructions.

Note: You must clone the repo into your GOPATH, or add the folder you clone into to your GOPATH in order for dep ensure to work.

  1. git clone https://github.com/ActiveState/neuroblast.git
  2. cd go
  3. dep ensure
  4. go build
  5. Launch the game ./go

Command Line Arguments

There are a number of options available when running the game from Python:

  • -n changes the Neural Network model from using TensorFlow to using the "home grown" network model which is useful for prototyping/debugging.
  • -f launches the game in full screen.
  • -v changes the visualization method to use raw Keras/TensorFlow values. Warning: This is much slower!

Note: These options are not available in the Go version.

Controls

Movement

Control your ship with the arrow keys or the left-analog stick with a gamepad.

Firing

Use either SPACE or the A button on your gamepad to fire. You can hold the button down for continuous fire.

Debug Menu Commands

On the main menu of the Python version, you can use the following commands to export debug data:

x - Exports a model using the SavedModelBuilder functionality to use in the Go version
w - Exports weights.csv which are the trained weights of the current model
d - Exports traindata.csv which is a dump of the training data points currently in memory

Known Issues

  • Collision is not pixel-perfect
  • In the Python version, being hit will slow down your rate of movement
  • You can fly through the enemy ships with your ship (no collision between enemy ships/hero ship)
  • Some gamepad configurations may not work
  • Menu navigation with gamepad is inconsistent

License

Copyright (C) 2017 ActiveState. Licensed under the MIT License. See LICENSE file for details.

Credits

Written by Pete Garcin Twitter/GitHub and Tom Radcliffe.

Gopher Artwork appears courtesy of Ashley McNamara.

Contributing

If you would like to contribute to this project, please visit the Issues tab to see what open issues are available and flagged with Help Wanted. You can also submit a Pull Request with your proposed changes. If they are in response to an issue, please reference the issue in the pull request.

More Repositories

1

code

ActiveState Code Recipes
Python
1,929
star
2

appdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
Python
993
star
3

OpenKomodoIDE

Open Komodo IDE is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
Python
550
star
4

tdk

Tcl Dev Kit (TDK)
Tcl
68
star
5

termtest

Cross-platform (Windows, Mac, Linux) integration testing for your terminals
Go
54
star
6

teapot

Tcl TEApot
Tcl
46
star
7

gococo

Go CLI for using COCO object recognition models
Go
36
star
8

dockron

Schedule your 'docker run's without having to install cron on the host
Go
29
star
9

MalwareArchivist

Download archived malware from ActiveState's source code mirror
Python
28
star
10

cli

The Command Line Interface for managing language runtime environments built by the ActiveState Platform
Go
28
star
11

tensorflask

Simple example hosting TensorFlow model as Flask service
Python
20
star
12

go-ansi

Go package to convert ANSi art files to PNG
Go
18
star
13

ez_setup

ez_setup.py and distribute_setup.py
Python
18
star
14

depgraph

Dependency resolution algorithms for Python packages (used in PyPM)
Python
15
star
15

pythonselect

A tool to set current Python version (currently MacOSX only)
Python
15
star
16

applib

Cross-platform application utilities for Python. Originally implemented for PyPM.
Python
15
star
17

static-docker-registry

Experiments in making 'docker pull' reliable
Go
13
star
18

golang-gorilla-webapp

A sample web app in Go using Gorilla
Go
9
star
19

recipe-580811-uno-text-based

UNO (text-based)
Python
7
star
20

gogettable

Webapp to provide the manifest to make `go get` fetch source code for arbitrary import domains
Go
7
star
21

yaml-blog-post

YAML Blog Post
Perl
6
star
22

recipe-577504-compute-mem-footprint

Compute memory footprint of an object and its contents
Python
6
star
23

homework

5
star
24

activepython-docker

ActivePython Docker image
Shell
4
star
25

gometalinter-helper

Tools to check Go files for use with commit hooks and CI
Go
4
star
26

mk

a Python make replacement: write a `Task` subclass in "Makefile.py" called "foo", run `mk foo`
Python
3
star
27

perl-5.32

Home for the Perl-5.32 install scripts
Perl
3
star
28

rules_vendor

Bazel support for packaging Go vendored dependencies
Python
3
star
29

webinar-microservices-versions

Demonstrates two types of applications versioning - mutable and immutable using Stackato
Ruby
3
star
30

tcl-core-xxx

Unofficial Tcl core GIT repository.
C
2
star
31

documentation-public

HTML
2
star
32

filearchive

Python module to work with file archives
Python
2
star
33

sysinfo

Go package for detecting the current system's information
Go
2
star
34

product-roadmap

This is the new external Product Roadmap website
HTML
2
star
35

doozerconfig

Go package for managing json-encoded configuration in Doozer
Go
2
star
36

recipe-580793-tkinter-table-scroll

Tkinter with table scrollbars
Python
2
star
37

perl-activestate-utils

Various utility modules that we use in different context. Parts of it bundled with ActivePerl.
Perl
1
star
38

perl-activeperl-ppm

The ActivePerl::PPM module
Perl
1
star
39

AS-Notebook

Python
1
star
40

recipe-578836-battleship-game

Battleship game in Python
Python
1
star
41

p532

SCSS
1
star
42

swampup

Demo Artitfactory
1
star
43

ce-download-demo

Quick demo of Python CE Popup with /auto-fork and downlaod links
HTML
1
star
44

json-ordered-tidy

A fancy JSON tidier that can arbitrarily order object keys
Go
1
star
45

recipe-577968-log-watcher-tail-f-log

Log Watcher (tAIL -f *.log)
Python
1
star
46

pycon2019

Getting Rid of Developer Pain Points Workshop — PyCon 2019
Dockerfile
1
star
47

activestate.github.com

1
star
48

langtools

Go packages and tools for working with language ecosystems
Go
1
star
49

APy

Python
1
star
50

go-env-log-spam

A simple app to simulate frequent log activity (per millisecond), especially for http://bugs.activestate.com/show_bug.cgi?id=99534
Go
1
star
51

webdrain

Logyard drain as a web app
JavaScript
1
star