From 8042fdcfe03758857900cbeb1a08785d682ffa9d Mon Sep 17 00:00:00 2001 From: Douglas De Rizzo Meneghetti Date: Fri, 9 Jul 2021 13:01:53 -0300 Subject: [PATCH] Addresses #72 --- smac/env/starcraft2/starcraft2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smac/env/starcraft2/starcraft2.py b/smac/env/starcraft2/starcraft2.py index 0580b727..0e3af36b 100644 --- a/smac/env/starcraft2/starcraft2.py +++ b/smac/env/starcraft2/starcraft2.py @@ -742,7 +742,7 @@ def reward_battle(self): delta_enemy += prev_health - e_unit.health - e_unit.shield if self.reward_only_positive: - reward = abs(delta_enemy + delta_deaths) # shield regeneration + reward = max(0, delta_enemy + delta_deaths) # shield regeneration else: reward = delta_enemy + delta_deaths - delta_ally