LuaJIT/FFI wrapper for Arcade Learning Environment
Lua
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
roms
LICENSE
README.md
alecmain.lua
alectest.lua
alecwrap.lua
libale_c.dll

README.md

Project Description

A LuaJIT/FFI wrapper for the Arcade Learning Environment.

There is another Lua wrapper (alewrap), but it requires a separate build step with its own dynamic library and has a slightly different API.

Usage

local alecwrap = require 'alecwrap'
local ale = alecwrap.new("roms/breakout.bin")
local reward = ale:act(ale:getLegalActionSet()[0])
print(reward, ale:getFrameNumber(), ale:isGameOver(), "\n")

Installation

  • Download or clone ALE repository and build ALE using the following commands (if you are building on Windows using mingw, add -G "MSYS Makefiles" to the cmake command):
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
  • Copy build/libale_c dynamic library to your project directory (libale_c.dll v0.5.0 compiled for 32bit Windows is already included).
  • Copy alecwrap.lua file to your project directory or make it available to your script so that it's loaded with require command.

Running example script using ZeroBrane Studio

  • Download and install ZeroBrane Studio.
  • Launch ZeroBrane Studio and load the example by using the following command:
zbstudio alecwrap-directory alectest.lua
  • Run the example using Project | Run menu command.

Author

Paul Kulchenko (paul@kulchenko.com)

License

See LICENSE file.

The license doesn't apply to ROM files (in the roms directory), which are only included for educational purposes.