Skip to content

Commit

Permalink
Fixed incorrect behaviour in some games when difficulty ramping was d…
Browse files Browse the repository at this point in the history
…isabled. 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 <[email protected]>
  • Loading branch information
ercumentilhan and kenjyoung authored Feb 24, 2020
1 parent 74e549b commit 8fceb58
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion minatar/environments/asterix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/seaquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion minatar/environments/space_invaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 8fceb58

Please sign in to comment.