Weapon Damage Calculation
#21
Aha, thank you! That makes a lot of sense. I must also remember to put in my roundings in the correct places, which was my second problem (past the +1). :)
USEAST: Werewolf (94), Werebear (87), Hunter (85), Artimentalist (78), Meleementalist (76, ret.)
USEAST HCL: Huntermentalist (72), Werewolf (27)
Single Player HC: Werewolf (61, deceased), Werewolf (24)
Reply
#22
lemekim,Apr 1 2003, 04:36 AM Wrote:It seems that if the enhanced damage was not a part of the weapon prefix or suffix, the +1 stated in the guide does not get added when multiplying to get the final damage, even if you add a jewel or rune. So you formula will look actually like this:

[[(2-7) * (1.5)] * 1.25 + 1 max (superior bonus)] = 3-13

[] - rounded down

At least I think this is what happens... I seem to be very prone to confusion myself  :unsure:
Trying to put everything in one master equation is usually the downfall of most attempts at deriving formulas for the game. In the program many of the calculation were being handled over multiple lines of code and passing the results of one line of code to sometimes multiple different lines. A sequential series of equations can frequently yield better results, as this will match more closely what the game is doing internally.

If(ethereal)
{basedamage=basedamage*3/2} [i]integer calculations so there is truncation of any fractions, this will apply through out.

Calculate damage of enhanced damage modifiers that are part of the weapon (these would be prefix and/or suffix on the item OR if a runeword item, the superior ED% (if any) plus the runeword bonus, but not the runes themselves). This is where a +1 to base damage will be used if there are and ED% on the item itself.

Then if there are socketed items in the weapon loop through the socketed items and calculate the damage bonus of each ED% socketable item separately. There is not a +1 to basedamage on these calculations and each will have the truncation handled separately.

Then add damage the weapon to all the sub damages from the socketed items. For display of the weapon itself, only add the +min/max damage that is a part of the weapon or in the sockets. For passing the amount damage to the skill/stat damage step you would add +min/max damage from all items that are on the character.

Then the game will do the skill/stat damage modifications. All the attributes that contribute to this are summed before the calculation is done.

Then some of the special game effects would be handled, like the critical strike modification.

For the example weapon we would have
Ethereal? Yes,
Min damage = 2*3/2 = 3
Max damage = 7*3/2 = 10

First socketed item with +25% enhanced damage
Min damage = 3*25/100 = 0
Max damage = 10*25/100 = 2

And for the final damage showing on the weapon
Min damage = 3 + 0 = 3
Max damage = 10 + 2 + 1 = 13

Now if there had been two jewels socketed in the item, both with +25% Enhanced Damage, we would get
Ethereal? Yes,
Min damage = 2*3/2 = 3
Max damage = 7*3/2 = 10

First socketed item with +25% enhanced damage
Min damage = 3*25/100 = 0
Max damage = 10*25/100 = 2

Second socketed item with +25% enhanced damage
Min damage = 3*25/100 = 0
Max damage = 10*25/100 = 2

And for the final damage showing on the weapon
Min damage = 3 + 0 + 0 = 3
Max damage = 10 + 2 + 2 + 1 = 15
Which is what you would get if you actually had this item.

By the method that lemekim showed, the damage would have come out as 4 to 16; which is too high for what you would really get in the game.
Reply
#23
Ah, thank you as well, Ruvanal. :) As a prospective computer programmer myself, I really should have thought about that. That's why you're the expert, I guess. :D
USEAST: Werewolf (94), Werebear (87), Hunter (85), Artimentalist (78), Meleementalist (76, ret.)
USEAST HCL: Huntermentalist (72), Werewolf (27)
Single Player HC: Werewolf (61, deceased), Werewolf (24)
Reply
#24
Made another update to the page.
- Separated damage calculations into base damage, weapon damage, total damage and final damage steps
- Included correct truncations
- Fixed some minor errors

Cheers,

Tommi
Hammer of Atur
PvE/RP World of Warcraft Guild
Argent Dawn (European RP server), Alliance side

Dwarf Campaign
Awarded Custom Campaign for Warcraft III

Tommi's Diablo II information and guides
The de facto source of Diablo II game mechanics
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)