Requirements:
pip install pybind11
apt-get install clang llvm
Build instructions:
chmod u+x i
./i
To use:
from kogle.kogle import Kogle
env = Kogle(game_name="Breakout", sticky_action_prob=0.1)
The interface is pretty self-explanatory.
env.step(action)takes a step in the environment and returns the reward.env.observationgets the current frame.env.observation_shapegives its shape.env.stategets the most recentenv.obs_stackframes, concatenated along the first dimension.env.state_shapegives its shape.env.legal_action_maskgets a boolean mask of lengthenv.action_countindicating which actions are legal in this state.env.legal_action_setgets an integer set containing the legal actions.env.terminatedgets a boolean corresponding to whether the environment has terminated.
Run python interactive.py to get an interactive version of the game that can be played with arrow keys. (Requires tkinter.) Use spacebar to fire, z for no-op, and WASD to move and fire at the same time.
Run python interactive_live.py to get an interactive version with timed frames. Default 30fps. (Requires pygame.) Uses same controls as python interactive.py.
Run python benchmark_speed.py to measure the FPS.