Skip to content


Christian Kauten edited this page Jun 2, 2019 · 20 revisions

Wrappers for altering the behavior of gym environments.


A wrapper to define a much smaller action space. The initializer takes an environment and a list of button lists:

from nes_py.wrappers import JoypadSpace
env = JoypadSpace(env, [
    ['right', 'A'],
    ['left', 'A'],

Each button list should contain at least one of:

  • 'right'
  • 'left'
  • 'down'
  • 'up'
  • 'start'
  • 'select'
  • 'B'
  • 'A'
  • 'NOP'


It is recommended for custom environments to use this wrapper by default. If there are multiple mappings, the package should provide each list and either register a different environment for each, or make note in the documentation for end users. See gym-super-mario-bros for an example of multiple button lists in the module.

Clone this wiki locally
You can’t perform that action at this time.