Skip to content

Commit 7e744e5

Browse files
Update the registration list to include NoFrameskip-v4
1 parent 6345f3d commit 7e744e5

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

docs/environments.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ Actions passed into the environment are then thresholded to discrete using the `
205205

206206
## Version History and Naming Schemes
207207

208-
In v0.11, the number of registered Atari environments does significantly reduced from 960 to 105 to only register `ALE/{rom_name}-v5` following the best practices outlined in [[2]](#2).
208+
In v0.11, the number of registered Atari environments was significantly reduced from 960 to 210 to only register `{rom_name}NoFrameskip-v4` the most popular environment and `ALE/{rom_name}-v5` following the best practices outlined in [[2]](#2).
209209

210-
| Name | `obs_type=` | `frameskip=` | `repeat_action_probability=` | `full_ation_space=` |
211-
|------------------|-------------|--------------|------------------------------|---------------------|
212-
| ALE/Adventure-v5 | `"rgb"` | `4` | `0.25` | `False` |
210+
| Name | `obs_type=` | `frameskip=` | `repeat_action_probability=` | `full_ation_space=` |
211+
|-------------------------|-------------|--------------|------------------------------|---------------------|
212+
| AdventureNoFrameskip-v4 | `"rgb"` | `1` | `0.00` | `False` |
213+
| ALE/Adventure-v5 | `"rgb"` | `4` | `0.25` | `False` |
213214

214215
Importantly, `repeat_action_probability=0.25` can negatively impact the performance of agents so when comparing training graphs, be aware of the parameters used for fair comparisons.
215216

@@ -229,6 +230,7 @@ To create previously implemented environment use the following parameters, `gymn
229230
| Adventure-ram-v4 | `"ram"` | `(2, 5,)` | `0.0` | `False` |
230231
| Adventure-ramDeterministic-v4 | `"ram"` | `4` | `0.0` | `False` |
231232
| Adventure-ramNoframeskip-v4 | `"ram"` | `1` | `0.0` | `False` |
233+
| ALE/Adventure-v5 | `"rgb"` | `4` | `0.25` | `False` |
232234
| ALE/Adventure-ram-v5 | `"ram"` | `4` | `0.25` | `False` |
233235

234236
## Flavors

src/ale/python/registration.py

+24-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from collections import defaultdict
6+
57
import ale_py.roms as roms
68
import gymnasium
79

@@ -14,19 +16,39 @@ def rom_id_to_name(rom: str) -> str:
1416
def register_envs():
1517
"""Register all the Atari Environments."""
1618
all_rom_ids = roms.get_all_rom_ids()
19+
# These environments all don't have a single agent implementation
20+
all_rom_ids.remove("warlords")
21+
all_rom_ids.remove("maze_craze")
22+
all_rom_ids.remove("joust")
23+
all_rom_ids.remove("combat")
1724

1825
for rom_id in all_rom_ids:
26+
gymnasium.register(
27+
id=f"{rom_id_to_name(rom_id)}NoFrameskip-v4",
28+
entry_point="ale_py.env:AtariEnv",
29+
kwargs={
30+
"game": rom_id,
31+
"obs_type": "rgb",
32+
"frameskip": 1, # frameskip of 1
33+
# max_episode_steps is 108k frames which is 30 mins of gameplay.
34+
# This corresponds to 108k / 4 = 27,000 steps
35+
"max_num_frames_per_episode": 108_000,
36+
"repeat_action_probability": 0, # no repeat action probability
37+
"full_action_space": False,
38+
},
39+
)
40+
1941
gymnasium.register(
2042
id=f"ALE/{rom_id_to_name(rom_id)}-v5",
2143
entry_point="ale_py.env:AtariEnv",
2244
kwargs={
2345
"game": rom_id,
2446
"obs_type": "rgb",
25-
"frameskip": 1,
47+
"frameskip": 4, # frameskip of 4
2648
# max_episode_steps is 108k frames which is 30 mins of gameplay.
2749
# This corresponds to 108k / 4 = 27,000 steps
2850
"max_num_frames_per_episode": 108_000,
29-
"repeat_action_probability": 0,
51+
"repeat_action_probability": 0.25, # include repeat action probability
3052
"full_action_space": False,
3153
},
3254
)

tests/python/test_atari_env.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ def test_roms_register():
2222
]
2323

2424
registered_v5_roms = list(filter(lambda env_id: "v5" in env_id, registered_roms))
25-
assert len(registered_v5_roms) == 108
26-
assert len(registered_roms) == len(registered_v5_roms)
25+
assert len(registered_v5_roms) == 104
26+
registered_noframeskip_v4_roms = list(filter(lambda env_id: "NoFrameskip-v4" in env_id, registered_roms))
27+
assert len(registered_noframeskip_v4_roms) == 104
28+
assert len(registered_roms) == len(registered_v5_roms) + len(registered_noframeskip_v4_roms)
2729

2830

2931
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)