Swift written API to launch and use The Arcade Learning Environment library.

Swift API for 'The Arcade Learning Environment'

Please, visit Arcade Learning Environment repository.

The Arcade Learning Environment (ALE) is a simple object-oriented framework that allows researchers and hobbyists to develop AI agents for Atari 2600 games. It is built on top of the Atari 2600 emulator Stella and separates the details of emulation from agent design. This video depicts over 50 games currently supported in the ALE.

For an overview of our goals for the ALE read The Arcade Learning Environment: An Evaluation Platform for General Agents. If you use ALE in your research, we ask that you please cite this paper in reference to the environment (BibTeX entry at the end of this document). Also, if you have any questions or comments about the ALE, please contact us through our mailing list.

Feedback and suggestions are welcome and may be addressed to any active member of the ALE team.


  • Object-oriented framework with support to add agents and games.
  • Emulation core uncoupled from rendering and sound generation modules for fast emulation with minimal library dependencies.
  • Automatic extraction of game score and end-of-game signal for more than 50 Atari 2600 games.
  • Multi-platform code (compiled and tested under OS X and several Linux distributions, with Cygwin support).
  • Communication between agents and emulation core can be accomplished through pipes, allowing for cross-language development (sample Java code included).
  • Python development is supported through ctypes.
  • Agents programmed in C++ have access to all features in the ALE.
  • Visualization tools.

Quick start

Install main dependences:

$ sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev cmake

On macOS

$ brew install sdl

Clone ALE

$ git clone


$ cd Arcade-Learning-Environment
$ make -j 4
$ sudo make install

Swift package

Add to your package dependencies:

dependencies: [
    .package(url: "", from: "0.0.1"),


Call to build

swift build -Xlinker -rpath -Xlinker /usr/local/lib/

Call to launch tests

swift test -Xlinker -rpath -Xlinker /usr/local/lib/

Create game using one of the roms and launch game:

let game = try Environment(romPath: "%pathToSources%/AtariKit/atari-roms/pong.bin")

// do action.
let reward = game.send(action: .playerAleft)

// get RGB dump of screen.
let screen = game.screenRGBBuffer()

// get screen size.
let size = game.screenSize()

// check if game is over.
if game.isOver { }


  • Swift Tools 4.0.0
View More Packages from this Author


Last updated: Wed Mar 15 2023 23:53:56 GMT-0500 (GMT-05:00)