Skip to content

vrinek/racermaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Racer Maker

You are a racing teacher. You're teaching an AI how to drive and win the championship.

Install

This project assumes you have the following installed:

  • Ruby 2.4 (with bundler)
  • Python 3.6 (with virtualenv)

To get the ruby game setup:

cd game
bundle install
cd ..

To get the python machine learning project setup:

cd machine-learning
pip install -r requirements.txt
cd ..

Usage

cd game
bundle exec ruby game.rb record
# Run a few laps.
# Press Q to quit.

cp *.csv ../machine-learning
cd ../machine-learning
python train.py
mv parameters.json ../game/parameters.json
cd ../game

bundle exec ruby game.rb ai

TODO

Part 1: racing game

  • Car
    • Forward motion
    • Turning
    • Braking
    • Reverse
      • Go reverse
      • Steer reverse
  • Race track
    • Sprites
      • Road
      • Background
    • Physics via Chipmunk
      • Barriers
      • Tarmac Vs Sandtraps friction
  • Gameplay
    • Recognise laps
      • Implement checkpoints
      • Define flag checkpoint
      • Incrementally activate next checkpoint
      • Detect going backwards (and disable checkpoints)
    • Recognise victory (3 laps?)
    • Keep time
  • UI
    • Menus
      • Track select
      • Pause menu
      • Game over
    • HUD
      • Speed
      • Lap time
  • Graphics
    • Camera
    • Drift marks
    • Dust particles
  • Sounds
    • Vroom-vroom
    • Drift screech
    • Brake screech
    • Collision thump

Part 2: AI teaching game

  • Sensors
  • Connect with tensorflow
    • Via manual process
    • Via automated process
    • Via sockets
  • AI learning
    • Mimic
      • Play, train, run
      • Learn on every lap
      • Online learning (learn while running)
    • Pain/happiness learning

Architectural notes

[keyboard] -> [Input] -> [Gameplay] -> [Presenter] -> [window]

When recording:

[keyboard] -> [HumanInput] -> [InputRecorder] -> [Gameplay] ...

When replaying:

[InputReplayer] -> [Gameplay] ...

AI sensors:

... [Gameplay] -> [HumanPresenter] -> [window]
               -> [SensorsPresenter] -> [filesystem]

About

Train a racing bot to drive

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published