GamePress

How to Calculate Comprehensive DPS

Article by bioweapon
How to Calculate Comprehensive DPS
Introduction

This article introduces the Comprehensive DPS model. The model takes into account of:

  • Energy gains from damage
  • Energy waste from overcharge
  • Edge cut off damage from fainting

when calculating a Pokemon's true DPS. Basing on Felix's work, this author has improved the model and applied it in various case studies:

Notation

We are given two input variables:

  • $x$: the energy left
  • $y$: the DPS of the enemy

And the following parameters from the Game Master file or calculated by the damage formula:

  • $FDmg$: the Damage per use of the fast move
  • $CDmg$: the Damage per use of the charge move
  • $FE$: the Energy gained per use of the fast move, positive
  • $CE$: the Energy used per use of the charge move, positive
  • $FDur$: the Duration of the fast move in seconds
  • $CDur$: the Duration of the charge move in seconds
  • $CDWS$: the Damage Window Start of the charge move in seconds
  • $Def$: the current Defense stat of the subject Pokemon
  • $HP$: the effective HP of the subject Pokemon

Our metrics of interest are:

  • $FDPS$: the DPS of a fast move, which equals to $\frac { FDmg }{ FDur } $
  • $FEPS$: the EPS of a fast move, which equals to $\frac { FE }{ FDur } $
  • $CDPS$: the DPS of a charge move, which equals to $\frac { CDmg }{ CDur } $
  • $CEPS$: the EPS of a charge move, which equals to $\frac { CE }{ CDur } $
  • $DPS_{0}$: the Simple Cycle DPS
  • $DPS$: the Comprehensive DPS

Formula
$$ DPS = DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (0.5 - \frac{ x }{ HP }) \cdot y $$ where $$ DPS_{0} = \frac { FDPS \cdot CEPS + CDPS \cdot FEPS }{ CEPS + FEPS } $$ Special adjustment for one-bar charge moves: $$ CEPS = \frac{ CE + 0.5 FE + 0.5 y \cdot CDWS }{ CDur } $$
DPS Theory

Derivation

Here I will prove the formula. Define the following variables:

  • $n$: the total number of fast moves used by the Pokemon in the battle
  • $m$: the total number of charge moves used by the Pokemon in the battle
  • $T$: the time of the battle

The first equation is the Time Equation :

$$ n \cdot FDur + m \cdot CDur = T $$

The second equation is the Energy Equation :

$$ n \cdot FE + 0.5 HP = m \cdot CE + x $$

Note: for one-bar moves, to account for overcharge, we adjust $CE$ treating it as if it requires more energy to fire one. The overcharge energy could result from either fast move overcharging (on average $0.5 FE$) or losing the energy from damage before your energy gets used (at $CDWS$):

$$ CE = CE + 0.5 FE + 0.5 y \cdot CDWS $$

Then we solve the above linear system for $n$ and $m$:

$$ n = \frac { T \cdot CE + CDur \cdot (x - 0.5 HP) }{ FDur \cdot CE + CDur \cdot FE } $$ $$ m = \frac { T \cdot FE - FDur \cdot (x - 0.5 HP) }{ FDur \cdot CE + CDur \cdot FE } $$

Last but not least:

$$ T = \frac { HP }{ y } $$

Finally, by the definition of DPS (total damage over time):

$$ DPS = \frac { n \cdot FDmg + m \cdot CDmg } { T } $$ $$ = ... $$ $$ = DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (0.5 - \frac{ x }{ HP }) \cdot y $$

Comprehensive DPS Axiom

The Comprehensive DPS Axiom is the following statement:

Comprehensive DPS must be no less than the Fast Move DPS and no greater than the Charge Move DPS.

In mathematical expression, it is:

$$ FDPS \le DPS \le CDPS $$

The Domain

The Comprehensive DPS Axiom can imply the domain of $DPS(x,y)$ as a function of $x$ and $y$. Recall that

$$ DPS(x, y) = DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (\frac{1}{2} - \frac{ x }{ HP }) \cdot y $$

For simplicity, let

$$ z = (0.5 - \frac{ x }{ HP }) \cdot y $$

Then the Comprehensive DPS formula can be rewritten in the Weighted Average Form:

$$ DPS = \frac{ FDPS \cdot (CEPS - z) + CDPS \cdot (FEPS + z) } { CEPS + FEPS } $$

The Weighted Average Form suggests that $DPS$ is the weighted average of $FDPS$ and $CDPS$ with the weights of $(CEPS - z)$ and $(FEPS + z)$ respectively. To satisfy the Comprehensive DPS Axiom, both weights must be non-negative:

$$ CEPS - z \ge 0 $$ $$ FEPS + z \ge 0 $$

which is then

$$ -FEPS \le z \le CEPS $$

This is the domain of $z$. In terms of $x$ and $y$, it is just $$ -FEPS \le (0.5 - \frac{ x }{ HP }) \cdot y \le CEPS $$

Along with the non-negative nature of $x$ and $y$: $x \ge 0, y \ge 0$, the domain of the $DPS(x,y)$ is defined.

Relationship with Simple Cycle DPS

How does the Comprehensive DPS introduced in this article ($DPS$) relate to the traditional Simple Cycle DPS ($DPS_{0}$)? Recall that:

$$ DPS = DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (0.5 - \frac{ x }{ HP }) \cdot y $$

Therefore, Comprehensive DPS is a generalization of Simple Cycle DPS. It can be expressed as a range while changing $x$ and $y$. Some important implications:

  • When $y = 0$ (i.e., there's no damage from enemy; the battle lasts infinitely long), $DPS = DPS_{0}$.
  • Another case where $DPS = DPS_{0}$ is $$ 0.5 - \frac{ x }{ HP } = 0 $$ or, $ x = 0.5 HP $. This means that the total wasted energy ($x$) exactly cancels out the total energy gained from taking damage ($0.5HP$), resulting the DPS the same as if there was no damage taken - which is just the Simple Cycle DPS.
  • The term $$ \frac{ CDPS - FDPS } { CEPS + FEPS } $$ is seen in some other DPS models which also consider energy from taking damage. We may name this term "Energy Efficiency" and denote it as $EE$. From the Comprehensive DPS Axiom, $CDPS > FDPS$, therefore $EE > 0$.
  • Since $y > 0$ and $EE > 0$, whether $DPS$ is greater than $DPS_{0}$ only depends on the sign of $ (0.5 HP - x) $:
    • When $x > 0.5 HP $ (i.e., there is more wasted energy than the total energy from damage), $DPS < DPS_{0}$
    • When $x < 0.5 HP $ (i.e., there is less wasted energy than the total energy from damage), $DPS > DPS_{0}$
Application

DPS Spreadsheet

When making a DPS spreadsheet, we want to compute the average value of $DPS(x,y)$ when $x$ and $y$ take different values. Assuming $x$ and $y$ are independent and all other terms don't depend on $x$ or $y$, We have:

$$ E[DPS(x,y)] = E[DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (0.5 - \frac{ x }{ HP }) \cdot y] $$ $$ = DPS_{0} + \frac{ CDPS - FDPS } { CEPS + FEPS } \cdot (0.5 - \frac{ E[x] }{ HP }) \cdot E[y] $$ $$ = DPS(E[x], E[y]) $$

Note: For multi-bar moves, "all other terms don't depend on $x$ or $y$" holds. For one-bar moves, however, since we apply punishment to $CE$, $CEPS$ depends on $y$. That said, the relative error is minimal. We will use the formula $E[DPS(x,y)] = DPS(E[x], E[y])$ for both one-bar and multi-bar moves.

Then the next question is to find $E[x]$ and $E[y]$. Basing on empirical simulation data, the following formulas are used in a neutral settings:

$$ \begin{cases} E[x] = 0.5 CE + 0.5 FE \\ E[y] = \frac { 900 } { Def } \end{cases} $$

In a more specific setting (when the enemy is specified), some more sophisticated formulas are used:

$$ \begin{cases} E[x] = 0.5 CE + 0.5 FE + 0.5 \frac{ \lambda \cdot FDmg_{enemy} + CDmg_{enemy} } { \lambda + 1 } \\ E[y] = \frac{ \lambda \cdot FDmg_{enemy} + CDmg_{enemy} } { \lambda \cdot (FDur_{enemy} + 2) + CDur_{enemy} + 2 } \end{cases} $$

where $\lambda$ is the total number of fast moves divided by the total number of charge moves of the enemy. It takes one of the three values:

  • $\lambda = 3$ for one-bar moves
  • $\lambda = 1.5$ for two-bar moves
  • $\lambda = 1$ for three-bar moves
Appendix
Quick Links
Rankings
Attackers Attackers Defenders Gym Defenders
ATK per type crown1 ATK per type (No Legendary)
Raids
Raid Boss ListRaid Boss List Solo Raid Raid Boss CountersRaid Boss Counters
Pokemon
Pokemon List Pokemon CP ListMax CP Region ExclusiveRegion Exclusive
ShinyShiny GrassNesting Legacy MovesLegacy
Tools
IV Calc Egg ListEgg List Breakpoint Calc
CP Calc RaidRaid IV Calc Appraisals
Power Up Cost Catch Rate Calc Type Chart
Guides
Guide Database Glossary Starter Guide