The Conley Club

Reader

Read the latest posts from The Conley Club.

from Pokemon Nerd Dan

In the course of trying to (nearly) automate downloading matchup information from PvPoke I had to decipher what, exactly, the path parameters in the URL meant.

To step back: let's say you go to the Battle page. You choose Multi Battle, and then Jungle Cup. You choose Vigoroth as the attacking Pokemon, and — because you're finicky — even enter the specific IVs and level of your Vigoroth, the one you'll be using in your tournament. You click “battle”, et voila: you have the results.

But! Look at the URL. It's changed! For me, it's now

https://pvpoke.com/battle/multi/1500/jungle/vigoroth-27-12-15-15-4-4-1/11/0-1-3/2-1/

That's a lot of numbers! It's nice, though, because I knew I could change the URL itself to change the battle. In the past I've done that to avoid going through menus, but now my use case is that I want my code to launch the specific URL I want. You may have a similar use case! So let's decypher the parameters.

Some are easy enough to figure out:

https://pvpoke.com/battle/multi/(CP limit)/(cup name)/(Pokemon)-(level)-(attack IV)-(defense IV)-(stamina IV)-4-4-1/11/0-1-3/2-1/

For the others I could guess or get them through trial and error, but PvPoke is open source! So let's look at the source. In particular, the .htaccess, which has:

RewriteRule battle/multi/(\d+)/([a-zA-Z0-9-]+)/([a-zA-Z_\d\.-]+)/([\d-]+)/([\da-zA-Z_-]+)/([\d-]+).*$ battle.php?mode=multi&cp=$1&cup=$2&p1=$3&s=$4&m1=$5&cms=$6 [L,QSA]

So now I know that elsewhere in the code:

  • 4-4-1 after my Pokemon is part of p1
  • 11 is called s
  • 0-1-3 is called m1 (I had suspected it was the moveset, so this tracks)
  • 2-1 is something called cms

I'll spare you the minutiae of tracking everything else down (odd to stop now, I know), but it's all in Interface.js.

The format

https://pvpoke.com/battle/multi/(CP limit)/(cup name)/<P1>/<S>/<M1>/<CMS>/

P1

name-level-atkiv-defiv-staiv-atkmod-defmod-baitshields

atkmod and defmod are in-battle modifiers, like from Power Up Punch or Ominous Wind. 4 means no modifier.

baitshields is whether to bait shields, ie with Thunder Punch instead of Wild Charge. 1 for yes, 0 for no.

S

11

Shields! This isn't actually one number but two digits: the first is how many shields you use, the second is your opponent. So 01 means you don't use any shields and your opponent uses 1.

Anything above 2 is treated as 0. I was hoping I could sim something where I had 9 shields, but alas. Empoleon_Dynamite is too smart for me.

M1

0-1-3

Three numbers: fast move, charge move 1, charge move 2.

Of the available moves for your Pokemon, this is their index in the html form. This comes from the PvPoke gamemaster.json file, which I'm a big fan of because it's taking the gamemaster file scraped from the game itself and parsing it into something more usable.

Of note: the available moves are alphabetized, and the fast moves start at index 0 while the charge starts at 1. This is because a charge move of 0 means no move.

And so, since Viggy can learn "BODY_SLAM", "BRICK_BREAK", "BULLDOZE", since mine has Body Slam and Bulldoze the charge moves are 1 and 3.

CMS

2-1

Two numbers: the first is how many fast moves your opponents know. The second is whether they bait shields.

Here I thought I had found a bug, because you can sim against an entire cup and set your opponents' known charge moves to 0! Spoiler alert: you do really well when your opponent never uses a charge move.

Feeling like I had really hackerman'd my way into the mainframe, I opened an issue on the PvPoke Github. It turns out that simming against 0 charge moves is intended: this way you can see if your opponent can farm you for energy.

In conclusion

This is just for one specific battle type (multi battle vs a cup). The .htaccess file I linked to above has others, but since I don't care about them at the moment you'll have to write your own blog post.

Also: PvPoke has a Patreon. Considering this website is basically the de facto authority when it comes to Pokemon Go PVP and is referenced in most if not all discussions, the fact that as of this writing only 52 people support the website financially is an absolute crime.

 
Read more...

from Pokemon Nerd Dan

The finale of the trilogy.

Because hey, if you can be CP 10 at level 1.5... can you be CP 10 at level 2? 3? A million?

Here you go:

Level Number of Pokemon List of Pokemon
1 102 Azurill, Baltoy, Barboach, Beldum, Bidoof, Bronzor, Budew, Burmy (Plant), Burmy (Sandy), Burmy (Trash), Carvanha, Cascoon, Caterpie, Charmander, Cherubi, Chikorita, Chimchar, Cleffa, Combee, Croagunk, Cyndaquil, Diglett, Diglett (Alolan), Ditto, Duskull, Ekans, Electrike, Feebas, Finneon, Glameow, Gulpin, Happiny, Hoothoot, Hoppip, Igglybuff, Jigglypuff, Kakuna, Kirlia, Kricketot, Ledyba, Lotad, Luvdisc, Magikarp, Makuhita, Mareep, Marill, Meditite, Meowth, Meowth (Alolan), Metapod, Nidoran♀, Nidoran♂, Nincada, Nosepass, Pichu, Pidgey, Pikachu, Poliwag, Poochyena, Ralts, Rattata, Rattata (Alolan), Remoraid, Riolu, Seedot, Seel, Sentret, Shedinja, Shieldon, Shinx, Shroomish, Shuckle, Silcoon, Skiploom, Skitty, Slakoth, Slugma, Smeargle, Snorunt, Spearow, Spheal, Spinarak, Squirtle, Starly, Sunkern, Surskit, Swablu, Swinub, Taillow, Togepi, Tyrogue, Vulpix, Vulpix (Alolan), Weedle, Whismur, Wingull, Wobbuffet, Wooper, Wurmple, Wynaut, Zigzagoon, Zubat
1.5 23 Azurill, Burmy (Plant), Burmy (Sandy), Burmy (Trash), Caterpie, Combee, Feebas, Happiny, Igglybuff, Kakuna, Kricketot, Magikarp, Marill, Metapod, Pichu, Shedinja, Shuckle, Smeargle, Sunkern, Tyrogue, Weedle, Wynaut, Zigzagoon
2 6 Azurill, Feebas, Happiny, Magikarp, Shedinja, Shuckle
2.5 3 Feebas, Magikarp, Shedinja
3 1 Shedinja
3.5 1 Shedinja
4 1 Shedinja
4.5 1 Shedinja

(this is because Shedinja's base stats are 153/73/1. ONE. Chansey, meanwhile, has a base stamina of 487.)

 
Read more...

from Pokemon Nerd Dan

After I published the heartwarming story of the Little Smeargle Who Couldn't, I realized I could easily figure out the complete list of Pokemon who could be CP 10 at level 1.5:

	fp, _ := os.Open("gamemaster.json")
	defer fp.Close()
	gm, _ := pokemongo.NewGamemaster(fp)

	ivs := pokemongo.Stats{
		Attack:  0,
		Defense: 0,
		HP:      0,
	}
	level := 1.5
	for _, p := range gm.Pokemon {
		p.Level = level
		p.IVs = ivs
		p.Calculate()
		if p.CP == 10 {
			fmt.Println(p.Name)
		}
	}

(error checking omitted for brevity)

The list:

  • Azurill
  • Burmy (Plant)
  • Burmy (Sandy)
  • Burmy (Trash)
  • Caterpie
  • Combee
  • Feebas
  • Happiny
  • Igglybuff
  • Kakuna
  • Kricketot
  • Magikarp
  • Marill
  • Metapod
  • Pichu
  • Shedinja
  • Shuckle
  • Smeargle
  • Sunkern
  • Tyrogue
  • Weedle
  • Wynaut
  • Zigzagoon
 
Read more...

from Pokemon Nerd Dan

My son caught a Smeargle yesterday, and powered it up today. Ah, to be a child again, who

  • has the patience to use the snapshot feature, and
  • doesn't mind spending dust on something that's not for PVP

But I digress.

His Smeargle was CP 10, level 1. He powered it up and... it was still CP 10.

Wha happen?

The CP minimum! I knew that any value under 10 would be rounded up to 10. I just hadn't considered that you could be CP 10 at a level above 1!

His Smeargle is 5/0/2: clearly a god among men. Here's a table of CP from level 1 to 2.5:

level atk def hp atk * def^0.5 * sta ^ 0.51 divided by 10 CP
1 4.23 7.802 13 42.600531398094084 4.260 10
1.5 6.0811844310000005 11.216406839400001 20 91.08147384100222 9.108 10
2 7.48790415 13.81102321 24 136.32604170336802 13.326 13
2.5 8.669291355 15.990026277 28 183.43711153757977 18.344 18

So... yeah. Two levels at the minimum. You go, Smeargle.


1 The numbers are actually slightly off, as the HP had been truncated by the time I did the calculation. In my previous posts I would add debug statements to my code but this time I couldn't be bothered.

 
Read more...

from Pokemon Nerd Dan

Using wobbotfet, one of the mods of my Discord noticed an oddity: the bot and web version give a different ranking for a Swampert.

Using 1/2/10, wobbotfet says it's rank 257. The website said 258.

The answer to that turned out to be that 1/2/10 and 1/2/11 actually have the exact same stat product, and the two sites round differently. Something I should look into, maybe, but not a huge deal.

Then, in chat, he checked 0/14/12 and 0/14/13. Same thing: they have the exact same stat product. Except:

0 14 12

CP: 1492
Level: 19
Attack: 121.11401120000001
Defense: 110.05071210000001
HP: 138
Product: 1.839358278542938e+06

0 14 13

CP: 1495
Level: 19
Attack: 121.11401120000001
Defense: 110.05071210000001
HP: 138
Product: 1.839358278542938e+06

Huh?

They have the exact same stat product, but different CP. How?

The answer, my friends, is blo- er, rounding.

When calculating CP, the HP/Stamina isn't rounded: for a Swampert with 12 stamina, its stamina stat is 138.00009930000002. With 13 stamina it's 138.58237820000002.

They both round down to 138 when calculating the product: this is because that's how HP works in the game. You don't have 138.5 hit points. But when calculating the CP, the 0.58 does make a difference:

FLOOR(Stamina^0.5 * Attack * Def^0.5 / 10)

For our 12 stamina this becomes

(138.00009930000002^0.5 * 121.11401120000001 * 110.05071210000001^0.5) / 10
= (11.74734435095864 * 121.11401120000001 * 10.49050580763387) / 10
= 14925.55591752906766 / 10
= 1492

With one more stamina point it's

(138.58237820000002^0.5 * 121.11401120000001 * 110.05071210000001^0.5) / 10
= (11.77210169001270 * 121.11401120000001 * 10.49050580763387) / 10
= 14957.01128628144856 / 10
= 1495

And, just like that “where did the extra dollar go” riddle, I've turned one point into three.

 
Read more...