PufferAI / PufferLib

Simplifying reinforcement learning for complex game environments
https://pufferai.github.io/
MIT License
1.23k stars 58 forks source link

PWhiddy patches applied pokemon_red.py #49

Open techmore opened 1 year ago

techmore commented 1 year ago

There was a section about health I was not sure how to integrate so I added those lines commented out.

Current code line 418

        # healing reward
        curr_health = self.read_hp_fraction()
        self.rewards["healing"] = self.cfg["rewards"]["healing_scale"] * max(0, curr_health - self.cfg["state_params"]["health"])
        if self.cfg["state_params"]["health"] <= 0: self.death_count += 1
        self.cfg["state_params"]["health"] = curr_health

New pushed code that is commented out

        '''
        # Not sure where to integrate
        prog = self.progress_reward
        # these values are only used by memory
        return (prog['level'] * 100 / self.reward_scale, 
                self.read_hp_fraction()*2000, 
                prog['explore'] * 150 / (self.explore_weight * self.reward_scale))
        '''