Difference between revisions of "Attack speed"

From CrawlWiki
Jump to: navigation, search
(Major rewrite. Lots (maybe too much) information added. Still work to do.)
m (Example)
 
(36 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  {{Version028}}
+
{{version032}}
 +
''See [[Weapon Speed]] for tables summarising this information.''
 +
   
 +
'''Attack speed''' is how fast a player can attack with [[melee weapon]]s, [[ranged weapon]]s, or [[Unarmed Combat]].
 +
 
 +
Your attack speed is usually measured in the form of "'''attack delay'''". A normal action takes 1.0 [[decaAut]], or 10 [[aut]], of time. The more aut you take, the slower you act. So if you have a smaller attack delay, you will attack faster.
 +
 
 +
==Weapon Attack Delay==
 +
The following conditions are applied in order:
 +
===Base delay===
 +
All weapons, including [[ranged weapons]] and [[Throwing]] implements, have a base attack delay. When looking at the weapon in the ''''i''''nventory, you'll get the base attack delay (in decaAut). For example, a [[dagger]] has a base delay of 1.0 decaAut (10 aut).
 +
 
 +
The [[Weapon Speed]] page has a complete table of every weapon, in aut.
 +
 
 +
===Skill===
 +
For every 2 levels in the corresponding weapon [[skill]], your attack delay is reduced by 0.1 decaAut. There is a limit - every weapon has a '''minimum delay''', where skill cannot reduce attack speed any further.
 +
 
 +
A weapon's mindelay is usually the ''smaller'' of <code>base delay / 2</code> or 0.7 decaAut. For example, a [[dagger]] has a base delay of 1.0, so it has a mindelay of 0.5. A [[large rock]] has a base delay of 2.0, but its mindelay is still 0.7 decaAut. There are a few exceptions to this rule, such as [[rapier]]s and [[triple crossbow]]s.
 +
 
 +
Unarmed Combat works differently. For every 5.4 [[Unarmed Combat]] skill, attack delay is reduced by 0.1 decaAut.<ref>{{source ref|0.32.0|player-act.cc|333}}</ref> It otherwise works similarly to weapons.
  
''See [[Weapon Speed]] for tables summarising this information.''
+
===Brands===
''This page goes into great detail about attack delay calculations.''
+
Weapon [[brand]]s can modify speed, applied after accounting for skills.
 +
*The [[speed brand]] reduces your weapon delay by x66%.
 +
*The [[heavy]] brand increases your weapon's delay by +50%.
 +
 
 +
===Body Armour===
 +
If you are using a "[[Ranged Weapons|Ranged Weapon]]" (which does ''not'' include [[Throwing]] weapons), then [[body armour]] will slow down your attack speed (after brand). Body armour slows down attacks based on its [[encumbrance rating]].
 +
 
 +
The formula is <code>(encumbrance^2 / 2250) * (90 - 2 * [[Armour (skill)|armor_skill]]) / (3 + str)</code> decaAut.
 +
 
 +
Values for armour encumbrance can be found on the [[Armour]] page. Unlike shields, the penalty cannot be fully eliminated with skill.
 +
 
 +
===Shields===
 +
[[Shield]]s encumber their wielder, slowing down weapon speed (after brands are applied).
 +
 
 +
For EV penalty = <code>0.4 * encumbrance^2 / (5 + [[str]]) * (27 - [[Shields (skill)|sh_skill]]) / 27</code>, shields slow down attacks by <code>1d(EV Penalty) / 10</code> decaAut.<ref>{{source ref|0.32.0|player.cc|6163}}</ref><ref>{{source ref|0.32.0|player-act.cc|361}}</ref> If EV Penalty is not an integer, it is rounded in a weighted fashion before the dice function is rolled.
  
When deciding between two different weapons, it can be helpful to understand exactly how attack speed works. Each physical attack in ''Crawl'' takes a certain amount of time. A character with a smaller attack delay will swing more frequently than a character with a larger attack delay. This can greatly multiply how often you can inflict damage in combat. So it is strongly recommended to get your attack delay as low as possible.
+
The values for shield encumbrance can be found on the [[Shields]] page. The shield penalty can be reduced to zero with a maxed out shield skill of 27.
  
==Attack Delay Calculations for Weapons and Missles==
+
===Statuses===
*Note that [[strength]], [[dexterity]] and [[armour]] have no effect on attack delay.
+
*[[Haste]] (including from [[berserk]]) reduces all action delays by a factor of 2/3
===Base attack delay===
+
*[[Okawaru]]'s Finesse ability reduces weapon delay by half. This does ''not'' stack with haste.
All weapons, thrown objects, and launched objects have a base attack delay. You can find this information in game by examining the weapon or launcher. The base attack delay in game should be multiplied by 10 to give the delay in [[aut]]s. The [[Weapon Speed]] page has a complete tables and includes thrown objects. It also lists the base delay in [[aut]]s. For reference most species move and cast spells with a delay of 10 [[aut]]s.
+
*[[Statue Form]], [[Petrify]]ing, and [[Slow]]ness increase all delays by a factor of 3/2. These conditions do stack with haste and with each other.
===Minimum attack delay===
 
By raising your skill with the weapon or launcher you can reduce attack delays to the minimum attack delay. The minimum delay is usually 1/2 the base delay rounded down. If this is greater than 7 then the minimum attack delay is set to 7. There are three exceptions to this rule:
 
*[[Short blades]]: The rapier with a base delay of 12 has a minimum delay of 5.
 
*All [[Crossbows]] have a minimum delay of 10.
 
*The [[Woodcutter's axe]] always has a delay of 10 irregardless of skills.
 
===Skill adjustments===
 
Weapon, launcher, or throwing skills brings down the attack delay by <code>(skill level)/2</code> until you reach minimum weapon delay. Increasing your skill beyond that will not let you attack faster but it will slightly improve your damage and accuracy with the weapon. Normally you turn off your weapon skill when you hit minimum delay and dump experience points into increasing skills in other areas. The gods [[Ashenzari]] and [[Okawaru]] can increase your weapon skills and thus contribute to lowering your weapon delay.
 
===Speed Brand===
 
The [[speed (brand)|speed brand]] further reduces the delay to 2/3 of the skill adjusted delay.
 
With skill and speed brand improvements there is a hard coded minimum delay of 3.
 
===Shield Penalties===
 
[[Shields]] will slow down weapon speed. This slow down can be reduced by increasing your [[shields (skill)|shield skill]].
 
The detailed formula is <code>2*(shield encumberance)^2*(270-(10x shield skill))*scale/(5*(20-3*(size factor))/270</code>.
 
The values for shield encumberance and size factor can be found on the [[shields]] page. The scale used in this formula is 20. The game does display the [[Encumbrance rating|shield encumberance]] when describing the item, but it does not report the character size factor. Notice the shield penalty can be reduced to zero with a shield skill of 27.
 
===God Given Abilities===
 
The god [[Okawaru]]'s Finesse ability will further cut the delay in half. Note that this will not stack with haste nor berserk.
 
===Status modifiers===
 
*[[Potion of haste|Haste]] and [[berserk]] will further reduce the delay to 2/3 of its calculated value if you have not invoked Finesse. You cannot be both hasted and berserked.
 
*[[Statue Form]], [[Petrify]]ing, and [[Slow]]ness will increase the delay to 3/2 of the calculated value. These status conditions do stack with haste resulting in a net cancellation of the two different statuses. Slowness can stack with both statue form and petrifying.
 
*In no case, will the delay be reduced below 2.
 
  
==Unarmed Combat==
+
Finally, there is a hard limit of 0.1 decaAut, which no action can go under.
[[Unarmed combat]] has a different attack delay calculation. It is <code>10-(unarmed combat skill)/54</code>. You start with a delay of 10 with no unarmed combat skill and reach a minimum delay of 5 with an unarmed combat skill of 27. The shield penaties, god given abilities and status modifiers apply to unarmed combat as well.
 
  
 
==Spells==
 
==Spells==
Spells can be used for attacking and thus are included on this page. The base delay for casting a spell is 10. It can be modified by status modifiers but delay is not affected by skill, shields, or god abilities.
+
Spells can be used for attacking, and are thus included on this page. The vast majority of spells have a base delay of 1.0 decaAut. It can be modified by statuses (Haste, Statue Form, Slow...).
An exception to this is the spell [[Manifold Assault]]. The delay of casting manifold assault is the calculated weapon or unarmed combat delay.
+
 
 +
A few spells attack with your weapon:
 +
*[[Manifold Assault]] uses your attack delay exactly (following the above formulae).
 +
*[[Vhi's Electric Charge]] uses the larger of your attack delay and your [[movement speed|movement delay]].
 +
 
 +
Also, [[Sandblast]] is cast at 1.5 delay, instead of 1.0.
  
 
==Movement Based Attacks==
 
==Movement Based Attacks==
 
Some attacks are combined with movement. Even if the actual attack delay is not changed, they are mentioned here for completeness.
 
Some attacks are combined with movement. Even if the actual attack delay is not changed, they are mentioned here for completeness.
 +
 
===Martial Arts Attacks===
 
===Martial Arts Attacks===
The [[Wu Jian]] Council allows a player to make a number of different martial arts attacks. The number of attacks is based on the attack delay and the movement delay. The movement delay is:
+
The [[Wu Jian Council]] allows the player to make attacks based on movement.
*10 if you have invoked the serpent's lash ability, or
+
 
*twice your movement delay if you have invoked the wall jump ability. (The wall jump ability takes two turns.)
+
Under normal circumstances, movement takes the usual amount of time, and make attacks based on that time. For example, lets say you move at 1.0 decaAut. If you have a weapon delay of 0.7, you'll always perform 1 attack on a move (taking 0.7 / 1.0 of the time), and have a 3/7 (0.3 / 0.7) chance for a 2nd attack. As an extreme example, a [[Naga]] (1.4 move delay) with a [[quick blade]] (0.3 attack delay) would attack 4 times per move, with a 50% chance of a 5th attack.
*Otherwise your normal movement delay is used.
+
 
Your attack delay is the delay calculated in the previous sections. The number of attacks is the movement delay divided by the attack delay. If this is not an integer, the number of attacks could be rounded up or down. The number of attacks will average out to the non-integer number of attacks calculated. Extreme examples of the numbers of attacks would be a spriggan wielding a triple cross bow. With a movement delay of 6 and an attack delay of 23 the spriggan would only make one attack 6/23 of the time. The other extreme would be a naga wielding a quick blade with sufficient short blade skill. The naga's movement delay would be 14 and the weapon delay would be 3. For a wall jump which counts as two turns the expected number of attacks would be 28/3. So there could be 10 attacks 1/3 of the time.
+
Serpent's Lash treats your movement delay as 1.0 decaAut, regardless of your actual movement delay. Wall Jump counts as 2 actions, so doubles your movement delay.
*Note that the serpent's lash ability allows you to take two turns to make martial arts attacks without taking any time.
+
 
===Charging Attacks===
+
===Rampaging===
*The [[rampaging]] ego allows you to move towards a target and attack. The time taken is the attack delay and not the movement delay. Even a naga wielding a quick blade with sufficient [[short blade]] skill can move and attack a target with a delay of 3. Compare this with a naga's movement delay of 14.
+
The [[rampaging]] ego lets you take a free step before attacking. If you are 1 space from an enemy, you'll move instantly and then attack at your normal attack delay.
*A [[palentonga]]'s rolling charge allows you to move towards a target and attack. The time taken is the maximum of a movement delay or an attack delay.
 
===Bolt Attacks===
 
There are attacks that can hit multiple targets as you move through them like a bolt.
 
*[[Storm Form]] has the blink bolt ability to move through many targets at once doing damage to each.
 
*[[Uskayaw]]'s line pass ability has the same properties.
 
===Instintaneous attacks===
 
Some spells and abilities let you appear somewhere else and immediately make an attack without any delay.
 
*[[Passwall]] takes time to set up on one side of a rock wall. But you appear on the other side and can attack without targets being able to react to you first. This is different than blink which moves you to a new location and then you stay there for the turn delay.
 
  
 
==Detailed Calculations==
 
==Detailed Calculations==
The formulas above give you a very close approximation to the average attack delay. Most players can use the values above or the values on the [[weapon speed]] page without needing to know about the detailed calculations in this section.
+
The formulas above give you a very close approximation to the average attack delay. However, each individual attack can be subject to multiple sources of randomness:
===Averaging Fractional Delays===
+
 
Most calculations above can result in fractional delays. If you have a [[short sword]] with a base delay of 11 and a [[short blades|short blade skill]] of 5.7, the formula above would give you an average delay of <code>11-5.7/2 = 8.15</code>. The game mechanics give you an average delay by rolling a delay of 8 85% of the time and a delay of 9 15% of the time. This is needed because all delays are integer values of [[aut]]s.
+
*If your weapon delay (post-skill, post-brand) is in fractional [[aut]], then it is rounded in a weighted fashion. For example, if you "average" attack is at 5.1 aut (0.51 decaAut), then you have a 10% chance to attack at 6 aut, and 90% chance to attack at 5 aut.
===Using Statistical Random Variables===
+
 
The fractional delays do not give the entire story because each stage attack delay calculations involve creation of a new random variable. These random variables actually contain all possible integer delays and their weighted probabilities. This can result in a much wider range of attack delays than the averaging of fractional delays would imply. To complicate things, all calculations are done with a fixed precision.
+
*If you wear a [[shield]], the shield's penalty is also rounded in a weighted fashion. The EV penalty (<code>2/5 * encumbrance^2 / (5 + [[str]]) * (27 - [[Shields (skill)|sh_skill]]) / 27</code>) is calculated, then roudnd.
This is best explained by examples.
+
 
====Example 1====
+
*If you are using a [[ranged weapon]], then the penalty from [[body armour]] is also rounded in a weighted fashion, then added to delay.
Let's use the example of a [[human]] wielding a short sword and a buckler. The human has a [[short blade|short blade skill]] of 7.5 and a shield skill of 4. The [[buckler]]'s encumberance is 5. The human size factor is zero and can be found on the [[shields]] page. There are three random variabls used.
+
 
*The first is the base delay of the short sword of 11 [[aut]]
+
This can result in a wider range of attack delays than the averaging of fractional delays would imply.
*The second random variable encorporates the additional skill adjustment delay of -skill*10/scale = -75/20
+
 
*The third random variable encorporates the additional shield penalty delay of 8/20
+
===Example===
*The final probabilities: delay=7 47.4%, delay=8 47.4%, delay=9 5.3%
+
Take a human wielding a short sword and buckler. The human has a [[Short Blades]] skill of 7.5, [[Shields (skill)|Shields]] skill of 5.4, and [[strength]] of 15. The [[buckler]]'s encumbrance is 5.
 +
 
 +
*The short sword has a base delay of 11 aut, which is reduced to 7.25 aut from skill. -> (75% for 7 aut, 25% for 8 aut)
 +
*The shield gives a penalty of 1d(0.40) -> (40% chance of +1, 60% for +0).
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|- align="center"
 
|- align="center"
 
!
 
!
!colspan="8"|Delays|
+
!colspan="3"|Delays
|-
 
! Explaination !! 6 !! 7 !! 8 !! 9 !! 10 !! 11 !! 12 !! 13 !! Total Weight
 
 
|-
 
|-
|Base delay<br>short sword
+
! Source !! 7 !! 8 !! 9
|  ||  ||  ||  ||  || 1  ||  || || 1
 
 
|-
 
|-
|Subtract Skill reduction<br>7.5*scale/20
+
|Post-skill delay
|   || 15  || 5  ||  ||  ||    ||  ||  || 20
+
| 75% || 25% ||
 
|-
 
|-
|Add shield penalty<br>
+
|Shield penalty
2*(5)^2*(270-(10*4))*20<br>/(5*(20-3*(0))/270
+
| (75% * 60%) || (75% * 40%)<br>(25% * 60%) || (25% * 40%)
<br>=2300/270=8
 
|   || 15*12  || 15*8 + 5*12  || 5*8  ||  ||    ||  ||  ||
 
 
|-
 
|-
|Shield Penalty Weights
+
|Final
|   || 180 || 180  || 20  ||  ||    ||  ||  || 380
+
| 45% || 45% || 10%
 
|}
 
|}
*Note that there are three possible delays, not just two based upon one average
+
*A scale is used to create weights which avoids large integer division truncation inaccuracies
+
Average delay = 7.6 aut. Looking at the average alone, you may think that you can only swing at 7 (40%) or 8 (60%) aut. However, there are 3 possible delays - 7, 8, and 9 aut - as shown above.
*A random number from 0-380 is created and a delay is selected based upon which bin the number would fall into.
+
 
 +
==History==
 +
*Prior to [[0.31]], there was a hard minimum attack delay of 0.2 decaAut.
 +
*Prior to [[0.29]], body armour did not penalize [[Ranged Weapons]].
 +
*Prior to [[0.28]], the [[shield]] penalty formula was different. Certain skill thresholds (4 skill for buckler, 15 for kite shield, 25 for tower shield) negated it.
 +
*Prior to [[0.27]], the shield attack penalty was smaller (equal to the smaller of {1d(EV_penalty), 1d(EV_penalty)}).
 +
*Prior to [[0.16]], the amount of skill required to negate penalties for wearing a shield was more complex.
  
 
==References==
 
==References==
 
<references/>
 
<references/>
 
==History==
 
  
 
[[Category:Game mechanics]]
 
[[Category:Game mechanics]]

Latest revision as of 04:57, 26 September 2024

Version 0.32: This article is up to date for the latest stable release of Dungeon Crawl Stone Soup.

See Weapon Speed for tables summarising this information.

Attack speed is how fast a player can attack with melee weapons, ranged weapons, or Unarmed Combat.

Your attack speed is usually measured in the form of "attack delay". A normal action takes 1.0 decaAut, or 10 aut, of time. The more aut you take, the slower you act. So if you have a smaller attack delay, you will attack faster.

Weapon Attack Delay

The following conditions are applied in order:

Base delay

All weapons, including ranged weapons and Throwing implements, have a base attack delay. When looking at the weapon in the 'i'nventory, you'll get the base attack delay (in decaAut). For example, a dagger has a base delay of 1.0 decaAut (10 aut).

The Weapon Speed page has a complete table of every weapon, in aut.

Skill

For every 2 levels in the corresponding weapon skill, your attack delay is reduced by 0.1 decaAut. There is a limit - every weapon has a minimum delay, where skill cannot reduce attack speed any further.

A weapon's mindelay is usually the smaller of base delay / 2 or 0.7 decaAut. For example, a dagger has a base delay of 1.0, so it has a mindelay of 0.5. A large rock has a base delay of 2.0, but its mindelay is still 0.7 decaAut. There are a few exceptions to this rule, such as rapiers and triple crossbows.

Unarmed Combat works differently. For every 5.4 Unarmed Combat skill, attack delay is reduced by 0.1 decaAut.[1] It otherwise works similarly to weapons.

Brands

Weapon brands can modify speed, applied after accounting for skills.

  • The speed brand reduces your weapon delay by x66%.
  • The heavy brand increases your weapon's delay by +50%.

Body Armour

If you are using a "Ranged Weapon" (which does not include Throwing weapons), then body armour will slow down your attack speed (after brand). Body armour slows down attacks based on its encumbrance rating.

The formula is (encumbrance^2 / 2250) * (90 - 2 * armor_skill) / (3 + str) decaAut.

Values for armour encumbrance can be found on the Armour page. Unlike shields, the penalty cannot be fully eliminated with skill.

Shields

Shields encumber their wielder, slowing down weapon speed (after brands are applied).

For EV penalty = 0.4 * encumbrance^2 / (5 + str) * (27 - sh_skill) / 27, shields slow down attacks by 1d(EV Penalty) / 10 decaAut.[2][3] If EV Penalty is not an integer, it is rounded in a weighted fashion before the dice function is rolled.

The values for shield encumbrance can be found on the Shields page. The shield penalty can be reduced to zero with a maxed out shield skill of 27.

Statuses

  • Haste (including from berserk) reduces all action delays by a factor of 2/3
  • Okawaru's Finesse ability reduces weapon delay by half. This does not stack with haste.
  • Statue Form, Petrifying, and Slowness increase all delays by a factor of 3/2. These conditions do stack with haste and with each other.

Finally, there is a hard limit of 0.1 decaAut, which no action can go under.

Spells

Spells can be used for attacking, and are thus included on this page. The vast majority of spells have a base delay of 1.0 decaAut. It can be modified by statuses (Haste, Statue Form, Slow...).

A few spells attack with your weapon:

Also, Sandblast is cast at 1.5 delay, instead of 1.0.

Movement Based Attacks

Some attacks are combined with movement. Even if the actual attack delay is not changed, they are mentioned here for completeness.

Martial Arts Attacks

The Wu Jian Council allows the player to make attacks based on movement.

Under normal circumstances, movement takes the usual amount of time, and make attacks based on that time. For example, lets say you move at 1.0 decaAut. If you have a weapon delay of 0.7, you'll always perform 1 attack on a move (taking 0.7 / 1.0 of the time), and have a 3/7 (0.3 / 0.7) chance for a 2nd attack. As an extreme example, a Naga (1.4 move delay) with a quick blade (0.3 attack delay) would attack 4 times per move, with a 50% chance of a 5th attack.

Serpent's Lash treats your movement delay as 1.0 decaAut, regardless of your actual movement delay. Wall Jump counts as 2 actions, so doubles your movement delay.

Rampaging

The rampaging ego lets you take a free step before attacking. If you are 1 space from an enemy, you'll move instantly and then attack at your normal attack delay.

Detailed Calculations

The formulas above give you a very close approximation to the average attack delay. However, each individual attack can be subject to multiple sources of randomness:

  • If your weapon delay (post-skill, post-brand) is in fractional aut, then it is rounded in a weighted fashion. For example, if you "average" attack is at 5.1 aut (0.51 decaAut), then you have a 10% chance to attack at 6 aut, and 90% chance to attack at 5 aut.
  • If you wear a shield, the shield's penalty is also rounded in a weighted fashion. The EV penalty (2/5 * encumbrance^2 / (5 + str) * (27 - sh_skill) / 27) is calculated, then roudnd.
  • If you are using a ranged weapon, then the penalty from body armour is also rounded in a weighted fashion, then added to delay.

This can result in a wider range of attack delays than the averaging of fractional delays would imply.

Example

Take a human wielding a short sword and buckler. The human has a Short Blades skill of 7.5, Shields skill of 5.4, and strength of 15. The buckler's encumbrance is 5.

  • The short sword has a base delay of 11 aut, which is reduced to 7.25 aut from skill. -> (75% for 7 aut, 25% for 8 aut)
  • The shield gives a penalty of 1d(0.40) -> (40% chance of +1, 60% for +0).
Delays
Source 7 8 9
Post-skill delay 75% 25%
Shield penalty (75% * 60%) (75% * 40%)
(25% * 60%)
(25% * 40%)
Final 45% 45% 10%

Average delay = 7.6 aut. Looking at the average alone, you may think that you can only swing at 7 (40%) or 8 (60%) aut. However, there are 3 possible delays - 7, 8, and 9 aut - as shown above.

History

  • Prior to 0.31, there was a hard minimum attack delay of 0.2 decaAut.
  • Prior to 0.29, body armour did not penalize Ranged Weapons.
  • Prior to 0.28, the shield penalty formula was different. Certain skill thresholds (4 skill for buckler, 15 for kite shield, 25 for tower shield) negated it.
  • Prior to 0.27, the shield attack penalty was smaller (equal to the smaller of {1d(EV_penalty), 1d(EV_penalty)}).
  • Prior to 0.16, the amount of skill required to negate penalties for wearing a shield was more complex.

References