General Mechanics

To try and get everyone on the same page to begin with, let's talk a little about happens when you attack a monster.

First of all, the game has to determine which attack animation to use. This depends on both the attack you have selected and the weapon type you are using. Once the animation is chosen, the game uses the parameters of that animation to setup a counter. The data about the animation provides the terminating value, and increment value for the counter. This counter will be incremented every game frame and will run until the terminating value is reached. Once that terminating value is reached, the game looks for the next animation, resets the counter and terminating values and begins the next animation. There is always a next animation, by the way. The game has animation files for everything your character does. Walking, running, blocking, attacking, hit recovery, standing still , even your corpse when you die has an animation file.

That's a very brief and general description of what happens when you attack. The rest of this page will expand on that quite a bit. In pages that follow, I'll apply what we talk about on this page to specific attacks. If you've read this far and realized that you really have no interest in what I'm describing, bail out now. It gets worse before it gets better.

So, let's begin expanding on my brief description of an attack. We can divide that description into three parts.


    1. “First of all, the game has to determine which attack animation to use. This depends on both the attack you have selected and the weapon type you are using.”

    2. “Once the animation is chosen, the game uses the parameters of that animation to setup a counter. The data about the animation provides the terminating value, and increment value for this counter.”

    3. “This counter will be incremented every game frame and will run until the terminating value is reached. Once that terminating value is reached, the game looks for the next animation, resets the counter and terminating values and begins the next animation.”


We can shorten those up to this:


    1. Decide which animation

    2. Get the data on the animation

    3. Run the animation


Decide which animation


“First of all, the game has to determine which attack animation to use. This depends on both the attack you have selected and the weapon type you are using.”. Actually, it also depends on your character class, but since all we are talking about here are assassin animations I left that out. Think of this like the directory structure on your computer. We have a folder called "Assassin Animations". Inside of that folder would be a number of subfolders which list the animation types. Inside of every folder naming an animation type is a list of subfolders which list the usable weapons types for each animation type. Confusing maybe, but here's a list of animation and weapon types:


Animation types                Weapon types
A1 – Attack 1                  1HS - One Handed Swinging (axes, swords, flails, maces, hammers, clubs and wands)
A2 – Attack 2                  1HT - One Handed Thrusting/Throwing* (Daggers, javelins, potions)
BL – Blocking                  2HS - Two Handed Swords (swords)
GH – Get hit(hit recovery)     2HT - Two Handed Thrusting (All Spear class weapons)
DD - Death                     BOW – Bows (All Bow class weapons)
DT – Death Throe               HT1 - Single wielded katars (Katar, Claw, Scissors type assassin class weapons)
KK - Kick                      HT2 - Dual wielded katars (Katar, claw, scissors type assassin class weapons)
NU – Neutral(outside of town)  HTH - Hand to Hand (Bare fists)
RN - Run                       XBW – Crossbows (All Crossbow class weapons)
S1 – Skill 1                   STF - Two handed Swinging (Staves, polearms, axes, mauls)
S2 – Skill 2                   *Note that throwing axes are not in this weapon type, they are in the one handed swinging weapon type
S3 – Skill 3
S4 – Skill 4
SC – Spell casting
TH – Get Hit(in town)
TN – Neutral(in town)
TW – Walk(in town)
WL – Walk(outside of town)


Consider just the A1 animation type. Inside of that animation type we find folders for every weapon type and inside of each weapon type are files for all of the weapons which fit the description of that weapon type. If you are sitting there thinking that all the possible combinations of these animation and weapon types would make for a very large number of files, you'd be right. This game has a huge number of animation files and I haven't even listed all the types. There is also an animation type called “sequence”. A sequence animation can contain all or part of any of the combinations of the above listed types. An example of one of these sequence animations for assassins would be the Dragon Flight skill which uses parts of the SC (spell cast) animation and the KK (kick) animation. Sequence animations carry parameters all their own and don't use the parameters of the animations which make them up.


Get the data on the animation


Next in the brief description that began this came: “Once the animation is chosen, the game uses the parameters of that animation to setup a counter. The data about the animation provides the terminating value, and increment value for this counter.”. What are these parameters? Well, they are:

AnimationSpeed
DrawnFrames

Base


From these things we can setup the counter's terminating value and the increment value. Let's start with the terminating value. It is found with a very simple equation:

Terminating_value = 256 * DrawnFrames

Easy, isn't it? If DrawnFrames = 1, the terminating value equals 256. If DrawnFrames = 4, the terminating value equals 1024. Almost too simple! Don't worry, though. The means to figure the increment value makes up for this being so simple.

Firguring what this counter will be incremented by uses the formula you may or may not have already seen for attack speeds.

Increment = Animationspeed * (base + EIAS - penalty) / 100

Make sure you do the multiplication before the division in this equation, then drop whatever decimals you get from the division

Base in this equation depends on what animation type you are using. For all assassin animation types except blocking and hit recovery animations it will be 100. For blocking and hit recovery animations it is 50. The values for base are set in the game files and can't be affected by equipment. Also, the value for (base + EIAS - penalty) has an upper cap at 175 and a lower cap at 15. That's why attacks have a maximum speed. Once you get to the cap, it will not change your attack speed if you get more IAS, higher levels of BoS, or a weapon with a faster base speed. Lesser known is that there is a minimum attack speed for any given animation. For some reason not too many people seem to be interested in how slow they can make their attacks.

Penalty in this equation refers to an attack speed penalty that is given to some attacks. For the attacks which we will talk about, this is an attack speed penalty of 30 for sequence animations and and attack speed penalty of 40 for Dragon Tail. Why are these attacks penalized? Good question. I don't know. I just know that they are and we need to deal with them in our attack speed equations.



EIAS



EIAS stands for Effective Increased Attack Speed. Your amount of EIAS is found with this equation:

EIAS = skill_IAS – WSM +((120*equipment_IAS)/(120 + equipment_IAS))

Skill_IAS refers to the bonus given to attack speed by BoS or Fanaticism.This value is not affected by a diminishing returns formula as is equipment IAS. The value added by BoS is given in an equation listed in skillcalc.txt. The equation is as follows:

skill_IAS = ((110 * lvl) * (b-a))/((100 * (lvl +6)) + 15

Lvl in this equation refers to the level at which BoS is cast. The variables b and a are given in Skills.txt as the maximum and minimum increases and are 60 and 15. b=60 and a=15. You need to drop decimals from the results of this equation whenever you divide and also at the end of it. The results gotten from this equation differ from what is listed in the skill description in-game at severel points. Level 1 BoS and level 8 BoS are two of those points. I've yet to find where the error in my math is with this equation. I know it's my error as the values shown in the skill description are upheld in speed testing rather than the values gotten from this equation. Here's a chart of the skill_IAS granted by BoS at levels 1 through 30:

BoS level

Skill_IAS

BoS level

Skill_IAS

0

0

16

51

1

21

17

51

2

27

18

51

3

31

19

52

4

34

20

52

5

37

21

53

6

39

22

53

7

41

23

54

8

42

24

54

9

44

25

54

10

45

26

55

11

46

27

55

12

47

28

55

13

48

29

55

14

49

30

55

15

50





WSM stands for Weapon Speed Modifier. This is often referred to as the weapon's base speed. I feel that WSM is a much better description of what this value does. It directly modifies the EIAS value just as does skill_IAS. This number is subtracted in the equation above, that means that the lower this number is, the higher your EIAS value will be. A WSM of -30 would increase your EIAS by 30, ie if you had EIAS of 40 when using a 0 WSM weapon, you'd have an EIAS value of 70 if you switched to a -30 WSM weapon. Just for completeness's sake, if you had EIAS of 40 when using a 0 WSM weapon, you'd have and EIAS value of 30 if you switched to a 10 WSM weapon. This is another reason why I like referring to this value as the Weapon Speed Modifier instead of the base speed. It makes less sense to think of a base speed that is lower as being faster. Much more sense is made to me if we think of this as simply a modifier for our EIAS.

Equipment_IAS. This refers to the IAS modifier you may have on your equipment. This means all of your equipment, weapon included. The only exception for assassins is when using the cross-class skill Whirlwind. Whirlwind only counts the IAS on your weapon. When we get into discussing whirlwind in particular, we'll talk more on that. Equipment IAS includes all types of IAS modifiers whether we are talking about Shael runes, jewels of Fervor, or magical suffixes on the item. IAS which is located on your equipment has to go through a diminishing returns formula. It does not directly affect your EIAS value. That diminishing returns formula is what is listed as the last part of the EIAS formula, the part in parentheses:

((120 * equipment_IAS)/(120 + equipment_IAS))

When using this forumula to figure how much EIAS a given amount of IAS will add to your setup, you must use the total amount of IAS on your equipment. You can't just take the amount of IAS you plan on adding, convert it to EIAS, and add it to the EIAS total. I see this mistake being made all the time when converting IAS to EIAS. Let me explain it a little better by using an example.

Let's say you have a setup using a 0 WSM weapon, no BoS, and you have 40 IAS on your equipment. Right now, you would have an EIAS value of:

EIAS = skill_IAS – WSM + ((120 * equipment_IAS)/( 120 + equipment_IAS))
EIAS = 0 – 0 +((120 * 40)/(120 + 40))
EIAS = 4800 / 160
EIAS = 30

So, we start out with EIAS of 30. Let's say we want to add two Shael runes to our weapon. That's an additional 40 IAS. The mistake gets made when players try to just convet that 40 additional IAS to EIAS and then add it to the 30 EIAS we started with. If we do that, we'll figure that the extra 40 IAS will add 30 more EIAS to our setup giving us a total of 60 EIAS. The reality is different. Here's what the total for EIAS would actually be:

EIAS = skill_IAS – WSM + ((120 * equipment_IAS)/( 120 + equipment_IAS))
EIAS = 0 – 0 +(( 120 * 80)/(120 + 80))
EIAS = 9600 / 200
EIAS = 48

That's quite a difference! Remember, in order to convert IAS to EIAS you need to add all your sources of IAS together and convert them just once. They cannot be converted separately.

We can also derive from this equation a means of converting EIAS to IAS. The equation for doing so is:

IAS = (120*EIAS)/(120-EIAS)

With that equation, we can figure out how much IAS we need to hit the next breakpoint providing we know how much EIAS we currently have. Just subtract the EIAS you have from the EIAS needed to hit the breakpoint and run it through the equation. I used it heavily in creating the tables for this document.




Dual Wielding Claws

When dual wielding claws, both EIAS and equipment IAS becomes just a little more complicated so I gave this subject a little space of its own. First, you need to know which of your claws is the primary claw and which is the secondary claw. Normally, the claw that you equip first is your primary claw and the second claw you equip is the secondary claw. This changes if you equip the first claw on the right side of the inventory screen and then use the weapon switch feature to change to a different setup or die and go retrieve your body. When you switch back to the original setup, the claw on the left side of the inventory screen will become the primary as the game defaults to this. Going strictly off of this it may seem as if I'm saying that you should always equip your first claw in the inventory-left position. This is not always true. There is a bug (imo) with dual wielding weapons which could make equipping the first claw in the inventory-right position advantageous. Knowing which of your claws is primary is important. Please read back through that if you are not sure of what it says.

The bug with dual wielding claws occurs with figuring your WSM for a dual wield setup. For all attacks except the normal attack, when you dual wield claws, you not use the WSM of one of your weapons directly. Instead, you'll use a combinations of the WSMs of the two weapons. What that combination is depends on which of your claws is primary. Here's a screenshot showing which claw I mean when I refer to inventory-left and inventory-right:


This is a partial shot of the inventory screen.

If the inventory-left claw is equipped first, your WSM for figuring your EIAS will be the average of the WSMs of the two weapons. For example, when using a claw with a WSM of -30 and equipping it first in the inventory-left position and using a 10 WSM claw and equipping it second in the inventory-right position, the WSM you would use for figuring you EIAS would be -10 (the average of -30 and 10). If you take those same two claws and equip the -30 WSM claw first and in the inventory-right position with the 10 WSM claw second and in the inventory-left position, the WSM for figuring your EIAS would be -50, much faster! Why? Well, when equipping the inventory-right claw first, the WSMs are not just averaged, instead they are averaged and then the difference between the two is added to that average. The equation looks like this:

(inventory_right_WSM + inventory_left_WSM)/2 + (inventory_right_WSM – inventory_left_WSM)

Getting messy, isn't it? Here's the numbers ran through that equation:

(-30 + 10)/2 +(-30 – 10)
(-20)/2 + (-40)
(-10) + (-40)
-50

Just for kicks, let's run the numbers once again, but this time we'll equip the 10 WSM claw first and in the inventory-right position and the -30 WSM claw second and in the inventory_left position.

(inventory_right_WSM + inventory_left_WSM)/2 + (inventory_right_WSM – inventory_left_WSM)
(10+ (-30)) / 2 + (10 - (-30))
(-20) / 2 + (40)
(-10) + 40
30

Wow, much slower than the average. So, we can state a couple of things about equipping the inventory- right claw first:

1.If you equip a lower WSM claw first, you will end up with lower WSM than the average.
2.If you equip a higher WSM claw first, you will end up with a higher WSM than the average.
3.The greater the difference between the WSMs of the two claws, the larger the effect of this bug.
4.If you weapon switch, you will have to open the inventory screen up and reset your claws in order to retain the benefits of using this bug.

Here is a table listing the values you would get for WSM when equipping various WSM claws in the inventory-right position first.

It is completely up to you if you want to take advantage of this bug, personally I think it's too much of a hassle to deal with for the results.

The effect of dual wielding claws on IAS is much simpler. Only the IAS on your primary claw will affect your attack speed. Just that. Nothing more. Like I said, it's much simpler.


Run the animation


Finally in the brief description that began this was this: “This counter will be incremented every game frame and will run until the terminating value is reached. Once that terminating value is reached, the game looks for the next animation, resets the counter and terminating values and begins the next animation.”. Before I get into anything else in this , I need to talk about the usage of the word “frames”. When dealing with animations and attack speeds, this word is used in two different ways.

1. It's used in reference to the individual still images which make up the animations. The parameter DrawnFrames is acutally the count of how many of these still images the game has access to in order to make up a given animation. For instance, here is an animation pulled from the game files. It's a kick animation with dual claws equipped. I've slowed it down considerably so you can see and count all 13 still images which make up this animation.



Most generally, whenever I used the word frames with this meaning in mind I will say Aframes.

2. It's also used as a measure of time. Diablo 2 runs at 25 frames per second. This means that the game updates your screen 25 times every second or once every .04 seconds. This cannot be changed. If you use the “/fps” command in game, you might see that it lists a frames per second value higher than 25. That just means that your system is capable of more updates, not that you are getting more updates from the server. The 25 frames per second speed is in the programming and cannot be changed. This is actually a good thing. It gives us a constant base from which to work. When you see a statement that an attack has a speed of 7 frames per attack, it means that the attack takes 7 of these updates to complete. In the end, any document focused on attack speeds is really about how to increase and decrease how many of these updates it takes to complete an attack. Most documents or posts which deal with animation information use the word “ticks” (as in tick-tock goes the clock) when referring to frames with this meaning in mind. I'll stick to that in these posts as it seems to me to be very easy to remember the association.

I also want to mention that from this point on, I will just refer to EIAS. I am not going to revisit any of the explanations on how it is figured. If you don't understand the difference between EIAS and IAS or how WSMs and BoS are figured into to it, or even how dual wielding claws affects EIAS, then I will just direct you back to the Get the animation data section of this page. I do that for a reason. All of that is confusing enough without spreading it all throughout these pages. I felt it would be better to just deal with it in one place and move on.

Speaking of moving on, it's time I did just that. I've talked a lot about this counter, but what is its purpose? Is it solely a means to let the game know when to end an attack animation? No. The counter also tells the game which Aframe of an animation it should show. That might require a bit more of an explanation.

I mentioned above that the parameter DrawnFrames is actually the count of how many still images the game has access to in order to display a given animation. Which one of these is shown depends on the value of the counter. Look again at the equation for figuring the terminating value of the counter:

terminating_value = 256 * DrawnFrames

Say we have an animation with a DrawnFrames = 5. That would give us a terminating value of 1280. We have 5 possible still images that can be shown. That leaves us with 5 counter ranges for determining which one is actually displayed. These ranges would be:

0-255
256-511
512-767
768-1023
1023-1279

Notice these ranges all have 256 different counter values in them. The value of 1280 isn't included in this list because once the counter hits that value, the animation is over! The Aframes which make up an animation are numbered from 0, not 1. So, going from the list of ranges above we can say that if the counter's value is 0-255, Aframe 00 is shown. If the value is 256-511, Aframe 01 is shown. Here is a list of counter value ranges and the Aframe which is shown at those ranges:

Code:

Counter value     AFrame displayed     Counter value    AFrame displayed
0 - 255                 00              3328 - 3583           13
256 - 511               01              3584 - 3839           14
512 - 767               02              3840 - 4095           15
768 - 1023              03              4096 - 4351           16
1024 - 1279             04              4352 - 4607           17
1280 - 1535             05              4608 - 4863           18
1536 - 1791             06              4864 - 5119           19
1792 - 2047             07              5120 - 5375           20
2048 - 2303             08              5376 - 5631           21
2304 - 2559             09              5632 - 5887           22
2560 - 2815             10              5888 - 6143           23
2816 - 3071             11              6144 - 6399           24
3072 - 3327             12 


What this means is that if we know the value of the counter at any given point, we can determine which Aframe is being displayed by dividing the counter value by 256 and dropping any decimals. For example, if the counter has a value of 3456, we can just divide that by 256 to come up with 13.5, drop the decimal and we know that Aframe 13 is being shown. I prefer just looking it up on my chart.

Now we have the information needed to run through an attack animation. We'll stick to using our hypothetical attack with 5 drawn frames. We'll add an animation speed of 256, 0 EIAS, and a base of 100 and no speed penalty.
So, we click the mouse button. The game looks up the animation which fits our class, attack, and weapon setup. The parameters for the attack are:

AnimationSpeed = 256
DrawnFrames = 5 ( this means we have 5 Aframes numbered from 00 to 04)
base = 100
EIAS = 0

The terminating value is figured using: Terminating_value = 256* DrawnFrames = 256*5 = 1280

The increment is calculated using: Increment = AnimationSpeed * (base + EIAS-penalty) / 100 = 256*(100 + 0-0) / 100=256*100/100 = 256

The counter is reset to 0

Now, the animation begins.

Game tick 1
the counter is incremented, counter now equals 256
is the counter >=1280? no animation continues
Aframe 01 is displayed (check the chart from above, counter value of 256-511 means frame 01)

Game tick 2
the counter is incremented, counter now equals 512
is the counter >=1280? no
Aframe 02 is displayed

Game tick 3
the counter is incremented, counter now equals 768
is the counter >= 1280? no
Aframe 03 is displayed

Game tick 4
the counter is incremented, counter now equals 1024
is the counter >= 1280? no
Aframe 04 is displayed

Game tick 5
the counter is incremented, counter now equals 1280
is the counter >=1280? YES
Animation over, look up data for next animation, figure terminating and increment values, reset counter and begin the animation ON THIS TICK.

Game tick 5 becomes the first tick of the next animation. That means that our hypothetical animation started and showed it's last Aframe in 4 ticks. Game tick 5 became the first tick of the next animation and is not counted towards the speed of our hypothetical one. The speed of our animation with 0 EIAS is 4 fpa. Make a big note that frame 00 was never displayed. If the increment value equals 256 or more, frame 00 will never be displayed. That holds true of all animations.

This was a pretty simplistic example. Let's alter a few things and see what happens. We'll run three more of these side by side for comparison. Everything will stay the same except the EIAS values will be varied. We'll use -1 EIAS, 24 EIAS, and 25 EIAS. (Odd choices? Methinks I chose them for a reason. )

Our terminating value stays the same, 1280.

The increments will be different.
For the -1 EIAS example, the increment value will be: 256*(100 + (-1)) / 100 = 256*99/100 = 253
For the 24 EIAS example, the increment value will be: 256*(100+24)/100 = 256*124/100 = 317
For the 25 EIAS example, the increment value will be: 256*(100+25)/100 = 256*125/100 = 320

The animation begins.

Game tick 1
-1 EIAS example has counter value of 253 and displays Aframe 00
24 EIAS example has counter value of 317 and displays Aframe 01
25 EIAS example has counter value of 320 and displays Aframe 01

Game tick 2
-1 EIAS example has counter value of 506 and displays Aframe 01
24 EIAS example has counter value of 634 and displays Aframe 02
25 EIAS example has counter value of 640 and displays Aframe 02

Game tick 3
-1 EIAS example has counter value of 751 and displays Aframe 02
24 EIAS example has counter value of 951 and displays Aframe 03
25 EIAS example has counter value of 960 and displays Aframe 03

Game tick 4
-1 EIAS example has counter value of 1012 and displays Aframe 03
24 EIAS example has counter value of 1268 and displays Aframe 04
25 EIAS example has counter value of 1280 and animation is over

Game tick 5
-1 EIAS example has counter value of 1265 and displays Aframe 04
24 EIAS example has counter value of 1585 and animation is over

Game tick 6
-1 EIAS example has counter value of 1518 and animation is over

I chose those EIAS values for a reason. They are breakpoints for our hypothetical example. We already knew how the 0 EIAS value played out, it took 4 ticks to show the animation. The -1 EIAS value took 5 ticks to show the animation. So, the breakpoint between 4 and 5 ticks for this animation happens when going from -1 EIAS to 0 EIAS.

The 24 EIAS example took 4 ticks to complete just as did the 0 EIAS example. The 25 EIAS example only took 3 ticks to show the animation. Thus, the breakpoint between 3 and 4 ticks for this animation happens when going from 24 to 25 EIAS. If you have an EIAS value anywhere between 0 and 24 EIAS, the speed for this animation will be 4 ticks.

That is exactly how the EIAS tables I post work. The IAS/BoS tables i post don't work to figure anything but maximum attack speeds. They don't let you know what EIAS levels you need for any speed other than the maximum. I know many people struggle with reading them. Personally, I find the EIAS tables to be much more useful to me. I will manually figure my EIAS amounts and then just use those tables.

“But Jrichard, you post forumulas so often that we are sick of seeing your name on posts. Surely there is a formula to tell me my attack speed without having to look it up on a table?” Indeed there is! This has been the intended result of this general mechanics page, to allow me to post this following forumula:

fpa = {(256*DrawnFrames) / [(AnimationSpeed*(base + EIAS-penalty)/100)]}-1
{} indicates using a ceiling function
[ ] indicates using a floor function

Basically, divide our terminating value by our increment value and subtract one. The floor function means to drop any decimals you get when figuring the increment value and the ceiling function means to round to the next highest integer unless the result divides evenly to an integer already.



Sequence Animations

Of course nothing is ever that easy, something somewhere has to complicate matters. In this case, it will be sequence animations which screw with that last formula. It's not that complicated really. If we are dealing with a sequence animation, the formula is altered to this:

fpa = {(256*DrawnFrames)/[(AnimationSpeed*(base+EIAS-penalty)/100)]}

Sequence carry an attack speed penalty of 30, remember. The bigger thing to notice about this version of the equation is the lack of a “-1” at the end of it. This is the only way I've been able to get this equation to work out correctly for sequence animations. I suspect that rather than checking the terminating value before the Aframe is shown, sequence animations check it after. That would mean that on the tick where the counter hits the terminating value an Aframe is shown and the next animation can't start until the following tick unlike regular animations which start the next animation on the same tick on which the counter hits the terminating value. Just a theory on my part. It really doesn't matter, I guess. What's important is that if you want to be able to figure the speeds of attacks which use sequence animations, you need to drop the subraction of 1 at the end of the equation.



With that, we have a foundation laid to began talking about the skills in specific. Here's a link back to the table of contents so you can begin where ever you want with the skills.

100 MB free hosting. Click here to build your own free site.