From be0485b2b91b8e1ec25ee788abb6bf4b45fad76f Mon Sep 17 00:00:00 2001 From: Vasilis Valatsos Date: Tue, 21 Nov 2023 18:09:30 +0100 Subject: [PATCH] Updated inputs of NN --- entities/player.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/entities/player.py b/entities/player.py index 93711b6..a2add16 100644 --- a/entities/player.py +++ b/entities/player.py @@ -115,13 +115,11 @@ class Player(pygame.sprite.Sprite): ] self.state_features = [ - self.rect.center[0], - self.rect.center[1], - self.stats.health, - self.stats.energy, - self.stats.attack, - self.stats.magic, - self.stats.speed + # TODO: Find a way to normalize + # self.rect.center[0], + # self.rect.center[1], + self.stats.health/self.stats.stats['health'], + self.stats.energy/self.stats.stats['energy'] ] enemy_states = [] @@ -129,15 +127,12 @@ class Player(pygame.sprite.Sprite): for distance, direction, enemy in sorted_distances[:5]: enemy_states.extend([ - distance, + distance/sorted_distances[-1][1], direction[0], direction[1], - enemy.stats.health, - enemy.stats.attack, - enemy.stats.speed, - enemy.stats.exp, - enemy.stats.attack_radius, - enemy.stats.notice_radius + enemy.stats.health/enemy.stats.monster_info['health'], + enemy.stats.attack/enemy.stats.monster_info['attack'], + enemy.stats.exp/enemy.stats.monster_info['exp'], ]) self.state_features.extend(enemy_states)