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

Pitfall game over check doesn't seem to work #268

Open
christopherhesse opened this issue Aug 23, 2019 · 2 comments
Open

Pitfall game over check doesn't seem to work #268

christopherhesse opened this issue Aug 23, 2019 · 2 comments
Labels
bug game Issues regarding specific games

Comments

@christopherhesse
Copy link

Using the pitfall.bin specified by the md5 file (3e90cf23106f2e08b2781e41299de556) if you start a game and then do nothing for 20 minutes, the timer runs out but game_over() is not set to true.

It looks like there is a check in the code, but it does not seem to work for me: https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/src/games/supported/Pitfall.cpp#L58

The following script should eventually finish but it does not:

import atari_py

ale = atari_py.ALEInterface()
ale.setFloat("repeat_action_probability".encode("utf-8"), 0.0)
game_path = atari_py.get_game_path("pitfall")
ale.loadROM(game_path)
ale.reset_game()
step = 0
while True:
    if step % 1000 == 0:
        print(step)
    ale.act(0)
    step += 1
    if ale.game_over():
        print(f"done at step {step}")
        break
@mgbellemare
Copy link
Contributor

Thanks for flagging this! I'll take a look post-AAAI.

@Profesor09
Copy link

One potential fix could be to manually check for the timer value in the while loop and set game_over() to true if the timer value exceeds a certain threshold.

Here's an example of what the updated while loop could look like:

python
Copy code
while True:
if step % 1000 == 0:
print(step)
ale.act(0)
step += 1
if ale.getRAM()[17] >= 250: # check if timer value exceeds threshold
ale.setEpisodeOver(True) # set episode over to true
if ale.game_over():
print(f"done at step {step}")
break
This code snippet checks the RAM value at index 17 (which corresponds to the timer value) and sets the episode over to true if the timer value exceeds 250. This should trigger the game_over() function to be set to true and end the while loop.

Note that the threshold value of 250 may need to be adjusted depending on the specific game and its timer implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug game Issues regarding specific games
Projects
None yet
Development

No branches or pull requests

4 participants