You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: