Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
folivetti opened this issue Feb 15, 2018 · 6 comments
Open

Comments

@folivetti
Copy link

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

@folivetti
Copy link
Author

If you change these lines:

if(time == 0x1){ //shai:comparing to 1 not zero to avoid terminal upon first run
m_terminal=true;
}
else{ // check if the timer has stopped
if ( (0 < time && time < 300) && (std::adjacent_find( m_lastTime.begin(), m_lastTime.end(), std::not_equal_to<int>() ) == m_lastTime.end()) ){
m_terminal=true;
}
}

To

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

it works

@nadavbh12
Copy link
Owner

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
Copy link
Author

folivetti commented Feb 28, 2018

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
Copy link
Owner

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
Copy link
Author

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

@nadavbh12
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants