Programming Speed tier utility tool

qpie

predatory
is a Top Tiering Contributor Alumnus
Link: vpcpg.com/speed

What?
A website that displays Pokémon with at least X% usage in a given tier sorted by their speed. It lets you toy around with different EV/IV/nature combinations in various ways and allows you to keep memos of important speed tiers

1.PNG 2.PNG 3.PNG

How?
Just select a tier and minimum usage and hit 'Show'. There should be a help button on the far right which explains further functions like using different EV spreads below a certain base speed.

On the inside it simply copies stats from smogon.com/stats, stores them and later displays them based on your queries.

Why?
This was largely created as an excuse to teach myself 'some programming stuff'. Hopefully some of you will find it useful in one way or another as well.

Any feedback is greatly appreciated.


160316

- added VGC2016
- added LC (format still needs some work)

160319
- added 1v1, Balanced Hackmons and Monotype
- tier/ usage selectors now remember last input
 
Last edited:
One thing I thought of was, that for example in OU, you have Mega Venusaur sitting at 284 speed. Well that is never going to happen. Why not make the speed tiers by Smogon Sets, because they're the most common ones anyway. Just put then the base stat, the IVs and EVs into a stat calculation formula and there you have it.

If you don't know how to dump the smogon sets, I might be able to help you, since I had to do it for this project: https://projectpokemon.org/forums/showthread.php?44694-Smogon-Dex-Pokemon-Collection

Let's say my result was this textfile: http://puu.sh/mpLPa/b8241508db.txt (It's from January, but I could make you one more up to date one).

Anyway, cool project and I would love to help! :)
 

qpie

predatory
is a Top Tiering Contributor Alumnus
One thing I thought of was, that for example in OU, you have Mega Venusaur sitting at 284 speed. Well that is never going to happen. Why not make the speed tiers by Smogon Sets, because they're the most common ones anyway. Just put then the base stat, the IVs and EVs into a stat calculation formula and there you have it.

If you don't know how to dump the smogon sets, I might be able to help you, since I had to do it for this project: https://projectpokemon.org/forums/showthread.php?44694-Smogon-Dex-Pokemon-Collection

Let's say my result was this textfile: http://puu.sh/mpLPa/b8241508db.txt (It's from January, but I could make you one more up to date one).

Anyway, cool project and I would love to help! :)
Hey there!

I originally toyed with the idea of getting EV spreads straight from the moveset stats (example), but they seemed a little... daunting to work with for a first project. So I settled on sticking to base speed and usage stats and letting the user handle everything else. :3c

With that said, speed tiers with proper sets from moveset stats or the strategy dex are something I'd love to tackle eventually, but that might turn into a whole new project altogether.

Did you get your sets straight from the strategy dex? Could you explain (for dummies) how you did that?

Thanks a lot for your feedback, much appreciated.
 
I originally toyed with the idea of getting EV spreads straight from the moveset stats (example), but they seemed a little... daunting to work with for a first project. So I settled on sticking to base speed and usage stats and letting the user handle everything else. :3c
Howdy! I don't actually do much but lurk here (except for one post I made about a dumb gimmick set when I was new to BH ^^;), but I saw this and figured some code I have might help. I run a Skype bot that does, among other things, some informational commands about pokemon stuff (think showdown's !data and !analysis), and one of them presents usage data, which I pull from the moveset stats and then prune using python and some regexes I wrote. It's pretty simple:
Code:
for line in rawdata:
   results = re.search(r"^ \| ([A-Za-z]+)\ +\|", line)
   try:
     try:
       if results.group(1).lower() in pokemonlist: #is it a pokemon?
         formatteddata[results.group(1)] = {}
         currentpokemon = results.group(1)
         formatteddata[currentpokemon][currentcategory] = currentpokemon.lower()
       elif results.group(1) == "Abilities": #is it a category header?
         currentcategory = "Abilities"
         formatteddata[currentpokemon][currentcategory] = {}
       elif results.group(1) == "Items":
         currentcategory = "Items"
         formatteddata[currentpokemon][currentcategory] = {}
       elif results.group(1) == "Spreads":
         currentcategory = "Spreads"
         formatteddata[currentpokemon][currentcategory] = {}
       elif results.group(1) == "Moves":
         currentcategory = "Moves"
         formatteddata[currentpokemon][currentcategory] = {}
       elif results.group(1) == "Teammates":
         currentcategory = "ELSE"
     except:
       pass

     if currentcategory != "ELSE": #is it data under one of the important categories?
       inlinedata = re.search(r"^ \| (.+) (.+)\% +\|", line)
       #inlinedata.group(1), inlinedata.group(2)
       formatteddata[currentpokemon][currentcategory][inlinedata.group(1)] = inlinedata.group(2)

   except:
     pass
where rawdata is the usage data .txt, and pokemonlist is a list of all pokemon. It returns a list formatted as such:
Code:
formatteddata = {
   "Labababba": {
     "Abilities": {"Gooey": 50, "Cute Charm": 25, "Blaze": 25},
     "Items": {"Sea Incense": 80, "White Herb": 20},
     "Spreads": {"Relaxed:252/0/252/0/4/0": 90, "Bold:252/0/4/0/252/0": 10},
     "Moves": {"Celebrate": 100, "Hold Hands": 100, "Baton Pass": 100, "Judgment": 100}
     }
}

Of course, that code takes a minute or two to run on the gargantuan usage stat files, but you could opt to run a program like this one once, put the data in, and then rerun it every time new stats are posted. Getting rid of all the non-EV stuff and possibly doing it in another language would probably make it a lot faster, anyway. A better alternative (for a webapp that's meant to do a bunch of tiers, at least) might also be to pull out those two regexes and use them to do basically the same thing, but only for mons that are in a tier, or only the mons listed in its viability rankings, or only for mons above a usage cutoff (which you could easily use that second regex to find directly within the data, tbh). I haven't looked too hard into what FLG did above, but from what I understand theirs is a thing they ran in advance and used the results of, which would require rerunning every month if you wanted to base off usage stats, and rerunning every time a new analysis is posted otherwise. Even if it's not, I think having usage-based speed tiers rather than analysis-based ones would be cool :B

If you're not familiar with regex/regular expressions (and it sounds like you're fairly new to programming, so probably not), the tl;dr is that you can write small strings of code (ie, expressions) to look for patterns in text (ie, regularities). I use two in that code - "^ \| ([A-Za-z]+)\ +\|" to check if a line is a header, and then "^ \| (.+) (.+)\% +\|" to add any useful information it contains to formatteddata. The way mine is structured is not terribly efficient, because I wrote it very fast and didn't need it to run in realtime in a webapp or anything. But the regexes both work, so at the very least you can borrow those, and if you want to do something similar, well, here's how I did it. If you want to repay me, you can add BH speed tiers to your tool ;) I've found your tool really nifty already for LC tiers!
 
Last edited:
I haven't looked too hard into what FLG did above, but from what I understand theirs is a thing they ran in advance and used the results of, which would require rerunning every month if you wanted to base off usage stats, and rerunning every time a new analysis is posted otherwise.
You basically hit the nail on the toe. That's exactly what I'm doing.
With that being said, I really like your idea of sets from usage stats and it's probably an even better idea than mine!
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top