Difference between revisions of "Strength weight"

From CrawlWiki
Jump to: navigation, search
(Attribute -> game mechanic. Added appropriate category)
(added formulas. dived and referenced the convoluted source. then did some algebra to get the formulas in a hopefully more palatable form (doesn't this wiki need Tex?) I leave it to other editors to decide whether this is horribly overdone or inaccurate)
Line 1: Line 1:
{{stub}}
 
 
Generally in Crawl, heavier weapons benefit more from [[strength]] than from [[dexterity]], and also tend to require more strength to use properly. '''Strength weighting''' (abbreviated "str weight") is a game mechanic that determines relatively how much a character's strength and dexterity affect a given weapon's damage output.
 
Generally in Crawl, heavier weapons benefit more from [[strength]] than from [[dexterity]], and also tend to require more strength to use properly. '''Strength weighting''' (abbreviated "str weight") is a game mechanic that determines relatively how much a character's strength and dexterity affect a given weapon's damage output.
  
Line 5: Line 4:
  
 
Almost all weapons fall somewhere in-between the two extremes. The weighted average of strength and dexterity affects both damage potential and [[to-hit]], the former being affected more by strength and the latter being affected more by dexterity. Thus, note that that even 0% and 100% strength weightings don't imply that either stat has no effect: more dexterity always implies better to-hit and more strength always implies higher per-hit damage. A 50% str weight still implies that dexterity has a bigger effect than strength on to-hit, and conversely with strength and damage.
 
Almost all weapons fall somewhere in-between the two extremes. The weighted average of strength and dexterity affects both damage potential and [[to-hit]], the former being affected more by strength and the latter being affected more by dexterity. Thus, note that that even 0% and 100% strength weightings don't imply that either stat has no effect: more dexterity always implies better to-hit and more strength always implies higher per-hit damage. A 50% str weight still implies that dexterity has a bigger effect than strength on to-hit, and conversely with strength and damage.
 +
 +
== Formulas and source ==
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/itemprop.cc#L163 In the source]
 +
strength weight fractions are represented by integers from 0 to 10, representing 0% to 100% respectively. In the formulas below, '''W''' denotes strength weight as a fraction, ie. W=0.0 for quickblade and W=1.0 for giant club.
 +
=== Melee ===
 +
In the 0.12 source, melee damage is calculated a bit differently for
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/melee_attack.cc#L5274 monsters]
 +
and player characters. Player damage potential is
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/melee_attack.cc#L5367 based on weapon base damage] and, among other things,
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/melee_attack.cc#L1606 amplified by a stat value]
 +
which is taken as a
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/melee_attack.cc#L5494 blend between the player's Str and Dex]:
 +
 +
<tt>'''Melee damage blended stat''' = 0.5×Str + 0.5(W×Str + (1-W)Dex)</tt>
 +
 +
Stats are blended [https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/melee_attack.cc#L5149 similiarly for to-hit]
 +
but conversely to damage calculations, dexterity counts twice as heavily towards to-hit as strength does:
 +
 +
<tt>'''Melee to-hit blended stat''' = 0.5×Dex + 0.5(W×Str + (1-W)Dex)</tt>
 +
 +
=== Launchers ===
 +
The [https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/throw.cc#L1346 code for player-fired missile]
 +
damage and to hit is even harder to decypher than for melee weapons. Strength and dexterity
 +
[https://gitorious.org/crawl/crawl/source/3fb7fd9f23f7f93a1e85b39c3ba46f27e91505f3:crawl-ref/source/throw.cc#L545 primarily affect]
 +
the launcher "speed". "Speed" is a misnomer though: it means the amount of in-game time taken to fire a shot, not the rate at which shots are fired. Roughly:
 +
 +
<tt>'''Turns taken''' = ( launcher_base_attack_delay_percentile - player_skill×(W×Str + (W-1)×Dex)×4/25 ) / 100</tt>
  
 
[[Category:Game mechanics]]
 
[[Category:Game mechanics]]

Revision as of 18:06, 17 September 2013

Generally in Crawl, heavier weapons benefit more from strength than from dexterity, and also tend to require more strength to use properly. Strength weighting (abbreviated "str weight") is a game mechanic that determines relatively how much a character's strength and dexterity affect a given weapon's damage output.

A given str weight value can be viewed as a quotient expressed as a percentage; the "amount of effect" that strength has on a weapon, divided by the total amount of effect that strength and dexterity together have on it. So a str weight of 100% (such as with a giant club) implies that strength is all that really matters when using it. Conversely, 0% (eg. quick blade) implies that strength has a very small effect on how well a weapon performs.

Almost all weapons fall somewhere in-between the two extremes. The weighted average of strength and dexterity affects both damage potential and to-hit, the former being affected more by strength and the latter being affected more by dexterity. Thus, note that that even 0% and 100% strength weightings don't imply that either stat has no effect: more dexterity always implies better to-hit and more strength always implies higher per-hit damage. A 50% str weight still implies that dexterity has a bigger effect than strength on to-hit, and conversely with strength and damage.

Formulas and source

In the source strength weight fractions are represented by integers from 0 to 10, representing 0% to 100% respectively. In the formulas below, W denotes strength weight as a fraction, ie. W=0.0 for quickblade and W=1.0 for giant club.

Melee

In the 0.12 source, melee damage is calculated a bit differently for monsters and player characters. Player damage potential is based on weapon base damage and, among other things, amplified by a stat value which is taken as a blend between the player's Str and Dex:

Melee damage blended stat = 0.5×Str + 0.5(W×Str + (1-W)Dex)

Stats are blended similiarly for to-hit but conversely to damage calculations, dexterity counts twice as heavily towards to-hit as strength does:

Melee to-hit blended stat = 0.5×Dex + 0.5(W×Str + (1-W)Dex)

Launchers

The code for player-fired missile damage and to hit is even harder to decypher than for melee weapons. Strength and dexterity primarily affect the launcher "speed". "Speed" is a misnomer though: it means the amount of in-game time taken to fire a shot, not the rate at which shots are fired. Roughly:

Turns taken = ( launcher_base_attack_delay_percentile - player_skill×(W×Str + (W-1)×Dex)×4/25 ) / 100