Skip to content

Commit

Permalink
Update Atari documentation for 0.9.0 (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts authored Jun 29, 2024
1 parent 8161d7d commit bf081a5
Show file tree
Hide file tree
Showing 110 changed files with 157 additions and 172 deletions.
24 changes: 15 additions & 9 deletions docs/_scripts/gen_atari_table.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import itertools
import json

import ale_py
import tabulate
from ale_py.roms import utils as rom_utils
from shimmy.utils.envs_configs import ALL_ATARI_GAMES
from ale_py.registration import _rom_id_to_name
from tqdm import tqdm

import gymnasium


# Necessary for v1.0.0 without ale-py gymnasium support
# from shimmy import registration
# registration._register_atari_envs()
gymnasium.register_envs(ale_py)

impossible_roms = {"maze_craze", "joust", "warlords", "combat"}
ALL_ATARI_GAMES = {
env_spec.kwargs["game"]
for env_spec in gymnasium.registry.values()
if isinstance(env_spec.entry_point, str)
and "ale_py" in env_spec.entry_point
and env_spec.kwargs["game"] not in impossible_roms
}

# # Generate the list of all atari games on atari.md
# Generate the list of all atari games on atari.md
for rom_id in sorted(ALL_ATARI_GAMES):
print(f"atari/{rom_id}")

Expand Down Expand Up @@ -54,7 +60,7 @@ def shortened_repr(values):
rows = []

for rom_id in tqdm(ALL_ATARI_GAMES):
env_name = rom_utils.rom_id_to_name(rom_id)
env_name = _rom_id_to_name(rom_id)

env = gymnasium.make(f"ALE/{env_name}-v5").unwrapped

Expand Down Expand Up @@ -86,7 +92,7 @@ def shortened_repr(values):
atari_data = json.load(file)

for rom_id in tqdm(ALL_ATARI_GAMES):
env_name = rom_utils.rom_id_to_name(rom_id)
env_name = _rom_id_to_name(rom_id)

env = gymnasium.make(f"ALE/{env_name}-v5").unwrapped
if rom_id in atari_data:
Expand Down Expand Up @@ -128,7 +134,7 @@ def shortened_repr(values):
[
env_spec
for env_spec in gymnasium.registry.values()
if env_name in env_spec.name and "shimmy" in env_spec.entry_point
if env_name in env_spec.name and "ale_py" in env_spec.entry_point
],
key=lambda env_spec: f"{env_spec.version}{env_spec.name}",
)
Expand Down
21 changes: 16 additions & 5 deletions docs/environments/atari.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,24 @@ atari/zaxxon

Atari environments are simulated via the Arcade Learning Environment (ALE) [[1]](#1) through the Stella emulator.

## AutoROM (installing the ROMs)
```python
import gymnasium as gym
import ale_py

ALE-py doesn't include the atari ROMs (`pip install gymnasium[atari]`) which are necessary to make any of the atari environments.
To install the atari ROM, use `pip install gymnasium[accept-rom-license]` which will install AutoROM and download the ROMs, install them in the default location.
In doing so, you agree to own a license to these Atari 2600 ROMs and agree to not distribution these ROMS.
gym.register_envs(ale_py)

It is possible to install the ROMs in an alternative location, [AutoROM](https://github.com/Farama-Foundation/AutoROM) has more information.
env = gym.make("ALE/Pong-v5")
# Optionally include the `gym.wrappers.AtariPreprocessing`

obs, info = env.reset()
episode_over = False
while not episode_over:
action = env.action_space.sample() # replace with your policy
obs, reward, terminated, truncated, info = env.step(action)

episode_over = terminated or truncated
env.close()
```

## Action Space

Expand Down
2 changes: 1 addition & 1 deletion docs/environments/atari/adventure.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/air_raid.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/alien.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/amidar.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/assault.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/asterix.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/asteroids.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/atlantis.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/atlantis2.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/backgammon.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/bank_heist.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/basic_math.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/battle_zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/beam_rider.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/berzerk.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/blackjack.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/bowling.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/boxing.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/breakout.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/carnival.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/casino.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/centipede.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/chopper_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/crazy_climber.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/crossbow.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/darkchambers.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/defender.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/demon_attack.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/donkey_kong.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/double_dunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/earthworld.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/elevator_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
2 changes: 1 addition & 1 deletion docs/environments/atari/enduro.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ along with the default values.

A thorough discussion of the intricate differences between the versions and configurations can be found in the general article on Atari environments.

* v5: Stickiness was added back and stochastic frameskipping was removed. The environments are now in the "ALE" namespace.
* v5: Stickiness was added back and stochastic frame-skipping was removed. The environments are now in the "ALE" namespace.
* v4: Stickiness of actions was removed
* v0: Initial versions release
Loading

0 comments on commit bf081a5

Please sign in to comment.