-
Notifications
You must be signed in to change notification settings - Fork 425
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
Space Invaders Invisible bullets on Mode=0 #524
Comments
Could you provide a minimal example code to recreate this? |
sure, here is the minimal example: import gymnasium as gym
env = gym.make('ALE/SpaceInvaders-v5', render_mode='rgb_array')
env = gym.wrappers.RecordVideo(env,
video_folder='videos',
episode_trigger=lambda episode: True,
name_prefix="space-invaders",
)
env.reset(seed=42)
terminated = False
while not terminated:
# do nothing
states, rewards, terminated, truncated, infos = env.step(0)
env.render()
env.close() btw, I found that it happens due to default value for |
Yes, I suspected that this would be the issue |
find one more ALE environment with similar issue https://gymnasium.farama.org/environments/atari/frogger/ |
Thanks, I believe these are known Atari 2700 Rom optimisations, certainly for Space Invaders, not certain for frogger but wouldn't be surprised. |
Yes, I aware about this optimisation and I'm not calling to fix Atari simulation but rather environment itself, like the proposal in the issue #467 by averaging few frames. 1st as a humans we don't see individual frames but blend a few in a raw and so it shouldn't hurt agent either Quick and dirty solution would be to set There are few other examples (and I guess I can find more flaws like this in other environments, since flipping frames was the common optimization in Atari games): AsteroidFramekip=0asteroids-fs1-episode-0.mp4agent can see asteroids import gymnasium as gym
env = gym.make("ALE/Asteroids-v5",
render_mode="rgb_array",
frameskip=1,
)
env = gym.wrappers.RecordVideo(env,
video_folder='videos',
episode_trigger=lambda episode: True,
name_prefix="asteroids-fs1",
)
env.reset(seed=42)
terminated = False
while not terminated:
# do nothing
states, rewards, terminated, truncated, infos = env.step(0)
env.render()
env.close() Framekip=4asteroids-fs4-episode-0.mp4agent see no asteroids (which can be seen on gymnasium page as well) import gymnasium as gym
env = gym.make("ALE/Asteroids-v5",
render_mode="rgb_array",
frameskip=4,
)
env = gym.wrappers.RecordVideo(env,
video_folder='videos',
episode_trigger=lambda episode: True,
name_prefix="asteroids-fs4",
)
env.reset(seed=42)
terminated = False
while not terminated:
# do nothing
states, rewards, terminated, truncated, infos = env.step(0)
env.render()
env.close() PacmanFramekip=0pacman-fs1-episode-0.mp4agent see all ghosts import gymnasium as gym
env = gym.make("ALE/Pacman-v5",
render_mode="rgb_array",
frameskip=1,
)
env = gym.wrappers.RecordVideo(env,
video_folder='videos',
episode_trigger=lambda episode: True,
name_prefix="pacman-fs1",
)
env.reset(seed=42)
terminated = False
while not terminated:
# do nothing
states, rewards, terminated, truncated, infos = env.step(0)
env.render()
env.close() Framekip=4pacman-fs4-episode-0.mp4agent see only one ghost (the rest are invisible, which can be seen on gymnasium page as well) import gymnasium as gym
env = gym.make("ALE/Pacman-v5",
render_mode="rgb_array",
frameskip=4,
)
env = gym.wrappers.RecordVideo(env,
video_folder='videos',
episode_trigger=lambda episode: True,
name_prefix="pacman-fs4",
)
env.reset(seed=42)
terminated = False
while not terminated:
# do nothing
states, rewards, terminated, truncated, infos = env.step(0)
env.render()
env.close() |
I'm running this environment through the https://gymnasium.farama.org/environments/atari/space_invaders/ and found that even at the previous on the page above (Gymnasimum) there is no bullets from invaders (it is mode=0), on mode=1,4 bullets start be seeing. It doesn't like it supposed to be rendered.
space-invaders-invisible-bullets.mov
The text was updated successfully, but these errors were encountered: