PWhiddy / PokemonRedExperiments

Playing Pokemon Red with Reinforcement Learning
MIT License
7k stars 645 forks source link

[Suggestion] Remove battle animations #159

Open JuliusBooth opened 11 months ago

JuliusBooth commented 11 months ago

Skipping battle animations would probably speed up training ~5%. There is a setting in the game to do that.

There are also a lot of animation/pokemon frame combinations that might lead to a lot of (perhaps unintentional) screen exploration reward.

w531t4 commented 11 months ago

@JuliusBooth Regarding your comment about animation/pokemon frame combinations that lead to extra reward.. i've removed all battles from rewards and see promising results. It doesn't address the in-game setting, but it's a good idea.

...
        # The screen transitions (prior to battle) seem to be encouraging
        # it to go into battle more often. 0xd057 is non-zero when in battle
        # (and during transitions).
        battle_indicator = self.read_m(0xD057)
...
        if battle_indicator == 0:
            if self.use_screen_explore:
                self.update_frame_knn_index(obs_flat)
            else:
                self.update_seen_coords(location=location)
...