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

Observation values all zeroes #248

Open
yu263319 opened this issue Jul 28, 2021 · 1 comment
Open

Observation values all zeroes #248

yu263319 opened this issue Jul 28, 2021 · 1 comment

Comments

@yu263319
Copy link

Issue summary

I wrote a functioning script using gym-retro to play the first five frames of Castevania-Nes (it works) but when I print the ndarray returned by the env.make function ("obs"), it gives me a (224, 240, 3)-shaped ndarray containing all zeroes, even though there is output on the screen. Why does the function not return the pixel information of the screen output? My test script just outputs 5 ndarrays as above containing zeroes? Why?

import retro
import sys
import numpy as np
np.set_printoptions(threshold=sys.maxsize)

def main():
env = retro.make(game='Castlevania-Nes')
obs = env.reset()
#while True:
for _ in range(5):
obs, rew, done, info = env.step(env.action_space.sample())
print(obs)
env.render(mode='rgb_array')
# if done:
# obs = env.reset()
env.close()

if name == "main":
main()

System information

  • Windows 10
  • Python 3.8
  • Latest
@yu263319
Copy link
Author

yu263319 commented Jul 28, 2021

Update: The pixel dump works for other games (it gives non-zero data), but not Castlevania. Retro may be hard-coded to look in one place for the screen image, but apparently not all games store this information in the same place.

squishyhuman pushed a commit to RetroAI/retro3 that referenced this issue Mar 2, 2023
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

1 participant