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

Visualization not working #14

Closed
jmichaux opened this issue Apr 10, 2017 · 2 comments
Closed

Visualization not working #14

jmichaux opened this issue Apr 10, 2017 · 2 comments

Comments

@jmichaux
Copy link

jmichaux commented Apr 10, 2017

Hi I'm trying to visualize game play using the python example from the docs. I've tried the code with and without pygame.init(), and I still don't see anything. Thanks in advance.

from random import randrange
import atari_py
import pygame

ale = atari_py.ALEInterface()
pong_path = atari_py.get_game_path('pong')

#pygame.init()

#load the rom
ale.loadROM(pong_path)
ale.setInt('random_seed', 123)

ale.setBool('display_screen', True)

legal_actions = ale.getLegalActionSet()

for episode in range(10):
total_reward = 0
while not ale.game_over():
a = legal_actions[randrange(len(legal_actions))]
# Apply an action and get the resulting reward
reward = ale.act(a);
total_reward += reward
print('Episode', episode, 'ended with score:', total_reward)
ale.reset_game()

@lechatthecat
Copy link

same problem..

@christopherhesse
Copy link
Contributor

I would recommend trying the gym wrapper for atari_py which has a render() method on it.

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

3 participants