Giter Site home page Giter Site logo

Comments (3)

Kautenja avatar Kautenja commented on May 28, 2024

Ah, my thought is that you're running the environment without refining the action space (which is required as of 3.0.0 due to a new emulator in the back-end). Assuming you're looking for the standard action space similar to what is in 2.3.1 (not exactly the same), you'd need to refine your template to include a BinarySpaceToDiscreteSpaceEnv wrapper from the nes_py.wrappers package and pass in the SIMPLE_MOVEMENT action list from gym_super_mario_bros.actions:

from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv
import gym_super_mario_bros
from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
env = gym_super_mario_bros.make('SuperMarioBros-v0')
env = BinarySpaceToDiscreteSpaceEnv(env, SIMPLE_MOVEMENT)

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

env.close()

This is because the nes_py emulator allows the full range of 256 discrete actions on an NES joypad by default, and thus requires tuning to more realistic action spaces.

gym_super_mario_bros.actions defines three action lists (though you're welcome to create your own):

Name Movement
RIGHT_ONLY the agent can only run/walk/jump right
SIMPLE_MOVEMENT the agent can do everything from: right only, walk left, and jump in place
COMPLEX_MOVEMENT the agent can do everything from: simple movement, run/walk/jump left, and press down (enter pipes).

Hopefully this addresses your issue!

NOTE 3.0.0 has a serious bug as noted in #49, proceed at your own risk with this version. Might be best to wait until #49 is resolved - in 3.0.1 - to move up from 2.3.1. Hopefully that bug will be addressed sometime this week / week-end.

from gym-super-mario-bros.

griase94 avatar griase94 commented on May 28, 2024

Allright good to know, thank you for your fast reply!
You should probably document this, since it took me several hours to find out that it was an issue which only happened in the latest Version ;)

from gym-super-mario-bros.

Kautenja avatar Kautenja commented on May 28, 2024

Sorry for the confusion! I had meant to fix that bug much earlier, but got locked up with some work projects. However, I believe I have resolved the bug as of versions 3.0.3. Feel free to upgrade now, as >v3 uses a new back-end that is much much faster and should cut down training time considerably. Closing this issue as I believe it is resolved.

from gym-super-mario-bros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.