User:Tungtn/Physical damage analysis

From NetHackWiki
< User:Tungtn
Revision as of 06:16, 7 October 2014 by Tungtn (talk | contribs) (Common damage values by role: Monk damage)
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.

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.

Observations

TODO

Brainstorm of possible improvements

TODO