User:Tungtn/Physical damage analysis

From NetHackWiki
< User:Tungtn
Revision as of 02:39, 22 October 2014 by Tungtn (talk | contribs) (Qualitative mapping of damage to Gehennom experiences: More context for high-end damage value)
Jump to navigation Jump to search

There are a number of complaints that tend to pop up with respect to late game NetHack, such as:

  • Late game is too easy/dull/boring/grindy/repetitive.
    • "grind" in this sense means to do the same thing over and over whilst advancing, not in order to build up power.
  • Gehennom "is a bit of a clobber-or-cast-fest".
  • Ascension kit is too rigid/not enough equipment variety.
  • Every game post-Castle feels the same.

I wanted to look at one factor that contributes to these feelings: late game physical damage.

I have two main hypotheses that damage has unwanted impacts on how late game NetHack plays:

  1. It is possible to inflict so much damage that all monsters can be trivially dealt with by killing them, denying opportunities for alternative tactics, e.g. zapping, kiting, falling back to chokepoints, teleporting them away, teleporting yourself, exploiting monster AI, etc. This also leads to anti-climatic confrontations, e.g. killing the Wizard of Yendor or Riders in 2 or 3 hits.
  2. Certain equipment choices and tactics (e.g. #twoweapon) do so much more damage relative to their alternatives that they are almost always chosen, independent of race and role, leading to different characters making the same decisions and therefore playing very similarly.

The following notes cover NetHack, DynaHack (since I'm the DynaHack maintainer and I have a vested interest in improving it), and also a bit of UnNetHack, SporkHack and dNetHack.

Aims

NetHack has been seen for a long time as broken, imbalanced and forever unfixable. I'd like to see if that's really the case.

More specifically, here's what I'd like to come from all of this:

  • Increase reliance on moment-to-moment tactics in late game NetHack to reduce boredom.
  • Make equipment choices and tactics more role-dependent, making different roles feel less samey.
  • Make adjustments to damage that are big enough to be noticed, but don't go so far as to invalidate other mechanics.
  • Build a foundation to eventually make accuracy relevant in the late game of NetHack, like in the early and mid game.

Related factors and assumptions

These notes don't cover the concepts of to-hit or speed, so I'll touch on them here.

To-hit

To-hit is NetHack's way of simulating combat accuracy. The way it works is that a target number is added together from all factors that would affect whether or not an attempted physical attack lands, like your experience level, your skill, your luck, the weapon's to-hit bonus, the weapon's enchantment, the monster's AC and armor, and a bunch of other things. If that target number is greater than a d20 roll, you get the hit, otherwise you miss. This system has a few outcomes:

  1. If the target number is 21 or higher, you will always hit.
  2. If the target number is 1 or lower, you will always miss.
  3. Target numbers from 2 to 20 inclusive give a chance to hit from 5% to 95%, in 5% increments.

For the purpose of looking at late game damage, I'm assuming that every hit lands, which seems to be the case in most games. I suspect the biggest contributing factors to this are:

  • Experience level - +15 to hit at level 15; there's a one-to-one relationship here for all characters.
  • Luck - +13 to hit: +10 is the natural maximum luck, and +3 comes from having more not-cursed luck sources than cursed ones.
  • Weapon enchantment - +6 or +7; that is, +1 to hit for every +1 enchantment.

This sums to about +34 or +35 (before dexterity: 18 dex adds +4 to this, 25 dex adds +11). For perspective, monster AC values are pulled directly from Source:monst.c (only modified by worn armor which most monsters don't have; consult Source:worn.c#find_mac) and vary from 10 (gnomes and gnome lords) to -10 (Master Kaen). In other words, the worst target number for a hit with standard late game strategy is +24, which means that normal late game hits will never miss!

Other notable monster AC values:

  • -8 AC for the Wizard of Yendor.
  • -5 AC for the Riders (Death, Pestilence and Famine).
  • -2 to -8 AC for the demon princes:
    • -2 AC - Dispater
    • -3 AC - Geryon
    • -5 AC - Yeenoghu and Baalzebub
    • -6 AC - Orcus
    • -7 AC - Juiblex and Asmodeus
    • -8 AC - Demogorgon
  • 9 AC for lichens and other fungi (yes, sessile fungi have better AC than gnomes).
  • 10 AC for the Yendorian Army (soldiers, sergeants, lieutenants, captains) and the watch (watchmen, watch captains), but they spawn with armor randomly selected to approximate target AC values; see Source:makemon.c#m_initinv.

Interesting quote from MetaFilter about experience level in to-hit in D&D (from John Harris, writer of the now-defunct roguelike column @Play):

http://www.metafilter.com/143037/But-waityour-medallion-begins-to-glow#5751697

I had a thought a little while ago. One of the complaints, and it's one that I agree with, about the game is that, while the early game demands a variety of approached depending on role, the late game tends to be about smacking things until they die, whether you're a barbarian, archeologist, wizard, tourist or healer. I think I've figured out a major part of the reason for that. It's that, unlike D&D, all the characters advance in their to-hit rate at the same speed, which is the same as that of the classic D&D Fighter: +1 to hit per level.
If non-combat-wombats had less than a bucketfull of to-hit, it'd force them towards using alternative means of killing monsters. It'd make some classes much more difficult unless special care were taken to balance though. Maybe different to-hit tracks for melee and missile weapons, so Rangers could uniquely excel with missile weapons.

Speed

The wiki page on speed covers the nitty gritty technical details, but I'll summarize what assumptions I'm working off of.

In general, speed affects how many actions you get per turn:

  • action - a player input that leads to in-game consequences.
  • turn - a fixed unit of in-game time, the same way you might think of "seconds" or "minutes" in the real world.

There are three speed levels relevant to standard strategy: normal (100%), fast (133%) and very fast (166%). There are three sources of very fast speed: speed boots, potions of speed and the haste self spell. Out of these options, speed boots are the only permanent (read: won't run out) source of very fast speed, so naturally they form part of the standard ascension kit.

An important thing to note is that speed affects all actions equally, whether you choose to move, use an item, or most importantly attack.

From all this, it's safe to assume that players that enter Gehennom are:

  1. permanently very fast (due to speed boots), and
  2. can attack 66% more often than monsters that move at normal speed

These notes on damage DO NOT account for speed, so if you see a damage number and you're fighting a monster that is normal speed, you need to increase that damage number by 66% to get damage-per-turn, rather than damage-per-player-action.

Sources of damage

The main sources of damage are:

  • weapon base damage: one-handed weapons tend to do between d2 and d12 damage
  • weapon enchantment: directly added to damage, so e.g. a +7 weapon grants +7 bonus damage
  • artifact bonus damage: adds either fixed damage or double damage, usually applied conditionally
    • fixed damage is used if the artifact bonus damage value is non-zero (see artilist.h), ranges from +d6 (Cleaver) to +d10 (Excalibur), with +d24 from Mjollnir as an outlier
    • double damage is used if the artifact bonus damage value is zero; doubling applies to weapon base damage, enchantment and rogue backstab
  • artifact special effects: things like d8 life draining from Stormbringer, double damage vs. large from Tsurugi of Muramasa, and extra damage and effects for Magicbane (yes, this is done after artifact damage doubling, e.g. Staff of Aesculapius)
  • strength: -1 to +6 damage
  • skill damage modifier
    • -2 to +2 for most hits
    • -3 to +1 for two-weapon hits
    • +1 to +3 for bare-handed combat
    • +3 to +9 for martial arts
    • +0 to +2 for riding (stacks)

Strength

Strength Damage Notes
3-5 -1
6-15 +0 common start bonus
16-17 +1
18 +2 elf max
18/01-18/75 +3 gnome and orc max
18/76-18/90 +4
18/91-18/99 +5
18/**-25 +6 human and dwarf max

DynaHack, UnNetHack and SporkHack go further:

Strength Damage Notes
18/** +6 vampire max (DynaHack and UnNetHack only)
25 +7 DynaHack, UnNetHack and SporkHack

Skill

Damage modifiers come from one of normal weapon skills, two-weapon skill, bare-handed combat and martial arts.

On top of this, riding skill stacks its own bonus on top of one of those four skill tables.

Normal weapon skills

Weapon skill level Damage
restricted and unskilled -2
basic +0
skilled +1
expert +2

DynaHack and dNetHack go further:

Skill level Damage Notes
restricted -5 DynaHack and dNetHack only
expert +3 DynaHack and dNetHack only

Two-weapon skill

Two-weapon is handled in a peculiar way: for each hit, you take the lesser of the skill of the hitting weapon and the two-weapon skill, then use the damage table in this section instead of the weapon skill table.

Two-weapon skill level Damage
restricted and unskilled -3
basic -1
skilled +0
expert +1

DynaHack and dNetHack go further:

Two-weapon skill level Damage Notes
expert +2 DynaHack and dNetHack only

Bare-handed combat

Bare-handed skill Damage Notes
unskilled +0
basic and skilled +1
expert and master +2
grand master +3 N/A; no role can reach this

Martial arts

Martial arts is bare-handed combat special-cased to Samurai and Monks, with higher damage and perks like staggering blows.

Martial arts skill Damage Notes
unskilled +1 N/A; martial arts roles always start at basic
basic +3
skilled +4
expert +6
master +7 Samurai max
grand master +9 Monk max

Special note: If the base damage rolled for a weapon and its enchantment does 1 damage (the minimum), it won't train the skill, but more importantly it won't get bonus damage from skill either. For most skill damage tables this distinction is negligible, but martial arts is treated like a d4 weapon, meaning 1-in-4 martial arts hits don't get the skill damage bonus. I account for this difference for Monk martial arts, but I omit it elsewhere.

DynaHack and UnNetHack always grant the skill damage bonus, in contrast to NetHack.

Riding skill

Unlike the other skill damage tables, this one stacks with the others.

Riding skill Damage
unskilled and basic +0
skilled +1
expert +2

DynaHack and dNetHack go further:

Riding skill Damage Notes
skilled +2 DynaHack and dNetHack only
expert +5 DynaHack and dNetHack only

Dealing with dice

The values that I've calculated express damage from D notation (or dice notation) give three values: minimum, average (mean) and maximum, like so:

   d6 = 1 / 3.5 / 6

That is, a single 6-sided die rolls a minimum of 1, an average of 3.5 and a maximum of 6.

The way to calculate the average of dice in the form of xdy is x * (y + 1) / 2, e.g. the average of 3d5 is 3 * (5 + 1) / 2 = 9.

Common weapon and artifact reference tables

The common tables linked below ignore skill and enchantment. The tables for long swords and Grayswandir consider enchantments and different skill levels for quick comparison to final damage figures for different roles.

Damage profiles

I had two choices in calculating physical damage: be comprehensive, or only cover common cases. Being comprehensive would have involved hundreds more calculations than only covering common cases, so common cases is what I went with for the sake of practicality.

To that end, I divide the game into three phases, and make assumptions accordingly:

  • Early game
    • start str: +0 damage
    • basic skill for starting weapons, unskilled otherwise
    • enchantments: +0, unless it's a starting weapon with a guaranteed enchantment
  • Mid game
    • 18 str: +2 damage
    • expert skill, or the role's max skill(s) for the weapon(s)
    • enchantments: +0, most players don't enchant weapons until ready to enter Gehennom
  • Late game
    • 18/** str: +6 damage
      • for simplicity, 18/** is the only strength considered
      • only reachable by humans, dwarves and gauntlets of power
      • gnomes, orcs: 18/75 max strength = +3 damage
      • elves: 18 max strength = +2 damage
    • expert skill, or the role's max skill(s) for the weapon(s)
    • enchantments: +7

Common damage values by role

Each role page consists of the damage of various physical damage options in the early, mid and late game phases, followed by specific damage breakdown for selected late game physical damage options.

The values below are the average damage inflicted by various damage options available to each role in the late game. Check the role page links for damage breakdown and damage at other phases of the game.

  • User:tungtn/Physical damage analysis/Archeologist
    • +7 Grayswandir
      • non-silver: 31
      • silver: 41.5
    • two-weapon +7 Grayswandir, +7 silver saber
      • non-silver: 48.5
      • silver: 69.5
  • User:tungtn/Physical damage analysis/Barbarian
    • +7 Cleaver
      • 25.5/27
    • two-weapon +7 Frost Brand, +7 silver saber
      • resist cold non-silver: 33/35
      • resist cold silver: 43.5/45.5
      • cold non-silver: 44.5/48.5
      • cold silver: 55/59
  • User:tungtn/Physical damage analysis/Caveman
    • +7 Sceptre of Might
      • co-aligned: 15.5/14.5
      • cross-aligned: 27/25
  • User:tungtn/Physical damage analysis/Healer
    • +7 poisoned darts
      • resist poison: 22/21
      • poison: 29/28
    • +7 Grayswandir
      • non-silver: 29
      • silver: 39.5
    • +7 Staff of Aesculapius
      • non-drain: 18.5
      • drain: 33.5
    • +2 Magicbane
      • non-stun: 13.57/13.07
      • stun: 16.48/15.98
  • User:tungtn/Physical damage analysis/Knight
    • +7 lance (riding)
      • 29.3/30.3
    • two-weapon +7 lance, +7 long sword (riding)
      • 32.9/34.7
    • two-weapon +7 Excalibur, +7 long sword
      • 40.5/44.5
    • two-weapon +7 Frost Brand, +7 long sword
      • cold resist: 35/39
      • cold: 46.5/52.5
  • User:tungtn/Physical damage analysis/Monk
    • martial arts (grand master)
      • 18/17.5
    • +7 Excalibur (lawful crowning)
      • 23/25
  • User:tungtn/Physical damage analysis/Priest
    • +7 Grayswandir
      • non-silver: 29
      • silver: 39.5
    • +7 unicorn horn
      • 20.5
  • User:tungtn/Physical damage analysis/Ranger
    • +7 poisoned silver arrows
      • resist poison non-silver: 31.25
      • resist poison silver: 57.5
      • poison non-silver: 40
      • poison silver: 66.25
    • +7 Stormbringer
      • resist drain: 18/17.5
      • drain: 24/23.5
    • +7 Grayswandir
      • non-silver: 27
      • silver: 37.5
  • User:tungtn/Physical damage analysis/Rogue
    • +7 Stormbringer
      • resist drain (XL15 backstab): 19/18.5 (27/26.5)
      • drain (XL15 backstab): 25/24.5 (33/32.5)
    • +7 Grayswandir
      • non-silver (XL15 backstab): 30 (46)
      • silver (XL15 backstab): 40.5 (56.5)
    • two-weapon +7 Stormbringer, +7 crysknife
      • resist drain: 37.5/37
      • drain: 43.5/43
    • two-weapon +7 Grayswandir, +7 crysknife
      • non-silver: 48.5
      • silver: 59
    • +7 silver daggers
      • non-silver (XL15 backstab): 28.75/27.5 (48.75/47.5)
      • silver (XL15 backstab): 55/53.75 (75/73.75)
  • User:tungtn/Physical damage analysis/Samurai
    • +7 ya (fired from a yumi)
      • 35
    • +7 Tsurugi of Muramasa
      • 28.775/31.925
    • two-weapon +7 Excalibur, +7 katana
      • 43.5/46.5
    • two-weapon +7 Grayswandir, +7 silver saber
      • non-silver: 44.5
      • silver: 65.5
  • User:tungtn/Physical damage analysis/Tourist
    • +7 unicorn horn
      • 20.5
    • +7 poisoned darts
      • resist poison: 22/21
      • poison: 29/28
    • two-weapon +7 Grayswandir, +7 silver saber
      • non-silver: 46.5
      • silver: 67.5
  • User:tungtn/Physical damage analysis/Valkyrie
    • two-weapon +7 Excalibur, +7 long sword
      • 40.5/44.5
    • two-weapon +7 Grayswandir, +7 silver saber
      • non-silver: 44.5
      • silver: 65.5
  • User:tungtn/Physical damage analysis/Wizard
    • +7 silver daggers
      • non-silver: 23/22
      • silver: 44/43
    • +2 Magicbane
      • non-stun: 10.57/10.07
      • stun: 13.48/12.98
    • +7 Staff of Aesculapius
      • resist drain: 14.5
      • drain: 29.5
    • +7 Frost Brand
      • resist cold: 13.5/15.5
      • cold: 25/29
    • +7 Grayswandir
      • non-silver: 23
      • silver: 33.5

All of these calculations were done manually, and with the sheer volume of calculations it's almost certain that small errors exist, so keep that in mind when reading the raw damage values.

Monster hit point examples

To put these damage numbers in perspective, it helps to know the maximum hit points of certain monsters. See Hit points#Monster for the exact details.

Monster hit points are generally based on a monster's level: d8 per level. A monster's level is based on its intended level listed in monst.c, which is then modified by the current difficulty level (+1 for every 5 points of difference) and hero experience level (+1 for every 4 points of difference) in adj_lev().

Knowing these rules, you can approximate likely initial hit points of monsters by predicting the level, then:

  • minimum HP = level * 1
  • average HP = level * 4.5
  • maximum HP = level * 8

For example, a level 5 soldier ant has 5 min / 22.5 avg / 40 max initial hit points.

Hit points of notable monsters, most of which have special rules for their starting hit points:

  • Riders - 10 min / 45 avg / 80 max - Riders are hard-coded to have 10d8 hit points in makemon().
  • Demon princes:
    • Juiblex - 88 exactly
      • Note that zapping a wand of digging while engulfed will reduce Juiblex to 1 hit point!
    • Yeenoghu - 100 exactly
    • Orcus - 120 exactly
    • Geryon - 132 exactly
    • Dispater - 144 exactly
    • Baalzebub - 166 exactly
    • Asmodeus - 198 exactly
    • Demogorgon - 200 exactly
  • Wizard of Yendor (killed 0 times) - 30 min / 135 avg / 240 max - 30d8 from standard hit point rules, since the Wizard starts at level 30.

Taking the initial hit points of a monster and dividing it by damage gives a rough idea of how tough a monster is in combat.

Observations

Sources of damage from player attacks can be broadly divided into flat bonuses and multipliers. The main flat bonuses are, in rough descending order of impact:

  • silver - Against a silver-hating monster, any silver object does +d20 damage from an average of +10.5 damage per hit, which is more than any artifact weapon effect. Notably, this applies to demons and thus demon princes.
  • Rogue backstab - Exact impact scales based on the Rogue's experience level, since it does +d(XL) bonus damage to fleeing monsters.
  • enchantment - e.g. a +7 weapon does +7 damage. Two-weaponing with two +7 weapons grants +14 damage before considering anything else.
  • strength - Maximum strength grants +6 damage to melee hits, but not ranged ones. Two-weaponing pushes this up to +12 damage.
  • weapon base damage - The damage in dice notation that's listed next to weapons in their wiki pages. Non-two-handed weapons have dice ranging from d2 to d12, averaging 1.5 to 6.5 damage per hit.
  • weapon skill - Almost meaningless in terms of damage, despite needing multiple tables to describe earlier. More impactful in the early game where its to-hit modifiers make a difference.

Except for silver and a handful of other tiny factors, these flat bonuses are modified by what I loosely refer to as multipliers, which amplify or diminish the flat bonuses to determine the final damage inflicted to monsters. The main multipliers are, in rough descending order of impact:

  • speed - Going from normal speed (100%) to very fast (166%) adds +66% to damage per turn on average, and going from fast (133%) to very fast (166%) adds about +25% to damage per turn on average. It is the only multiplier that applies to all flat bonuses, and it stacks with other multipliers here! All characters with speed boots effectively get this bonus permanently.
  • two-weapon - Effectively almost x2 damage for melee for the 6 out of 13 roles that have any skill in it. Late game two-weapon does 35 average damage minimum per round; the best non-two-weapon non-Grayswandir alternatives do 25 average damage maximum (Grayswandir does around 30). Much of its damage comes from allowing two enchantable weapons (+7 each for +14 total, the corollary of the Monk adage: "You can't enchant your fists") and applying strength bonus to both hits (+6 each for +12 total).
  • artifact weapon double damage - Applies to certain artifact weapons, and only to the damage done by the artifact itself, though it does stack with two-weapon if the artifact is one-handed. Most double damage artifact weapons are the Banes, notable exceptions are:
    • Grayswandir - vs. all, also does silver damage, which is not doubled
    • Frost Brand and Fire Brand - vs. non-cold and non-fire resistant respectively
    • Sceptre of Might - vs. cross-aligned (i.e. monsters whose alignment differs from yours)
    • Staff of Aesculapius - vs. non-drain resistant, also does d8 bonus draining which is not doubled
  • multishot - Applies only to ranged attacks. Expert multishot grants d3 shots and grants x2 average damage, the special role/weapon bonuses for Ranger, Rogue and Samurai push this up to d4 shots for x2.5 average damage, and race/weapon can push this up to d5 shots for x3 average damage.

The damage inflicted by characters in late-game NetHack is a combination of all of these factors.

One-weapon melee vs. Two-weapon vs. Ranged Damage

Minimum, maximum and average late game damage. Damage for each combat option has been normalized by taking the average small/large damage, then the average of all distinct damage cases.

  • One-weapon melee
    • Minimum: 11.75 for Wizard with +2 Magicbane.
      • Ignoring Magicbane, minimum is 17.75 for Monk martial arts at grand master.
      • Considering only "proper" weapons, minimum is 20.5, a tie between Caveman +7 Sceptre of Might and Priest/Tourist +7 unicorn horn.
    • Maximum: 36.25 for Archeologist +7 Grayswandir.
    • Average: 25.71, keeping in mind that some of the weaker roles had multiple options due to lack of obviously powerful options.
  • Two-weapon
    • Minimum: 33.8 for Knight two-weapon +7 lance, +7 long sword.
      • If the main hand lance knocks the monster backwards, the second hit won't land. Swapping lance and long sword hands reduces joust damage from +2d10 to +2d3.
    • Maximum: 59 for Archeologist two-weapon +7 Grayswandir, +7 silver saber.
    • Average: 47.69.
  • Ranged
    • Minimum: 25 for Healer/Tourist +7 poisoned darts.
    • Maximum: 51.25 for Rogue +7 silver daggers.
    • Average: 36.33.

Qualitative mapping of damage to Gehennom experiences

Just looking at the late game damage options and how people on IRC talk about their experiences of Gehennom and what weapons they're using, you can get a rough idea of what people consider good damage and bad damage.

The minimum damage that people are still comfortable fighting monsters in Gehennom is around 20 per hit (or 33 per turn with "Very Fast" speed), which is about the average damage done by +7 Stormbringer. Martial arts at grand master skill is considered weak, doing around 18 damage on average per hit (or 30 per turn with "Very Fast" speed).

The point where combat starts to become trivial in Gehennom is around 35 damage per hit (or 58 per turn with "Very Fast" speed), which is about the average damage done by two-weapon +7 Frost Brand, +7 long sword in the worst case of a cold-resistant monster.

Impact of skill on overall damage

Just as a reminder, this is the bonus damage granted to attacks by skill level:

Normal weapon skills
Weapon skill level Damage
restricted and unskilled -2
basic +0
skilled +1
expert +2

This applies once for one-weapon combat. Recall that one-weapon combat (with actual weapons) ranges from 20.5 minimum, 36.25 maximum and 25.71 average. The +2 for expert skill therefore comprises 5.5-9.7%, average 7.8%.

TODO: Calculate and compare to other variable damage sources.

TODO: Repeat for two-weapon and ranged.

Combat option selection

Grayswandir damage

Fire Brand vs. Frost Brand

Combat changes made by Variants

Double damage for two-handed weapons (SporkHack, UnNetHack, DynaHack)

+1 bonus damage for expert skill (dNetHack, DynaHack)

-5 damage for restricted skill (dNetHack, DynaHack)

Brainstorm of possible improvements

TODO