how is hitting calculated?
#1
Can anyone give me the maths for calculating hitting in combat? or maybe redirect me to a site that has this information? ;)
Reply
#2
Chance to Hit for Melee Attacks: 100 * AR / (AR + DR) * 2 * alvl / (alvl + dlvl)
acquired from the Arreat Summit

I was just using this information to determine some hypothetical hit percentages of monsters versus my ironbarb, this link may also be helpful:
Monster Information
USEast *ghost-70
Reply
#3
I've got it here:

http://www.hut.fi/~tgustafs/tohit.html

It's mostly correct, but I think I have omitted some details of item defense calculations (probably +1 here and there), so they may be off by a little. It's 1.09d, not 1.10 beta, btw.

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
#4
The tohit formula looks unchanged in 1.10, but the base AR calcs are different now, both for players and monsters.

players:

ar = (dex - 7) * 5 + tohit bonus + tohit factor

monsters:

ar = tohit bonus + 5 * dex + tohit base

Yea, the ar*4 is removed.
Reply
#5
Monsters have Dex in 1.10? They didn't before, did they?

- Dagni
Reply
#6
Hammerman,Jul 27 2003, 10:52 PM Wrote:ar = (dex - 7) * 5 + tohit bonus + tohit factor
Aha!

That is why I ended up with a value of 30 for TohitF :D

Splendid job, Hammerman!

Did you look by aby chance at the mechanics for Crushing Blow? (Asking in a hopeful tone)

Regards, Hunky
I am famous for my Memory - I have no Memory
Reply
#7
@Tommi:

I'm pretty sure your section on item defense is inaccurate, unless the defense values listed on items in the game are wrong.

By my observations, this is the way it's calculated:
- Take the min and max defense values from the armor.txt file.
- If there's any enhanced defense on the item itself (not sockets), set both min and max defense equal to the max defense + 1.
- If it's ethereal, multiply by 1.5, rounded down.
- Apply enhanced defense. It seemed that the ED from sockets was just added to the ED on the item itself, but ED based on clvl was applied separately. Due to the rounding, this just means defense is sometimes 1 less than if ED and ED based on clvl were just added together.
- Add the numerical defense boosts.

This is the way I'm calculating it with the armour defense calculator in my sig. I've done quite a bit of testing and the current calculations match my observations from the game. I have had to revise it a bit, though, and my experimentation methods were sometimes flawed. Preliminary tests showed no differences between 1.09 and 1.10. I've also done no tests with holy shield, as this is irrelevant for my calculator.

What I do know for certain is that, similar to the weapon damage calculations, the numerical defense is applied after the enhanced defense. The defense on Magefist should be enough to confirm this. They have 24-25, not 26-28.
Reply
#8
adeyke,Jul 28 2003, 09:33 PM Wrote:- Apply enhanced defense.  It seemed that the ED from sockets was just added to the ED on the item itself, but ED based on clvl was applied separately.
I remember vaguely that you have to calculate each socket seperately and add the truncated result to the total result.

I believe Diablo II LOD Guru Ruvanal mentioned this once.

Regards, Hunky
I am famous for my Memory - I have no Memory
Reply
#9
Zoulz,Jul 27 2003, 05:56 PM Wrote:Can anyone give me the maths for calculating hitting in combat? or maybe redirect me to a site that has this information?  ;)
I quote from this thread on the Amazon Basin :

Let us do a little math (for an Amazon) :

I assume that the actual formula was not changed in 1.10.
If Hell Cows in 1.10beta have around 1500 defense that assumption is right.

First we need to calculate our Attack Rating as follows :
(((Dexterity * 5) -7 - 23) + Sum of +X to AR items) * (1 + ((Sum of +% to AR items + percentage of Penetrate Skill) / 100)) (1)

Let us assume a level 70 Amazon with 300 Dexterity and no bonusses.

(300 * 5) - 7 - 23 = 1470 Attack Rating.

Now we need a suitable Monster like a Hell Cow which has level 81 and a Defense of 1500.

We can calculate the Chance to Hit a Hell Cow as follows :
200 * (AR / (AR + DR)) * (AL / (AL + DL))
AR is Attacker's Attack Rating
AL is Attacker's Level
DR is Defender's Defense Rating
DL is Defender's Level

Dexterity = 300
AL = 70
DR = 1500
DL =81
Attack Rating is ((300 * 5) - 30 = 1470
200 * (1470 / (1470 + 1500)) * (70 / (70 + 81))
1470 / (1470 + 1500) = 1470 / 2970 = 0.49
70 / (70 + 81) = 70 / 151 = 0.46
200 * 0.49 * 0.46 = 45% Chance to Hit

If we change nothing else but the Attacker's Level we get the following table :
Level 70 is 45% Chance to Hit
Level 75 is 47% Chance to hit
Level 80 is 48% Chance to Hit
Level 85 is 49% Chance to Hit
Level 90 is 50% Chance to Hit

If we use an Eth rune in the bow we will lower the Defense Rating that the Hell Cow has to :
1500 - (1500 * (25 / 100)) = 1125 Defense Rating

Once again an example at level 70
Dexterity = 300
AL = 70
DR = 1125
DL =81
Attack Rating is ((300 * 5) - 30 = 1470
200 * (1470 / (1470 + 1125)) * (70 / (70 + 81))
1470 / (1470 +1125) = 1470 / 2970 = 0.56
70 / (70 + 81) = 70 / 151 = 0.46
200 * 0.56 * 0.46 = 51% Chance to Hit

If we change nothing else but the Attacker's Level we get the following table :
Level 70 is 51% Chance to Hit
Level 75 is 53% Chance to hit
Level 80 is 54%Chance to Hit
Level 85 is 57 Chance to Hit
Level 90 is 58 Chance to Hit

I can't get the math to match the character screen 100% but it is very close.

I hope this helps you.

Regards, Hunky

(1) All math is unconfirmed, just an assumption I make as to how it works in 1.10
edit: and Hammerman confirmed on the LL that it looks that the To Hit formula is not changed in 1.10
and Hell Cows have 1000ish defense. So that changes the math a tad.
I am going to check if my Chance To Hit corresponds to all this in a game.
I am famous for my Memory - I have no Memory
Reply
#10
adeyke,Jul 28 2003, 09:33 PM Wrote:@Tommi:

I'm pretty sure your section on item defense is inaccurate, unless the defense values listed on items in the game are wrong.
Thanks, adeyke. I should have checked the correctness of all the formulas myself. I updated the page to reflect this info. It makes sense to calculate item defenses this way, although it differs from the way how AR and DR is calculated. It is similar to how weapon damage is calculated: first add percentage bonuses to base damage and then direct bonuses.

There is just one question which bugs my mind. What if there are both ED from superior quality and ED from magical properties (e.g. runes/rune word), do they add together +2 to the base item defense or just +1?

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
#11
AFAIK, it'd only get +1. The +1 thing occurs when the item is first generated, if it has ED on it (and items either have ED or they don't). If you add ED to it afterwards via sockets (including runewords), it'll already have a base defense and that's what will be used to calculate the new defense.

I will now do some more testing on how the ED from sockets stacks, though.

EDIT

I've confirmed my own calculations in 1.09. Just adding all the EDs (except the ED based on clvl) together gives the correct results.

I modded a unique cuirass (base 188-202 defense or 203 defense if it has ED) to have 50% ED and 3 sockets. I made recipes to spawn this and some Puls (30% ED). After inserting the Puls, I had these results:

0 Puls = 304 defense
1 Pul = 365 defense
2 Puls = 426 defense
3 Puls = 487 defense

These numbers match 203 + floor(203 * (.5 + .3 * numberofpuls)).

They do not match 203 + floor(203 * .5) + numberofpuls * floor(203 * .3). If it did, the values would be as follows:

0 Puls = 304 defense
1 Pul = 364 defense
2 Puls = 424 defense
3 Puls = 484 defense

I conclude that my assessment of all ED sources (except ED based on clvl) simply adding up does match empirical evidence from the game.
Reply
#12
Thanks again for testing. I put this info also there. I wonder why they have to do things differently with weapon damage and item defense. :huh: I think it must be also checked how it goes with percentage AR and DR modifiers. Wish that I could mod... :)

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
#13
The clvl-based defense and ED mods on armour do affect the listed defense on said armour. The defense listed on Duriel's Shell, for example, goes up as you gain levels. So the part that says "Other effects, such as +X to defense per character level, do not add to item defense but directly to defense (see defense rating)." may also be inaccurate.

When I had excluded the clvl-based ED, I had meant that this does get calculated and added separately from the other ED, but it is still calculated as item defense. I realize only now that the clvl-based ED isn't actually found on any legit, unmodded item :o.

I'm only a newbie at modding.

EDIT:

It also doesn't mention that if ED Modifier is 1, only the maximum value of Item Base Defense will be used, instead of a possible range of values.
Reply
#14
Quote:The clvl-based defense and ED mods on armour do affect the listed defense on said armour. The defense listed on Duriel's Shell, for example, goes up as you gain levels. So the part that says "Other effects, such as +X to defense per character level, do not add to item defense but directly to defense (see defense rating)." may also be inaccurate.
That paragraph follows from the discussion of Holy Shield not affecting Stormshield's +Defense/Clvl mod. Perhaps I should rephrase the paragraph that Holy Shield has a bug, that it does not affect +Defense/Clvl, and not say that +Defense/Clvl is included in the final defense calculation, because, as you said, the defense this property grants is shown on the item.

Quote:When I had excluded the clvl-based ED, I had meant that this does get calculated and added separately from the other ED, but it is still calculated as item defense. I realize only now that the clvl-based ED isn't actually found on any legit, unmodded item .
Yeah, it seems so.

Quote:It also doesn't mention that if ED Modifier is 1, only the maximum value of Item Base Defense will be used, instead of a possible range of values.
Ok. I'll add it in the near future.

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
#15
Good job Alexander,

:D

I guess they modified it for defense so it would not use the ethereal enhanced defense which would skyrocket the total defense if they calculated it seperately.


Regards, Hunky
I am famous for my Memory - I have no Memory
Reply
#16
Alright. I fixed a number of errors on the page.
- Item Defense is now calculated as adeyke mentions
- Holy Shield is now correctly noted as increasing the total defense of the shield, except for some modifiers.
- Fixed some mistakes in the short formulas

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)