#arcade #learning #environment #interface #game #space #breakout

ale

A Rust encapsulation of the Arcade Learning Environment

5 releases

0.1.3 May 6, 2020
0.1.2 Feb 10, 2020
0.1.1 Feb 9, 2020
0.1.0 Feb 9, 2020
0.0.1 Feb 7, 2020

#3 in #arcade

22 downloads per month

MIT license

2MB
47K SLoC

C++ 21K SLoC // 0.3% comments Prolog 13K SLoC C 8K SLoC // 0.2% comments M4 2K SLoC // 0.0% comments Java 1.5K SLoC // 0.4% comments Rust 670 SLoC // 0.1% comments Python 467 SLoC // 0.2% comments HICAD 200 SLoC Shell 159 SLoC // 0.2% comments

ale

A Rust interface to the Arcade Learning Environment.

Some games such as Breakout, Asteroids, MsPacman and Space Invaders are bundled into the libarary, so that anyone using it can run them. A full list is at https://github.com/trolleyman/ale-rs/blob/master/src/lib.rs#L353-L430.

Requirements

Breakout example

For an example of the Atari playing Breakout, run this command:

cargo run --release --example breakout

Controls:

  • P: Toggle pause
  • A/Left: Move paddle left
  • D/Right: Move paddle right
  • Space: "Fire" key (trigger ball)
  • R: Reset game

ale-sys

Rust bindings to the Arcade Learning Environment, with a few tweaks. See https://github.com/trolleyman/Arcade-Learning-Environment.

Differences:

  • zlib is vendored so that compilation is easier
  • The C library is statically linked

xtask

xtask is a small sub-project used for development. Subcommands can be run by running cargo xtask <subcommand> in the root of the repository.

There are two subcommands: gen-bindings and download-roms.

gen-bindings generates the ale-sys/src/bindings.rs file, and requires clang to be installed.

download-roms downloads the bundled Atari ROMs and outputs them in the roms/ folder, that is then included in the binary via. include_bytes!. This is meant to protect me against copyright infringement. It's a similar technique used by atari-py.

Dependencies