From 8fceb584a00d86a3294c2d6ffb6fb8d93496b6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erc=C3=BCment=20=C4=B0lhan?= Date: Mon, 24 Feb 2020 21:38:43 +0300 Subject: [PATCH] Fixed incorrect behaviour in some games when difficulty ramping was disabled. Default behaviour should not be effected. (#7) * Fix ramping condition * Fix alien positioning condition * Fix ramping condition * Incremented version number Co-authored-by: Kenny Young --- minatar/environments/asterix.py | 2 +- minatar/environments/seaquest.py | 2 +- minatar/environments/space_invaders.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/minatar/environments/asterix.py b/minatar/environments/asterix.py index 3551de6..d0eb097 100644 --- a/minatar/environments/asterix.py +++ b/minatar/environments/asterix.py @@ -92,7 +92,7 @@ def act(self, a): #Ramp difficulty if interval has elapsed - if(self.spawn_speed>1 or self.move_speed>1 and self.ramping): + if self.ramping and (self.spawn_speed>1 or self.move_speed>1): if(self.ramp_timer>=0): self.ramp_timer-=1 else: diff --git a/minatar/environments/seaquest.py b/minatar/environments/seaquest.py index d092f30..b50a93d 100644 --- a/minatar/environments/seaquest.py +++ b/minatar/environments/seaquest.py @@ -215,7 +215,7 @@ def _surface(self): r = 0 self.oxygen = max_oxygen self.diver_count -= 1 - if(self.e_spawn_speed>1 or self.move_speed>2 and self.ramping): + if self.ramping and (self.e_spawn_speed>1 or self.move_speed>2): if(self.move_speed>2 and self.ramp_index%2): self.move_speed-=1 if(self.e_spawn_speed>1): diff --git a/minatar/environments/space_invaders.py b/minatar/environments/space_invaders.py index 8c9bc57..349bcc5 100644 --- a/minatar/environments/space_invaders.py +++ b/minatar/environments/space_invaders.py @@ -75,7 +75,7 @@ def act(self, a): self.terminal = True if(self.alien_move_timer==0): self.alien_move_timer = min(np.count_nonzero(self.alien_map),self.enemy_move_interval) - if(np.sum(self.alien_map[:,0])>0 and self.alien_dir<0 or np.sum(self.alien_map[:,9])>0 and self.alien_dir>0): + if((np.sum(self.alien_map[:,0])>0 and self.alien_dir<0) or (np.sum(self.alien_map[:,9])>0 and self.alien_dir>0)): self.alien_dir = -self.alien_dir if(np.sum(self.alien_map[9,:])>0): self.terminal = True diff --git a/setup.py b/setup.py index ac28c1a..62aeaf1 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='MinAtar', - version='1.0.5', + version='1.0.6', description='A miniaturized version of the arcade learning environment.', url='https://github.com/kenjyoung/MinAtar', author='Kenny Young',