hsahovic / poke-env

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

poke_env max_pp is lower than PokemonShowdown #355

Closed quadraticmuffin closed 1 year ago

quadraticmuffin commented 1 year ago

Currently the value of Move.max_pp is being populated from data/genx_moves.json, but this file uses default PP values. This is a problem because Pokemon Showdown does not use the default PP; rather, it uses the highest possible PP. For example, the move Agility has 30 (max 48) PP; poke_env thinks it has 30, but Pokemon Showdown uses 48.

This leads to Move.current_pp sometimes returning a negative value, as Move.use() does not check whether the current_pp is 0 before subtracting from it.

hsahovic commented 1 year ago

Thanks, that's a good catch! Fixed in 5c09ddeb96f150b64d2955279f6fdf9479cbaa58.

quadraticmuffin commented 1 year ago

return self.entry["pp"] * 8 / 5 Some moves in later gens have 1 PP, which is not divisible by 5. You might want to add a floor function, or use integer division: return self.entry["pp"] * 8 // 5