PufferLib icon indicating copy to clipboard operation
PufferLib copied to clipboard

PWhiddy patches applied pokemon_red.py

Open techmore opened this issue 2 years ago • 0 comments

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))
        '''

techmore avatar Oct 22 '23 02:10 techmore