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

Adding stats storage, name in Pokemon, and teampreview storage #581

Closed caymansimpson closed 2 months ago

caymansimpson commented 3 months ago

This is building off of this PR and refers to this issue. It does the following:

  1. Fixes stats storage, such that: a. We record the stats of our own pokemon via teambuilder so that we have access to them before a request happens b. We record our HP stat in stats c. Add a stats setter to support future moves that affect stats (e.g. power swap, speed swap)
  2. Add a name property to Pokemon to make finding pokemon identifiers easier, especially when we need to parse through showdown logs manually
  3. Stores the player's teampreview pokemon in a teampreview property. This is important to track because opponent moves are going to be affected by this information (for VGC)

I'm submitting this PR just because I think these changes are valuable for other developers using poke-env, but don't feel pressure to accept them!

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 95.23810% with 3 lines in your changes missing coverage. Please review.

Project coverage is 85.36%. Comparing base (f458350) to head (5384727). Report is 61 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #581 +/- ## ========================================== + Coverage 83.38% 85.36% +1.97% ========================================== Files 39 42 +3 Lines 3918 4277 +359 ========================================== + Hits 3267 3651 +384 + Misses 651 626 -25 ```
caymansimpson commented 3 months ago

After sitting with this, I will probably add one more update to this to change teampreview_team to a List instead of a Set (and resolve the conflict). It shouldn't block this PR, but I think a List would help because in player.teampreview, having an ordered list of mons is more helpful, as we have to return the indices + 1 as a message. WDYT?

hsahovic commented 3 months ago

@caymansimpson can you take a look at the conflicts and then i'll merge?

caymansimpson commented 3 months ago

Resolved!

caymansimpson commented 3 months ago

Accidentally pushed this to the wrong branch; but also a small change 🤦🏽‍♂️ -- just adding Quick Draw as an Effect since it affects Speed Parsing