Original Post — Direct link

Questions Thread - January 29, 2020

This is a general question thread on January 29, 2020. You can find the previous question threads here.

Remember to check the Wiki first.

You can also ask questions in the #any-question channel in our official Discord.

The idea is for anyone to be able to ask anything related to PoE:

  • New player questions
  • Mechanics
  • Build Advice
  • League related questions
  • Trading
  • Endgame
  • Price checks
  • Etc.

No question is too big or too small!

We encourage experienced players to sort this thread by new. We'd like to thank those who answered questions in the last thread! You guys are the best.

External link →
over 4 years ago - /u/Mark_GGG - Direct link

Originally posted by hierox

I've been interested in making a community PoE tool that involves calculating the dps of a weapon (in addition to other features) based on the mods present. I've been running into an issue where the result I'm getting is nearly correct, but is off by a tenth of a dps or so whenever I test it. I've double checked my math but don't see anything - can anyone spot what is going wrong? Take this foil as an example: foil

Here is the math I've been using:

Base Jewelled foil stats

Min damage: 32

Max damage: 60

Attacks per second: 1.6

Stats from mods

Quality: 30%

Added min phys: 16

Added max phys: 30

Increased attack speed: 23%

Total % increased phys: 168%

Calculations

Total min damage = (32 + 16) * (100 + 168 + 30)/100 = 143.04

Total max damage = (60 + 30) * (100 + 168 + 30)/100 = 268.2

Total attacks per second = 1.6 * (100 + 23)/100 = 1.968

Total dps = 1.968 * (143.04 + 268.2)/2 = 404.66016

My result, 404.66 dps, is slightly off of what is shown on the website, which is 404.53 dps (from the image). Any idea where the issue is? I have tried multiple foils off of trade and they all have some sort of error around a couple tenths of dps.

Edit: it is worth noting that I have also tinkered with how the numbers are rounded at different stages of the calculations, and the method that gives the most accurate answer is actually no rounding at all.

The actual internal value on the weapon is an attack time of 625ms - the 1.6 base attacks per second is calculated from this.

Average damage per hit is (143+268)/2 = 205.5 Attack time is 625 / 1.23 = 508ms (rounded down to integer value) Attacks per second from that is 1000/508= 1.968..., rounded for display on item tooltip to 1.97

The displayed PDPS (which is not actually something the weapon has and isn't as meaningful a value as the importance some players put in it, but that's neither here nor there) appears to be calculated by 205.5 x 1.968... (neither value rounded) giving 404.52755..., which is rounded for display (and this value is only ever for display because it has no relevance to actual damage calculation), resulting in 404.53

I can't guaruntee that's the exact method used for this because I'm only familiar with the code for actually calculating damage dealt, which this isn't a part of, but it gets the correct value and I worked it out entirely based on how the weapon data works (weapons have an attack time in ms, not directly a floating-point attacks per second value), so seems likely to be correct. This does match how actual DPS for skills is calculated on skill popups, and more generally, how attack timing is calculated mechanically in the game.