From 1056fcaa9da205b47c383085af634c50fc67a652 Mon Sep 17 00:00:00 2001 From: Daniel Palenicek Date: Tue, 12 Dec 2017 13:05:01 +0100 Subject: [PATCH] Fixed issue when sending send the army The way it was before only the very first marine would be send and the others would just wait at the barrack's rally point. This way The marines will wait until the supply is at its max and then send the entire army at once. --- Building a Basic Agent/simple_agent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Building a Basic Agent/simple_agent.py b/Building a Basic Agent/simple_agent.py index a5fee65..0cf62c3 100644 --- a/Building a Basic Agent/simple_agent.py +++ b/Building a Basic Agent/simple_agent.py @@ -103,8 +103,9 @@ def step(self, obs): return actions.FunctionCall(_RALLY_UNITS_MINIMAP, [_NOT_QUEUED, [29, 21]]) return actions.FunctionCall(_RALLY_UNITS_MINIMAP, [_NOT_QUEUED, [29, 46]]) - elif obs.observation["player"][_SUPPLY_USED] < obs.observation["player"][_SUPPLY_MAX] and _TRAIN_MARINE in obs.observation["available_actions"]: - return actions.FunctionCall(_TRAIN_MARINE, [_QUEUED]) + elif obs.observation["player"][_SUPPLY_USED] < obs.observation["player"][_SUPPLY_MAX]: + if _TRAIN_MARINE in obs.observation["available_actions"]: + return actions.FunctionCall(_TRAIN_MARINE, [_QUEUED]) elif not self.army_rallied: if not self.army_selected: if _SELECT_ARMY in obs.observation["available_actions"]: