Skip to main content

Super Mario Bros. for OpenAI Gym

Project description

OpenAI Gym - Super Mario Bros

PackageVersion PythonVersion Stable Format License

smb

An OpenAI Gym environment for the original Super Mario Bros. game on the Nintendo Entertainment System (NES).

Installation

The preferred installation of gym-super-mario-bros is from pip:

pip install gym-super-mario-bros

NES Emulator

NESGym uses FCEUX to emulate NES games. Make sure it's installed and in your $PATH.

Unix

sudo apt-get install fceux

Mac

brew install fceux

Usage

import gym_super_mario_bros
env = gym_super_mario_bros.make('SuperMarioBros-v0')

done = True
for step in range(5000):
    if done:
        state = env.reset()
    state, reward, done, info = env.step(env.action_space.sample())

env.close()

NOTE: gym_super_mario_bros.make is just an alias to gym.make for convenience.

Environments

The following environments play the game as a human would. The agent has three lives to make it through the 32 levels of the game. The agent is configured to only see reward-able game-play frames. No cut-scenes, loading screens, etc. are shown to the agent.

Environment Description
SuperMarioBros-v0 4 frames per action, standard ROM
SuperMarioBros-v1 4 frames per action, custom down-sampled ROM
SuperMarioBrosNoFrameskip-v0 1 frame per action, standard ROM
SuperMarioBrosNoFrameskip-v1 1 frame per action, custom down-sampled ROM

Citation

Please cite gym-super-mario-bros if you use it in your research.

@misc{gym-super-mario-bros,
  author = {Christian Kauten},
  title = {{S}uper {M}ario {B}ros for {O}pen{AI} {G}ym},
  year = {2018},
  publisher = {GitHub},
  howpublished = {\url{https://github.com/Kautenja/gym-super-mario-bros}},
}

Project details


Release history Release notifications | RSS feed

This version

0.7.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gym_super_mario_bros-0.7.0.tar.gz (79.0 kB view details)

Uploaded Source

File details

Details for the file gym_super_mario_bros-0.7.0.tar.gz.

File metadata

File hashes

Hashes for gym_super_mario_bros-0.7.0.tar.gz
Algorithm Hash digest
SHA256 d869dac7d6cd551b21d4aab4564cace2f34d01d743cf5c406b735604a361e727
MD5 05075374dc4b1b64ecf738f0de22c0e2
BLAKE2b-256 4e802be6221ed195db73cb81451e071facbea105bbd5e5891eeabac1dd48df12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page