A Rust interface to the Arcade Learning Environment.
Some games such as Breakout, Asteroids, Ms Pacman and Space Invaders are bundled into the libarary, so that anyone using it can run them. A full list can be found here.
- CMake (See cmake-rs)
Before running the examples you'll be required to run a command that downloads the Atari games into the local directory. This is not required when using this as a library via. crates.io, as they are bundled with the crate.
cargo xtask download-romsThis example outputs the screen of the Atari to the examples/screenshots/ folder. On Ubuntu it requires less libraries to be installed.
cargo run --release --example screenshotsFor 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
On Ubuntu you'll require pkg-config and the X11 development libraries.
sudo apt install pkg-config libx11-devIf everything goes to plan, you should see something like this:
Rust bindings to the Arcade Learning Environment, with a few tweaks. See https://github.com/trolleyman/Arcade-Learning-Environment.
Differences:
zlibis vendored so that compilation is easier- The C library is statically linked
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.
