hsahovic / poke-env

A python interface for training Reinforcement Learning bots to battle on pokemon showdown
https://poke-env.readthedocs.io/
MIT License
297 stars 103 forks source link

Temporary Effects #579

Closed caymansimpson closed 2 months ago

caymansimpson commented 3 months ago

There are temporary Effects that only last a turn; for example:

But end silently in Showdown (eg they don't have a ['', '-end',...] message). This means that once a Pokemon has the Effect applied to them, this effect incorrectly persists for the rest of the game in poke-env. Some end after a pokemon moves, and some end after the turn, and some end when switched out (among other reasons). Would you be open to a PR that adds logic for these various effects? I don't want AI that encodes the battle state to think that once you Helping Hand a mon, it will always be helping handed. It will also make things like damage calculations with poke-env very difficult

I'm not sure what the best way to maintain/test implementation logic is though, given that it is almost necessarily custom. Curious if you have thoughts?

caymansimpson commented 2 months ago

@hsahovic I'm thinking of implementing by:

  1. Adding a list of effects that go away after moves (e.g. glaiverush)
  2. Adding a list of effects that go away after switches (e.g. all volatile statuses)
  3. Adding a list of effects that go away after turns (e.g. After You)

I will add these as curated lists in effects.py and implement the checks in abstract_battle.py for the next PR. I'm not going to get 100% coverage of every effect, but I should be able to get at least 95%. LMK if you have any opinions on (1) implementation plan, (2) how I should test or (3) anything else!