Skip to content
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

Fix tests for pooyan and airraid #39

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | Krull | Montezum. | MsPacman | Pacman | Pitfall | Pong | Pooyan | PrivateE. | Q*Bert | RiverRaid | RoadR. | Seaquest | Skiing | SpaceInv. | Tennis | TimePilot | UpNDown | Venture | VideoP. | YarsR. |
| -------- | --------- | ------- | -------- | ------- | ------- | --------- | -------- | --------- | ---------- | ------ | ------- | ------- | ------ | -------- | -------- | --------- | --------- | ------- | ------- | -------- | ---------- | --------- | ------- | ------- | --------- | ------ | ---- | --------- | --------- | -------- | ----- | --------- | -------- | ------ | ------- | ---- | ------ | --------- | ------ | --------- | ------ | -------- | ------ | --------- | ------- | --------- | ------- | ------- | ------- | ------- |
| Regular | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ❌ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Slot | ✓ | ✓ | ✓ | | 🐏 | 🐏 | | ✓ | | | 🐏 | 🐏 | ✓ | ✓ | | | | | | 🐏 | | 🐏 | 🐏 | 👁️ | ✓ | 🐏 | | 🐏 | | ✓ | | 🐏 | ✓ | | | ✓ | ✓ | | | 🐏 | | ✓ | ✓ | ✓ | 🐏 | | | | | |
* ✓: completed
* 🐛: bug
* 👁️: only vision
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
12 changes: 6 additions & 6 deletions ocatari/ram/pooyan.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 Pooyan.

"""

Expand Down Expand Up @@ -224,7 +224,7 @@ def _detect_objects_ram(objects, ram_state, hud=False):
projectile2.wh = 10, 4
objects[1], objects[2] = projectile1, projectile2

# # ballon and enemy
# ballon and enemy
balloons = [NoObject()] * 6
balloon_color = [[236, 236, 236],
[127, 92, 213],
Expand Down Expand Up @@ -346,7 +346,7 @@ def _detect_objects_ram(objects, ram_state, hud=False):
objects[17] = rock

# player score
player_score = NoObject()
# player_score = NoObject()
if hud:
player_score = PlayerScore()
a = ram_state[9] % 16 + 10 * (ram_state[9] // 16)
Expand Down Expand Up @@ -377,15 +377,15 @@ def _detect_objects_ram(objects, ram_state, hud=False):
else:
player_score.xy = 72, 3
player_score.wh = 29, 9
objects[18] = player_score
objects[18] = player_score

# lives
lives = NoObject()
# lives = NoObject()
if hud and ram_state[22] != 0:
lives = Lives()
lives.lives = ram_state[22]
if lives.lives == 1:
lives.wh = 2, 6
elif lives.lives == 2:
lives.wh = 6, 6
objects[19] = lives
objects[19] = lives
Loading