From 7a84e1abd7558152735168c9562a02a2416173a8 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:31:06 -0400 Subject: [PATCH] add required items to keys --- pokemonred_puffer/environment.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index abcf0f6..62f948c 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -655,7 +655,9 @@ def step(self, action): state = io.BytesIO() self.pyboy.save_state(state) state.seek(0) - info["state"] = {tuple(required_events): state.read()} + info["state"] = { + tuple(sorted(list(required_events) + list(required_items))): state.read() + } info["required_count"] = len(required_events) + len(required_items) info["env_id"] = self.env_id info = info | self.agent_stats(action)