Difference between revisions of "Attack speed"

From CrawlWiki
Jump to: navigation, search
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Version012}}
+
{{Version014}}
  
When deciding between two different weapons, it can be helpful to understand exactly how attack speed works.  Weapon speed in crawl is measured in units of delay.  A character with a small attack delay will swing more frequently than a character with a high attack delay.
+
''See [[Weapon Speed]] for tables summarising this information.''
  
The base attack delay of a weapon is listed upon examination. For example, examining a handaxe shows that its speed is 130%.  To convert this to base delay, simply chop off the last zero.  So our handaxe has a base delay of 13.
+
When deciding between two different weapons, it can be helpful to understand exactly how attack speed works. Each physical attack in ''Crawl'' causes a certain amount of delay, which is the amount of time measured in [[aut]]s before you can act again. A character with a small attack delay will swing more frequently than a character with a large attack delay. As this greatly multiplies the damage you can inflict in combat, it is strongly recommended to get your attack delay as low as possible.
  
Having points in a weapon's associated skill will decrease this delay. Take your weapon skill and divide it by two, rounding down. Subtract the result from the weapon's base delay to determine your adjusted delay. So if you have a skill of 2 in axes, your handaxe would have an adjusted delay of 12.  As soon as you reach a skill of 4 in axes, the adjusted delay would decrease to 11.
+
==Base and adjusted attack delay==
 +
The base attack delay of a weapon is listed upon examination. For example, examining a [[hand axe]] shows that its speed is 130%. To convert this to base delay, simply chop off the last 0. Our hand axe has a base delay of 13, meaning it takes 13 auts to recover from your attack.
  
Now, weapons can't just keep getting faster and faster.  All weapons have a minimum delay.  Once reached, more weapon skill won't decrease the delay any further. To find out the minimum delay for a particular weapon, take the base delay, divide by two, and truncate the remainder.  So, our handaxe with a base delay of 13 has a minimum delay of 6. That means that our weapon skill can at most lop seven points off of the handaxe's base delay. Once you hit an axe skill of 14, that handaxe is going to be swinging as fast as it is going to get.
+
Having skill levels in a weapon's associated skill will decrease this delay. Take your weapon skill and divide it by two, rounding down. Subtract the result from the weapon's base delay to determine your adjusted delay. So if you have a skill of 2 in [[Axes]], your hand axe would have an adjusted delay of 12. As soon as you reached a skill of 4 in Axes, the adjusted delay would decrease to 11.
  
There are a couple of exceptions to the minimum delay calculation. First, if the weapon in question is a short blade and the calculated minimum delay is larger than five, then the minimum delay is adjusted to five. So that saber, even though it has a base delay of 12, has a minimum delay of 5 instead of 6.
+
==Minimum delay==
 +
Weapons can't just keep getting faster and faster. All weapons have a minimum delay. Once reached, gaining more weapon skill won't decrease the delay any further (but will still slightly improve your damage and accuracy). To find out the minimum delay for a particular weapon, take the base delay, divide it by two, and drop the remainder. So, our hand axe with a base delay of 13 has a minimum delay of 6. That means that our weapon skill can at most lop seven points off of the hand axe's base delay. Once you hit an Axe skill of 14, that hand axe is going to be swinging as fast as it is going to get.
  
The second exception is if the calculated minimum delay is larger than seven.  In such a case, the minimum delay is set to seven. This mostly happens with big two handed weapons.  Because of this exception, that executioner axe of yours with a base delay of 20 has a minimum delay of 7 instead of 10.
+
===Exceptions===
 +
There are a couple of exceptions to the minimum delay calculation. First, if the weapon in question is a short blade and the calculated minimum delay is larger than five, then the minimum delay is adjusted to five. As a result, even though [[cutlass]]es have a base delay of 12, their minimum delay is 5 instead of 6.
  
There is a hard-coded minimum player weapon delay of 3. If the calculated minimum delay is less than three it set to three.
+
The second exception is if the calculated minimum delay is larger than 7. In such a case, the minimum delay is set to 7. This mostly happens with big two handed weapons. Because of this exception, an [[executioner's axe]] with a base delay of 20 has a minimum delay of 7 instead of 10.
  
The speed brand comes into effect after the check against the minimum attack delay is done. A weapon with the speed brand can actually attack faster than the calculated minimum delay. The speed brand halves delay, rounding up. So a handaxe of speed, at an axe skill of 14, would hit at a delay of 3 instead of 6. An executioner axe of speed would hit at a delay of 4 instead of 7 at an axe skill of 26.
+
There is also a hard-coded minimum weapon delay of 3. If the calculated minimum delay is less than 3, it gets set to 3.
  
A shield can potentially add extra delay to your attacks. To calculate the delay added, you first need to know your adjusted shield penalty.  
+
The [[speed brand]] comes into effect after the check against the minimum attack delay is done. A weapon with the speed brand will attack faster than the calculated minimum delay. Attacks made with speed branded weapons take only 66% as long as normal. If a weapon's normal speed can't divide cleanly into thirds, then the speed of each attack will be rounded up or down to the nearest integer.
  
(adjusted shield penalty) = (base shield penalty) - (shield skill)/(racial divider)
+
[[Shields]] can potentially add extra delay to your attacks. To calculate the delay added, you first need to know your adjusted shield penalty:
  
The base shield penalty is 1/3/5 for bucklers/shields/large shields, and the racial divider is 3/5/7/9 for ogres/humans/kobolds/spriggans. Throw away any remainder on the division.  So a normal size race would have an adjusted shield penalty of 0 when wielding a buckler at shield skill 5, a medium shield at shield skill 15, and a large shield at shield skill 25.
+
  Adjusted Shield Penalty = Base Shield Penalty - ([[Shields skill]]/Racial Modifier)
  
If you are wielding a one handed weapon, two random integers are chosen between 1 and your adjusted shield penalty. The smaller one is used as the delay added by the shield. So your delay with a shield, on average, will be smaller when wielding a one handed weapon than when wielding a hand and a half weapon.  In either case though, once your adjusted shield penalty reaches zero there is no added delay.
+
The base shield penalty is 0.8/3/5 for [[buckler]]s/[[kite shield]]s/[[tower shield]]s, and the racial modifier is 3/5/7/9 for [[size|large/medium/small/little]] characters. Throw away any remainder on the division. So a medium size character would have an adjusted shield penalty of 0 when wielding a buckler at shield skill 4, a shield at shield skill 15, and a large shield at shield skill 25.
  
At this point, if the weapon delay plus the shield delay is less than three, it is set to three. There is no real way that this could happen though, as crawl is kind of funny like that. You'll never get something less than three out of the weapon delay calculation, since even a dagger of speed would spit out a delay of three.
+
After calculating your adjusted shield penalty, the game selects two random integers between 1 and your adjusted shield penalty. The smaller one is used as the delay added by the shield. Once your adjusted shield penalty reaches 0 there is no added delay.
  
So, now we have an adjusted speed, of our weapon, plus our shield. We aren't done yet. If we are slowed, this value is multiplied by 1.5.  If we are hasted or berserked, it is divided by 1.5.  If we are a statue, it is multiplied by 1.5.  Under finesse, it is divided by 2. The result of this calculation is an integer, but the rounding is randomized, weighted by the reminder.
+
At this point, if the weapon delay plus the shield delay is less than 3, it is set to 3, but this is something that never happens.
  
What does that mean, you ask?  Say you are wielding a demon whip, and have enough mace skill to reach the minimum delay of 5. You berserk. The berserk divider is 1.5, so your delay value is 3.333. Delays must be integer values though, so 2/3 of the time your delay will be rounded to 3, and 1/3 of the time your delay will be rounded to 4.  In effect, you get your delay of 3.333.
+
==Final modifiers==
 +
So, now we have an adjusted weapon delay after taking our weapon and shield into consideration. We aren't done yet. If [[slow]]ed or in [[Statue Form]], this value is multiplied by 1.5. If we are [[haste]]d or [[berserk]], it is divided by 1.5. Under [[Finesse]], it is divided by 2. The result of this calculation is an integer, but whether it is rounded up or down is randomized, weighted by the remainder.
  
The smallest delay you are allowed to swing with is two. If the calculation spits out a value less than two it is set to two. This can happen when you finesse with weapons that have an adjusted weapon delay of three, assuming no any extra delay introduced from a shield. For example, this could happen with quickblades, any short blade of speed, demon whips of speed, and so on.  That means that the speed bonus of finesse only works at partial effectiveness for attacks with these weapons.  Finesse will reduce the delay from 3 to 2, and not to an average of 1.5.
+
For example, say you are wielding a [[demon whip]], and have enough mace skill to reach the minimum delay of 5. You berserk. The berserk divider is 1.5, so your delay value is 3.333. Delays must be integer values though, so 2/3 of the time your delay will be rounded to 3, and 1/3 of the time your delay will be rounded to 4. In effect, you get your delay of 3.333.
  
The functions which calculate the delay can be found in fight.cc. See player_apply_attack_delay and its sub-functions.
+
The smallest delay you are allowed to swing with is 2. If the final calculation spits out a value less than 2, it is set to 2. That means that you only receive half the speed bonus of Finesse if your mindelay is already 3 (Bear in mind that this still results in a massive boost to damage output).
 +
 
 +
The functions which calculate the delay can be found in melee_attack.cc. See melee_attack::calc_attack_delay and its sub-functions.
 +
 
 +
http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/melee_attack.cc
  
http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/fight.cc
 
 
[[Category:Game mechanics]]
 
[[Category:Game mechanics]]

Revision as of 06:44, 9 July 2020

Version 0.14: This article may not be up to date for the latest stable release of Crawl.


See Weapon Speed for tables summarising this information.

When deciding between two different weapons, it can be helpful to understand exactly how attack speed works. Each physical attack in Crawl causes a certain amount of delay, which is the amount of time measured in auts before you can act again. A character with a small attack delay will swing more frequently than a character with a large attack delay. As this greatly multiplies the damage you can inflict in combat, it is strongly recommended to get your attack delay as low as possible.

Base and adjusted attack delay

The base attack delay of a weapon is listed upon examination. For example, examining a hand axe shows that its speed is 130%. To convert this to base delay, simply chop off the last 0. Our hand axe has a base delay of 13, meaning it takes 13 auts to recover from your attack.

Having skill levels in a weapon's associated skill will decrease this delay. Take your weapon skill and divide it by two, rounding down. Subtract the result from the weapon's base delay to determine your adjusted delay. So if you have a skill of 2 in Axes, your hand axe would have an adjusted delay of 12. As soon as you reached a skill of 4 in Axes, the adjusted delay would decrease to 11.

Minimum delay

Weapons can't just keep getting faster and faster. All weapons have a minimum delay. Once reached, gaining more weapon skill won't decrease the delay any further (but will still slightly improve your damage and accuracy). To find out the minimum delay for a particular weapon, take the base delay, divide it by two, and drop the remainder. So, our hand axe with a base delay of 13 has a minimum delay of 6. That means that our weapon skill can at most lop seven points off of the hand axe's base delay. Once you hit an Axe skill of 14, that hand axe is going to be swinging as fast as it is going to get.

Exceptions

There are a couple of exceptions to the minimum delay calculation. First, if the weapon in question is a short blade and the calculated minimum delay is larger than five, then the minimum delay is adjusted to five. As a result, even though cutlasses have a base delay of 12, their minimum delay is 5 instead of 6.

The second exception is if the calculated minimum delay is larger than 7. In such a case, the minimum delay is set to 7. This mostly happens with big two handed weapons. Because of this exception, an executioner's axe with a base delay of 20 has a minimum delay of 7 instead of 10.

There is also a hard-coded minimum weapon delay of 3. If the calculated minimum delay is less than 3, it gets set to 3.

The speed brand comes into effect after the check against the minimum attack delay is done. A weapon with the speed brand will attack faster than the calculated minimum delay. Attacks made with speed branded weapons take only 66% as long as normal. If a weapon's normal speed can't divide cleanly into thirds, then the speed of each attack will be rounded up or down to the nearest integer.

Shields can potentially add extra delay to your attacks. To calculate the delay added, you first need to know your adjusted shield penalty:

Adjusted Shield Penalty = Base Shield Penalty - (Shields skill/Racial Modifier)

The base shield penalty is 0.8/3/5 for bucklers/kite shields/tower shields, and the racial modifier is 3/5/7/9 for large/medium/small/little characters. Throw away any remainder on the division. So a medium size character would have an adjusted shield penalty of 0 when wielding a buckler at shield skill 4, a shield at shield skill 15, and a large shield at shield skill 25.

After calculating your adjusted shield penalty, the game selects two random integers between 1 and your adjusted shield penalty. The smaller one is used as the delay added by the shield. Once your adjusted shield penalty reaches 0 there is no added delay.

At this point, if the weapon delay plus the shield delay is less than 3, it is set to 3, but this is something that never happens.

Final modifiers

So, now we have an adjusted weapon delay after taking our weapon and shield into consideration. We aren't done yet. If slowed or in Statue Form, this value is multiplied by 1.5. If we are hasted or berserk, it is divided by 1.5. Under Finesse, it is divided by 2. The result of this calculation is an integer, but whether it is rounded up or down is randomized, weighted by the remainder.

For example, say you are wielding a demon whip, and have enough mace skill to reach the minimum delay of 5. You berserk. The berserk divider is 1.5, so your delay value is 3.333. Delays must be integer values though, so 2/3 of the time your delay will be rounded to 3, and 1/3 of the time your delay will be rounded to 4. In effect, you get your delay of 3.333.

The smallest delay you are allowed to swing with is 2. If the final calculation spits out a value less than 2, it is set to 2. That means that you only receive half the speed bonus of Finesse if your mindelay is already 3 (Bear in mind that this still results in a massive boost to damage output).

The functions which calculate the delay can be found in melee_attack.cc. See melee_attack::calc_attack_delay and its sub-functions.

http://git.develz.org/?p=crawl.git;a=blob;f=crawl-ref/source/melee_attack.cc