From 47aa001b4f565529caf27926123d515db11a39ce Mon Sep 17 00:00:00 2001 From: JDavidsson Date: Sat, 21 Jul 2018 13:47:49 +0200 Subject: [PATCH] update of feature layer names Thanks for your brilliant tutorial. In order to run this I had to change the layer names, seems like pysc2 changed them (https://github.com/deepmind/pysc2/blob/master/docs/environment.md#actions-and-observations) --- Building a Basic Agent/simple_agent_step2a.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Building a Basic Agent/simple_agent_step2a.py b/Building a Basic Agent/simple_agent_step2a.py index f55e4dd..771d382 100644 --- a/Building a Basic Agent/simple_agent_step2a.py +++ b/Building a Basic Agent/simple_agent_step2a.py @@ -40,12 +40,12 @@ def step(self, obs): time.sleep(0.5) if self.base_top_left is None: - player_y, player_x = (obs.observation["minimap"][_PLAYER_RELATIVE] == _PLAYER_SELF).nonzero() + player_y, player_x = (obs.observation["feature_minimap"][_PLAYER_RELATIVE] == _PLAYER_SELF).nonzero() self.base_top_left = player_y.mean() <= 31 if not self.supply_depot_built: if not self.scv_selected: - unit_type = obs.observation["screen"][_UNIT_TYPE] + unit_type = obs.observation["feature_screen"][_UNIT_TYPE] unit_y, unit_x = (unit_type == _TERRAN_SCV).nonzero() target = [unit_x[0], unit_y[0]] @@ -54,7 +54,7 @@ def step(self, obs): return actions.FunctionCall(_SELECT_POINT, [_NOT_QUEUED, target]) elif _BUILD_SUPPLYDEPOT in obs.observation["available_actions"]: - unit_type = obs.observation["screen"][_UNIT_TYPE] + unit_type = obs.observation["feature_screen"][_UNIT_TYPE] unit_y, unit_x = (unit_type == _TERRAN_COMMANDCENTER).nonzero() target = self.transformLocation(int(unit_x.mean()), 0, int(unit_y.mean()), 20)