Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

80 lines (59 sloc) 3.629 kb

Pokémon Switching Statistics

This is a program that reads Shoddy Battle battle logs in order to prepare statistics regarding Pokémon switching. This program was written by Cathy Fitzpatrick in September 2009 and it is licensed under the GNU Affero General Public License, version 3 or later.

The logs directory contains several sample logs to run the program on. The main.php program parses the input logs and produces a results output file. The sort.php program reads the results file (sample: results-2009-08.bin) and produces a set of HTML output files.

Dependencies

  • This program requires PHP.
  • The sort.php program optionally uses HTML Tidy, which is assumed to be on the PATH and named tidy. If tidy is not found, the program will still work; the only difference is that the HTML output will not be indented.

Definitions

In order to understand the statistics, it is necessary to define some terms.

Except for at the start of the battle, whenever one player sends out a new Pokémon X (including through Baton Pass and U-turn), if there is a Pokémon Y on the opponent's side of the field, then we say that Pokémon X switched into Pokémon Y. We call Pokémon X the subject of the switch in and Pokémon Y the object of the switch in.

We can sort the switch in statistics both by subject and by object. Given a particular Pokémon X, the statistics sorted by subject tell you the most common Pokémon that Pokémon X switches into. Similarly, given a particular Pokémon X, the statistics sorted by object tell you the most common Pokémon who switch into Pokémon X.

Interpretation example

Here is an example of how to interpret this data. This is an excerpt from the statistics sorted by subject showing you the most common Pokémon that Gyarados switches into on the Standard ladder:

  1. Scizor - 7.12% (12166)
  2. Heatran - 6.37% (10897)
  3. Swampert - 4.85% (8284)
  4. Infernape - 4.62% (7907)
  5. Salamence - 3.86% (6597)
  6. Gyarados - 3.7% (6321)
  7. Lucario - 3.34% (5715)

This means that in August 2009, Gyarados switched into Scizor 12166 times, which was 7.12% of all switches in which Gyarados was the subject.

August 2009 data

This program was run on the battle logs from Smogon's Shoddy Battle server for August 2009. Here are the results as generated by this program:

Further reading

You may be interested in more information about Shoddy Battle's statistical functionality.

Credits

Jump to Line
Something went wrong with that request. Please try again.