From 37cfe6054d116e6d93faf750199bf30e4622cc67 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Sun, 16 Jun 2024 00:25:22 -0400 Subject: [PATCH] fix simpler bag obs --- pokemonred_puffer/environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index 4d15864..c2355db 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -477,7 +477,8 @@ def _get_obs(self): # player_x, player_y, map_n = self.get_game_coords() _, wBagItems = self.pyboy.symbol_lookup("wBagItems") bag = np.array(self.pyboy.memory[wBagItems : wBagItems + 40]) - numBagItems = self.pyboy.symbol_lookup("wNumBagItems") + numBagItems = self.read_m("wNumBagItems") + # item ids start at 1 so using 0 as the nothing value is okay bag[2 * numBagItems :] = 0 return {