TensorFlow experiment trying to teach AI to play a simple game.
Video of 40 minutes of training data playing the game
Blog post explaining the experiment
After tinkering with python environment, you should run Endless Flighter game in your browser. Make an setup, in which you can position the game in the same exact location of the screen, as this uses screen capture.
Then adjust these (collect_data.py and run_model.py):
screen = np.array(ImageGrab.grab(bbox=(20,220, 420, 450)))
to match your environment.
Note: keyboard capturing probably works only on OS X.
- Run
collect_data.py
- Play the game while running it (20 minutes at least)
- Run
balance_the_data.py
- Run
train_model.py
- (Optional) run tensorboard to see the training statistics
- Run
run_model.py
and set focus to browser running the game - If all goes well, it should try to avoid obstacles!
This experiment is based mostly on excellent Python Plays: Grand Theft Auto V video series.