Skip to content

Commit

Permalink
Merge pull request #41 from k4ntz/develop
Browse files Browse the repository at this point in the history
Bug Fixes and New Game Additions
  • Loading branch information
BluemlJ authored Feb 11, 2025
2 parents 467accd + a15415c commit 2ac9ebd
Show file tree
Hide file tree
Showing 23 changed files with 1,273 additions and 925 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ More information can be found in this [ReadMe](scripts/demo/README%20Demos.md)
With `env.objects`, you can access the list of objects found in the current state. Note that these lists can differ depending on the mode you used when initiating the environment.

#### List of covered games
| | Alien | Amidar | Assault | Asterix | Asteroids | Atlantis | BankHeist | BattleZone | BeamR. | Berzerk | Bowling | Boxing | Breakout | Carnival | Centipede | ChopperC. | CrazyC. | DemonA. | DonkeyK. | DoubleDunk | FishingD. | Freeway | Frogger | Frostbite | Gopher | Hero | IceHockey | Jamesbond | Kangaroo | Krull | Montezum. | MsPacman | Pacman | Pitfall | Pong | PrivateE. | Q*Bert | RiverRaid | RoadR. | Seaquest | Skiing | SpaceInv. | Tennis | TimePilot | UpNDown | Venture | VideoP. | YarsR. |
| -------- | ------- | -------- | ------- | ------- | --------- | -------- | --------- | ---------- | ------ | ------- | ------- | ------ | -------- | -------- | --------- | --------- | ------- | ------- | -------- | ---------- | --------- | ------- | ------- | --------- | ------ | ---- | --------- | --------- | -------- | ----- | --------- | -------- | ------ | ------- | ---- | --------- | ------ | --------- | ------ | -------- | ------ | --------- | ------- | --------- | ------- | ------- | ------- | ------- |
| Regular || || || ||| ||| || ||| ||| ||| | ||| | || | || ||| || || || || ||| ||
| Slot | 🐛 | | | 🐏 | 🐏 | | | | | 🐏 | 🐏 || | | | | | | 🐏 | | 🐏 | 🐏 | 👁️ | 🐛 | 🐏 | | 🐏 | || | 🐏 | 🐏 | | || | | | | || | 🐏 | | | | | |
| | AirRaid | Alien | Amidar | Assault | Asterix | Asteroids | Atlantis | BankHeist | BattleZone | BeamR. | Berzerk | Bowling | Boxing | Breakout | Carnival | Centipede | ChopperC. | CrazyC. | DemonA. | DonkeyK. | DoubleDunk | FishingD. | Freeway | Frogger | Frostbite | Gopher | Hero | IceHockey | Jamesbond | Kangaroo | KeystoneK. | Krull | Montezum. | MsPacman | Pacman | Pitfall | Pitfall2 | Pong | Pooyan | PrivateE. | Q*Bert | RiverRaid | RoadR. | Seaquest | Skiing | SpaceInv. | Tennis | TimePilot | UpNDown | Venture | VideoP. | YarsR. |
| -------- | --------- | ------- | -------- | ------- | ------- | --------- | -------- | --------- | ---------- | ------ | ------- | ------- | ------ | -------- | -------- | --------- | --------- | ------- | ------- | -------- | ---------- | --------- | ------- | ------- | --------- | ------ | ---- | --------- | --------- | -------- | ---------- | ----- | --------- | -------- | ------ | ------- | ------- | ---- | ------ | --------- | ------ | --------- | ------ | -------- | ------ | --------- | ------- | --------- | ------- | ------- | ------- | ------- |
| Regular | ||||||||||||||||||||||| ||||||| |||||| || | |||||||||||||
| Slot | ||| | 🐏 | 🐏 | 🐏 || | | 🐏 | 🐏 ||| | | | | 🐏 | 🐏 | | 🐏 | 🐏 | 👁️ | | 🐏 | | 🐏 | || 👁️ | | 🐏 | | || | | | | | 🐏 | |||| 🐏 | | | | | |
* ✓: completed
* 🐛: bug
* 👁️: only vision
Expand Down
5 changes: 3 additions & 2 deletions ocatari/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def __init__(self, env_name, mode="ram", hud=False, obs_mode="obj", render_mode=
# Create a dictionary of game object classes for categorization
self._class_dict = get_class_dict(self.game_name)
# Initialize slots to store all possible game objects
self._slots = [self._class_dict[c](
) for c, n in self.max_objects_per_cat.items() for _ in range(n)]
self._slots = [self._class_dict[c]()
for c, n in self.max_objects_per_cat.items()
for _ in range(n)]
# Initialize the neurosymbolic state representation with zeros
self._ns_state = np.zeros(
sum([len(o._nsrepr) for o in self._slots]))
Expand Down
12 changes: 6 additions & 6 deletions ocatari/ram/airraid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np

"""
RAM extraction for the game Pong.
RAM extraction for the game AirRaid.
"""

Expand Down Expand Up @@ -301,7 +301,7 @@ def _detect_objects_ram(objects, ram_state, hud=False):

# player score
ps_color_by_mode = [[87, 139, 201], [131, 131, 131]]
player_score = NoObject()
# player_score = NoObject()
if hud:
player_score = PlayerScore()
a = ram_state[40] % 16 + 10 * (ram_state[40] // 16)
Expand Down Expand Up @@ -343,11 +343,11 @@ def _detect_objects_ram(objects, ram_state, hud=False):
else:
player_score.xy = 56, 11
player_score.wh = 46, 9
player_score.rgb = ps_color_by_mode[grayscaled]
objects[18] = player_score
player_score.rgb = ps_color_by_mode[grayscaled]
objects[18] = player_score

# lives
lives = NoObject()
# lives = NoObject()
if hud and ram_state[39] in [1, 2]:
lives = Lives()
lives.lives = ram_state[39]
Expand All @@ -357,4 +357,4 @@ def _detect_objects_ram(objects, ram_state, hud=False):
lives.wh = 7, 5 + int(grayscaled)
elif lives.lives == 2:
lives.wh = 15, 5 + int(grayscaled)
objects[19] = lives
objects[19] = lives
Loading

0 comments on commit 2ac9ebd

Please sign in to comment.