Skip to content

whatisaphone/self-driving-car

Repository files navigation

Self-driving car

A bot that plays Rocket League using RLBot.

Accolades

🥇 1st – RLBot Lightfall 2019-10-20 [Braacket part 1] [Braacket part 2] [Video 1] [Video 2]

🥇 1st – RLBot Wintertide 1v1 2019-03-09 [Braacket part 1] [Braacket part 2] [Video]

🥇🥈 1st and 2nd – RLBot Wintertide 2v2 2019-03-10 [Video]
(1st with teammate ReliefBot)
(2nd with teammate also_MichaelBot)

🥇 1st – New Year Invitational 2019-01-21 [Braacket] [Video]

🥈 2nd – Snowbot Showdown 2018-12-16 [Braacket] [Highlight video]

Development

Prerequisites

  • Windows

    RLBot only works on Windows, and we inherit this limitation.

  • Install Rust.

  • Install pre-commit, and run this command:

    pre-commit install

    This will run tests/lints/etc before every commit. The bot may lose every game, but at least the code will be pretty!

  • Obtain these files from RLBot and copy them somewhere in your PATH (or alternatively, to avoid polluting your system, target/debug and target/release):

    • RLBot_Core.dll
    • RLBot_Core_Interface.dll
    • RLBot_Injector.exe

Watch the bot play

cargo run -p play

Run the bot with the RLBot framework

cargo build --release && \
    ( cd tourney/contents && python -c "from rlbot import runner; runner.main()" )

Run integration tests

The integration tests require a copy of Rocket League running (naturally).

cargo test -p brain -- --test-threads=1 integration

To run an individual test, you can replace integration with a pattern that matches the name of the test.

Profiling

Adapt this command to your needs:

vsperf="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools\VSPerf.exe"
RUST_BACKTRACE=1 \
"$vsperf" \
    -launch:target/debug/deps/brain-a1b2c3.exe \
    -args:"--test-threads=1 recording_template --ignored"

Build a tournament package

tourney/build.sh

This will package up a release build in target/tournament/. It will also copy in a rlbot.cfg for quick testing. You can test the build by starting Rocket League and then running:

( cd target/tournament && python -c "from rlbot import runner; runner.main()" )

Once you know it works, zip up the directory and send it to the tournament organizer!

Handy Links

Rocket League

Math