Mathematical formulas in Pokémon Go and in Goptimiz.

This page contains mathematical formulas. Faint hearted, read at your own risks.

This page lists the formulas that Goptimiz use, so that the results shown can be verified and reused if needed.

It is also a good occasion to explain how (and why) these formulas are used.



Movesets

A moveset is the combination of a quick move and a charged move. Each Pokémon has a moveset, that it uses while fighting.

Fight simulation

In order to calculate the offensive and defensive power of each Pokémon's movesets, Goptimiz simulates all the possible fights in Pokémon Go.

The parameters of the fights and the formulas that allow to calculate the damage dealt by a Pokémon being known, each simulation is made with the maximum precision possible.

The formula used is the one which determines the damage dealt by a move. This is the formula :

floor(0,5 × Atk attackerDef defender × Power move × STAB × Efficiency) + 1

All the possible figth are tested : each Pokémon species with each moveset are simulated, both in offense and in defense.
This represents 858,786 fight simulations in total.

Fight parameters

The fight simulations are based on these parameters :

  • Both opponents are level 40 with perfect IV.
  • The fight lasts 99 seconds or until one of the Pokémon faint.
  • The defending Pokémon has twice its normal HP.
  • A Pokémon can store 100 energy.
  • The defending Pokémon waits on average 2 seconds after using a move (between 1.5 and 2.5 seconds).
  • The defending Pokémon starts the fight with a double quick move. The second quick move starts at 1 second (even if the first one is not finished yet) and doesn't count in the cooldowns of the defender.
  • The attacking Pokémon dodges every charged move in the most optimized way possible. The damage of the charged move are reduced by 75%, but dodging takes 500ms.
  • A Pokémon gains 0.5 energy for each HP it loses (rounded up).
  • The defending Pokémon uses its charged move 50% of the time when it is available.

At the end of the fight, a score between 0% and 100% are given to each fighters using 3 variables :

  • Duration : the length of the fight in percentage (0 seconds = 0%, 99 seconds = 100%)
  • Dmg att : the damage dealt by the attacking Pokémon in percentage of the defender's max HP (0% if the defender didn't lose HP, 100% if it lost all its HP).
  • Dmg def : the damage dealt by the defending Pokémon in percentage of the attacker's max HP.

The scores are calculated using these formulas :

  • Attacking Pokémon : Dmg att + (1 - Duration) + 0.5 × Dmg def2.5
  • Defending Pokémon : (1 - Dmg att) + Duration + 0.5 × Dmg def2.5

These formulas allow to take into account both the DPS of a Pokémon and its tankiness, while favourizing damage for the attacker and tankiness and fight duration for the defender.


CP, IV and Pokémon levels

Combat Points

Combat Points (or CP) indicate approximately the raw power of a Pokémon.

CP are calculated using the following formula :

max(10, floor(sqrt(Stamina * CpM) * sqrt(Defense * CpM) * (Attack * CpM) 10))

Finding a Pokémon's IV

Thanks to the formula used to know the CP, calculating IV becomes a piece of cake :

To do this, we just have to test all the possible IV combinations based on the stats of a Pokémon's species, and the CP and HP of this Pokémon.

In order to eliminate the maximum amount of possible combinations, we can use several variables :

  • The number of dust required to power up a Pokémon, which idicates a range of possible levels for this Pokémon.
  • The player level, which limits the possible levels this Pokémon can have.
  • If the Pokémon has already been powered up, which allows to know if this Pokémon can have half levels or not.
  • The leader's appraisal, which allows to reduce the possibilities even further.

The CpMultiplier (CpM)

All the calculus using a Pokémon's level use a variable called CpMultiplier (or CpM).

The value of this variable changes with a Pokémon's level. Here is the list of the values of the CpM for every Pokémon level :

LevelCpM
10,09399999678134918
1.50,13513743132352829
20,16639786958694458
2.50,19265091419219971
30,21573247015476227
3.50,23657265305519104
40,25572004914283752
4.50,27353037893772125
50,29024988412857056
5.50,30605737864971161
60,32108759880065918
6.50,33544503152370453
70,34921267628669739
7.50,36245773732662201
80,37523558735847473
8.50,38759241108516856
90,39956727623939514
9.50,41119354951725062
100,42250001430511480
10.50,43292641341041438
110,44310754537582397
11.50,45305995387198578
120,46279838681221003
12.50,47233607806265349
130,48168495297431951
13.50,49085581023246050
140,49985843896865839
14.50,50870175659656525
150,51739394664764404
15.50,52594251185655594
160,53435432910919189
16.50,54263576120138168
170,55079269409179688
17.50,55883059930056334
180,56675451993942261
18.50,57456914708018303
190,58227890729904175
19.50,58988791191950440
200,59740000963211060
20.50,60482365638017654
210,61215728521347046
21.50,61940411105751991
220,62656712532043457
22.50,63364918157458305
230,64065295457839966
23.50,64758096635341644
240,65443563461303700
24.50,66121926903724670
250,66793400049209595
25.50,67458190023899078
260,68116492033004761
26.50,68768490850925446
270,69414365291595459
27.50,70054289698600769
280,70688420534133911
28.50,71316909790039062
290,71939909458160400
29.50,72557561099529266
300,73170000314712524
30.50,73474101722240448
310,73776948451995850
31.50,74078557640314102
320,74378942999999997
32.50,74678121099999994
330,74976103999999999
33.50,75272908699999996
340,75568550999999995
34.50,75863037799999999
350,76156383999999999
35.50,76448606500000005
360,76739716999999996
36.50,77029726600000004
370,77318650000000000
37.50,77606496199999997
380,77893274999999995
38.50,78179005499999998
390,78463696999999999
39.50,78747357799999995
400,79030001163482699