nadavbh12 / Retro-Learning-Environment

The Retro Learning Environment (RLE) -- a learning framework for AI
Other
184 stars 40 forks source link

game_over() set to True when Mario gets a Mushroom in Super Mario World #36

Open folivetti opened 6 years ago

folivetti commented 6 years ago

Whenever Mario hits a mushroom (and possibly any other item) the game returns True to game_over().

folivetti commented 6 years ago

If you change these lines:

https://github.com/nadavbh12/Retro-Learning-Environment/blob/0269da8773ac9fe267da14eda1146c40af14a7d4/src/games/supported/SuperMarioWorld.cpp#L77-L84

To

if (readRam(&system, 0xdda) == 0xff) { m_terminal=true; }

it works

nadavbh12 commented 6 years ago

Thanks. Looks like it does fix it.

Though it seems the starting actions are broken. I vaguely remember that the first set of actions doesn't work once you start a game because of the internal saves in Mario. Moving to save states should solve these issues.

folivetti commented 6 years ago

Though it seems the starting actions are broken.

it seems fine to me. Do you mean the initial inputs are not processed or the actions to start the game are not performed?

nadavbh12 commented 6 years ago

Once mario dies, I go to Yoshi's island rather than the beginning of the level. The starting_actions for the first time you run the game, aren't the same for all subsequent restarts.

folivetti commented 6 years ago

that already happened before. My temp solution was to start a new RLE object

nadavbh12 commented 6 years ago

While that may work, it has a larger overhead compared to a simple reset. Furthermore, you'll need to manually seed the environment after every reset in order to avoid using the same seed every episode.