Skip to content

Commit

Permalink
Cut event obs
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 3, 2024
1 parent b719349 commit 4f1f8cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def __init__(self, env_config: pufferlib.namespace):
"direction": spaces.Box(low=0, high=4, shape=(1,), dtype=np.uint8),
# "reset_map_id": spaces.Box(low=0, high=0xF7, shape=(1,), dtype=np.uint8),
"battle_type": spaces.Box(low=0, high=4, shape=(1,), dtype=np.uint8),
"cut_event": spaces.Box(low=0, high=1, shape=(1,), dtype=np.uint8),
"cut_in_party": spaces.Box(low=0, high=1, shape=(1,), dtype=np.uint8),
# "x": spaces.Box(low=0, high=255, shape=(1,), dtype=np.u`int8),
# "y": spaces.Box(low=0, high=255, shape=(1,), dtype=np.uint8),
Expand Down Expand Up @@ -547,6 +548,7 @@ def _get_obs(self):
),
# "reset_map_id": np.array(self.read_m("wLastBlackoutMap"), dtype=np.uint8),
"battle_type": np.array(self.read_m("wIsInBattle") + 1, dtype=np.uint8),
"cut_event": np.array(self.read_bit(0xD803, 0), dtype=np.uint8),
"cut_in_party": np.array(self.check_if_party_has_cut(), dtype=np.uint8),
# "x": np.array(player_x, dtype=np.uint8),
# "y": np.array(player_y, dtype=np.uint8),
Expand Down
1 change: 1 addition & 0 deletions pokemonred_puffer/policies/multi_convolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def encode_observations(self, observations):
one_hot(observations["direction"].long(), 4).float().squeeze(1),
# one_hot(observations["reset_map_id"].long(), 0xF7).float().squeeze(1),
one_hot(observations["battle_type"].long(), 4).float().squeeze(1),
observations["cut_event"].float(),
observations["cut_in_party"].float(),
# observations["x"].float(),
# observations["y"].float(),
Expand Down

0 comments on commit 4f1f8cb

Please sign in to comment.