Page 1 of 1

DPS mechanics.

Posted: Tue 08 Apr, 2014 7:36 pm
by Helios
For as long as I've played, one thing I never got into the nitty-gritty of was Dps calculations and the various weapon mechanics. Wind-up/down, cooldown, reload frequencies and durations, things of that nature that are written down in the codex. Is there any one or a comprehensive guide that explains these? Before I would just look up dps numbers but after Kasrkins were added and I saw the various bonuses of weapons expertise I was confused how each bonus affects the weapon on a fundamental level. Yeah sure, it makes the weapon better but HOW? (Melta and lasgun bonus was obvious, you can ignore those). What do these stats do exactly?

Re: DPS mechanics.

Posted: Tue 08 Apr, 2014 9:13 pm
by Wise Windu

Code: Select all

if($reload_f == 0) $reload_f = 1;

if ($row['is_melee'] == 1) // If this is a melee weapon
     {
      $dps = $dmg_hp / ($windup + $winddown + $cooldown);
     }
elseif ($burst > 0) // If this is a ranged burst weapon
     {
      if ($row['is_missile'] == 1) // If it fires a missile but has burst for animation reasons, let's not fuck up DPS with burst formula
      {
        $dps = ($reload_f * $dmg_hp) / (($reload_f * ($windup + $winddown + $burst + $cooldown)) + $reload_d);
      }
else // Otherwise it's an actual burst weapon
      {
        $dps = ($reload_f * $burst * $dmg_hp) / (($reload_f * ($windup + $winddown +   $burst + $cooldown)) + $reload_d);
      }
     }
    elseif (($windup + $winddown + $cooldown) > 0) // Otherwise it must be a ranged single-shot weapon, but check for division by zero
     {
      $dps = ($reload_f * $dmg_hp) / (($reload_f * ($windup + $winddown + $cooldown)) + $reload_d);
     }
    else // Same, but replace that bit by 1 if it was 0
     {
      $dps = ($reload_f * $dmg_hp) / (($reload_f * 1) + $reload_d);
     }


The first part (if) is for melee weapons.

The second (the first elseif, with a sub-if and else) is for weapons with burst value.

The third (the second elseif) is for weapons without burst value, but with windup, winddown, or cooldown.

The fourth (else) is for anything else (hence the else : P).

reload_f + reload_d = reload frequency + reload duration

This is in the code Lulgrim wrote for the creation of the weapons pages in the Codex.

So here's the Kasrkin's grenade launchers as an example:

Not melee, no burst duration, but they do have windup+winddown+cooldown >0

So: DPS = (0 * 45) / (0 * ( .1 + .6 + 5) + 0); Clearly this equals zero, but the code also says to take reload frequency in this case to be 1 since you're just taking it to not be part of the equation. (see the top of the code)

So we have 45/5.7 = 7.89, which is what it says in the codex.

And then if you reduce the cooldown by 1, which is what Weapon Expertise does, you get 45/4.7 = 9.57 dps. -> 21.3% increase in dps

So there ya go.

Edit2: Plasma Guns for fun and procrastination: Not melee, no burst, so same equation: reload frequency is 6 to 8, so take the average (7)

DPS = (7 * 40) / (7 * (0 + .5 + 1.5) + 3) = 16.47 dps Whaddya know.

With the weapon expertise granting -30% reload time, since 3 * .7 = 2.1:

(7 * 40) / (7 * (0 + .5 + 1.5) + 2.1) = 17.39 dps -> 5.59% increase in dps

Edit: Whoa, I have a blue thing.

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 3:23 pm
by Helios
Can you explain what constitutes "burst" for a ranged weapon?

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 3:33 pm
by lolzarz
Helios wrote:Can you explain what constitutes "burst" for a ranged weapon?


That means firing multiple projectiles in a short period then reloading for a long time, if I remember correctly. For instance, Tankbustas fire a burst of 3 rockets per attack and Whirlwinds fire a burst of 4 missiles per attack.

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 3:35 pm
by Wise Windu
When a weapon takes more than one shot to do its damage. For example, a space marine bolter has a burst duration of 2, so it does its 25 health damage over 2 seconds instead of just being a 1 shot weapon like the grenade launchers, which deal their damage with only one grenade.

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 5:22 pm
by Helios
Got it. Now, I don't have any programming expertise so could you gimme an example for a burst weapon? Do Eldar DA have burst weapons for example?

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 5:31 pm
by Wise Windu
Sure. Here's the equation from the code: $dps = ($reload_f * $burst * $dmg_hp) / (($reload_f * ($windup + $winddown +   $burst + $cooldown)) + $reload_d);

So, the DA's shuriken catapult has reload frequency 6 - 8, so 7 average, 15 health damage, no wind up or wind down, 1 second cooldown, reload duration of 3, and a burst of 2 seconds. It isn't melee, and has a burst duration > 0. So:

DPS = (7 * 2 * 15)/((7 * (0 + 0 + 2 + 1) + 3) = 210/24 = 8.75

Edit: And actually, here's the Dark Reapers weapon since they have an ability that removes weapon reload duration and cooldown and decreases health damage by 30%. Same equation:

DPS = (7 * 2 * 28.5)/((7 * (0 + 0 + 2 + 1) + 3) = 210/24 = 16.625 ~ 16.63

When Pinning Fire is activated: 28.5 * .7 = 19.95

DPS = (7 * 2 * 19.95)/((7 * (0 + 0 + 2 + 0) + 0) = 19.95 dps -> 20% dps increase + suppression

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 6:00 pm
by Lulgrim
Wise Windu wrote:When a weapon takes more than one shot to do its damage. For example, a space marine bolter has a burst duration of 2, so it does its 25 health damage over 2 seconds instead of just being a 1 shot weapon like the grenade launchers, which deal their damage with only one grenade.

The base damage once for each second of burst, actually. E.g. 50 damage for the 2-second-burst for Tacs.

Re: DPS mechanics.

Posted: Wed 09 Apr, 2014 6:03 pm
by Wise Windu
Ah, okay. Thanks

Re: DPS mechanics.

Posted: Thu 10 Apr, 2014 4:15 am
by Broodwich
Wind up and wind down are the times before and after a melee hit where the dude is swinging his sword/whatever. Most melee don't have cooldown which is important since suppression only affects cooldown (x20) so melee dps isn't theoretically affected. Sluggas used to have their burnas I think have a cooldown so they were one of the only, if not the only, unit that had melee damage reduced by suppression. Auto cannons were buffed at some point to have a cooldown of 0 as well

Re: DPS mechanics.

Posted: Thu 10 Apr, 2014 6:21 pm
by Arbit
Broodwich wrote:Sluggas used to have their burnas I think have a cooldown so they were one of the only, if not the only, unit that had melee damage reduced by suppression.

Ha ha, I remember Relic's finest derp moment when a proposed changelog showed the cooldown had been removed from burna melee and everyone was like "this would give burna melee double damage... you adjusted their damage values so this won't happen RIGHT???" and Relic was like "oh PSH sure we checked that it's fine". I have made this image to commemorate that moment
Image

PS Wind up and wind down apply to some ranged weapons as well, like the SM pdev and lascannon

Also thanks everyone for the informative thread! This answers many questions I had as well.

Re: DPS mechanics.

Posted: Thu 10 Apr, 2014 7:50 pm
by Helios
I thought suppresion affected reload speed. In either case, what's the difference between cd and reload?

Re: DPS mechanics.

Posted: Thu 10 Apr, 2014 8:22 pm
by Wise Windu
Helios wrote:I thought suppresion affected reload speed. In either case, what's the difference between cd and reload?


Suppression multiplies cooldown by 20.

I believe cooldown is the time between attacks, so a weapon with 1 cooldown, the dark reapers' weapon for example, will have 1 second between the end of one burst attack and the beginning of another. Reload is much less frequent and takes much longer. Multiple cycles of cooldown and attack occur between the "bookends" of reloading, which in this case occurs on average every 7 seconds.

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 12:24 am
by Arbit
Am I correct in that reload frequency is actually the number of bursts fired before a reload is required? I have a notedpad here with some equations scribbled on it that seems to indicate that is does, but TBH it's been a long time since I cracked a calculus book.

If you plug larger values for $reload_f into the equation you come up with higher dps, which means the unit gets to take more shots before reloading. Conversely, if you decrease $reload_f, you get lower dps which indicates that the unit is spending more time reloading. You can also fiddle with the equation a bit so it reads

$dps = ($burst * $dmg_hp) / (($windup + $winddown + $burst + $cooldown) + ($reload_d/$reload_f)

I think that's equivalent to what is in the code. It generates the same numbers anyway, and it presents it a bit more intuitively... it basically reads

(damage)/((time required to make an attack)+(reload duration/reload frequency))

damage over time essentially

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 2:21 am
by Bahamut
Arbit wrote:$dps = ($burst * $dmg_hp) / (($windup + $winddown + $burst + $cooldown) + ($reload_d/$reload_f)



gotta multiply dmg and burst by reload frequency too to get the full damage it does over each reload cycle

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 2:51 am
by Wise Windu
No, if you multiply by reload_f/reload_f you get the same as the original equation, he just used algebra to simplify it.

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 4:11 am
by Bahamut
Wise Windu wrote:No, if you multiply by reload_f/reload_f you get the same as the original equation, he just used algebra to simplify it.


you dont xy =/= (x+y)

reload frequency tells you the ammount of bursts the weapon fires before reloading

for example tac bolter

burst duration 2
reload frequency average 7
reload time 3
damage_hp 25
cooldown 1

(25*2*7) / ((2+1)*7+3) = 14.583 dps per tac bolter

that formula is: (reload_freq*burst_dur*dmg_hp) / ((cooldown+windup/down+burst_dur)*reload_freq + reload dur)

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 4:46 am
by Wise Windu
Bahamut wrote:you dont xy =/= (x+y)


Well obviously.

Bahamut wrote:$dps = ($burst * $dmg_hp) / (($windup + $winddown + $burst + $cooldown) + ($reload_d/$reload_f)


multiply the top by reload_f -> ($burst * $dmg_hp * $reload_f)

multiply the denominator by reload_f -> ($reload_f*($windup + $winddown + $burst + $cooldown) + ($reload_d))

See? Same thing as the original, and since you're multiplying by reload_f/reload_f, you're effectively multiplying by 1. It's just an algebraic simplification.

You may have missed the reload_d/reload_f in the denominator.

Re: DPS mechanics.

Posted: Fri 11 Apr, 2014 5:14 am
by Bahamut
ya ya i saw it now