Digging

From NetHackWiki
Revision as of 06:27, 12 September 2024 by Umbire the Phantom (talk | contribs) (section rename)
Jump to navigation Jump to search

In NetHack, digging is the act of tunneling through the solid rock walls or floor of the dungeon level.

A user has suggested improving this page or section as follows:

"Copyedit digging speed section; list more undiggable levels, including particulars of the Castle; cover digging sideways while within pits; mention what other dungeon features can and cannot be dug through; and add citations where necessary, among other things"

Description

There are multiple methods of digging:

Digging with a pick-axe or dwarvish mattock takes several turns, while the spell of dig and wand of digging generally take a single turn.

The hero and monsters can dig in any of the eight directions, and the hero can also dig downwards using a tool, the wand or the spell - attempting to dig upwards only works with the wand or spell, and will only cause a rock to fall on the hero's head. Tunneling monsters can dig in eight directions, but monsters can only dig downward with the wand. Digging through a door with a tool or magic will destroy it, while digging through a boulder with a tool will shatter it into several rocks - the spell of dig and wand of digging cannot destroy boulders.

Digging downwards with a digging tool will eventually create a pit in the floor; digging downwards with a tool while in a pit will turn the pit into a hole, causing the hero to fall through it immediately unless they have flying. Digging downwards when standing on a sink will turn it into a non-magical fountain, and digging downwards when standing on a fountain will most likely create several pools of water. Stairways and altars cannot be dug through.

Zapping the wand of digging or spell of dig downwards instantly creates a hole beneath the hero in most circumstances, causing them to immediately fall through unless they have flying or levitation. Monsters will only zap a wand of digging when trying to escape the hero, and will always aim downward to create a hole that they will fall through; a monster that can fly will immediately swoop through the hole instead.

Digging in shops

For the hero, shop doors and walls will print a message when digging through them with a digging tool in order to interrupt them and discourage them from possibly angering the shopkeeper - the spell of dig and wand of digging work instantly as normal, including instantly angering the shopkeeper. Shopkeepers will demand 400 gold in compensation from the hero if they destroy their shop's walls or doors. Any damage done by the hero or a monster to a shop's door and walls will be magically repaired by the shopkeeper within a few turns.

Strangely, digging into a shop's floor does not anger the shopkeeper or cause them to repair it, though they will warn you about falling through the floor if you create a pit or admonish you if you create a hole.[1] However, they will become angry if items belonging to the shop fall through any holes that you create. Shopkeepers have a rough idea of how long digging takes as well:[2] attempting to leave a shop by digging down through a pit inside the room while you have unpaid items or debts will anger them, and they will try to reach you and grab the backpack containing your inventory.[3] Knights that damage the shop's door, floor or walls incur penalties to alignment record.

The following information pertains to an upcoming version (3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Per commit 075844b4, shopkeepers will magically repair pits and holes in their shop as they do damaged walls and doors.

Non-diggable levels

The ground or the walls of certain levels or sections of a level can be set as non-diggable (or informally "undiggable"), which prevents them from being completely dug through: a non-diggable wall completely blocks digging tools and stops rays from the wand of digging and spell of dig, while a non-diggable floor prevents holes from being made in them by any means (i.e. wands and spells will have no effect, but digging tools can still create pits).

Non-diggable floors and walls can affect other dungeon features in the area: Iron bars on a non-diggable level or section cannot be dissolved by acid, and trees on a non-diggable level or section cannot be chopped down with any axe weapon. Doors can still be destroyed by digging through them even if the walls are non-diggable.

The following levels have non-diggable walls and/or floors:

  • Sokoban has non-diggable walls, and the bottom level also has a non-diggable floor.
  • The floors at the bottom of several dungeon branches are typically non-diggable.
  • The Castle has non-diggable walls between its maze sections.
  • The Valley of the Dead has non-diggable floors and walls.
  • The Wizard's Tower is surrounded by non-diggable walls that separate it from the rest of the Gehennom levels surrounding them.
  • The level containing the vibrating square has non-diggable floors.
  • Moloch's Sanctum has non-diggable floors and walls.
  • The Elemental Planes have non-diggable floors, and the Astral Plane has non-diggable floors and walls.

The following information pertains to an upcoming version (3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Zapping a wand of digging or spell of digging at a non-diggable floor will create a pit instead of having no effect.

Digging-resistant walls

A related mechanic is a special type of wall that can restrict digging by limiting the effects of digging rays to one square per charge or casting - tunneling and digging via tools are unaffected. This type of wall is mostly emloyed for maze levels, particularly those found in Gehennom, though it can also be seen well before that point, e.g. in the Gnome King's wine cellar variant of Mines' End.

Digging on the Plane of Earth

Main article: Plane of Earth

On the Plane of Earth, digging with a pick-axe or dwarvish mattock has a 13 chance of generating earth elementals and xorns.[4] Separately, digging with blessed tools has a 13 chance of a 3x3 area of rock immediately clearing around the hero.[5] Digging with non-blessed tools has an independent 16 chance of a cave-in creating walls in that same area if the tool is uncursed, and a 14 chance of doing so if the tool is cursed.

Digging speed

The following discussion of digging speed only applies to the hero digging with pick-axes and dwarvish mattocks, as digging with a wand of digging or the dig spell always takes exactly one action.

A user has suggested improving this page or section as follows:

"Copyedit so that it remains technical while also being concise."

Summary of factors

A pick-axe or mattock takes roughly 5 turns to dig horizontally, and 20 turns to dig through the floor. However, the actual time varies depending on a number of factors.

The following things impact the speed of digging:

  • Having high dexterity and strength makes digging faster.
  • Being a dwarf makes digging faster.
  • Enchanting the pick-axe or mattock and/or wearing a ring of increase damage with positive enchantment makes digging with them faster, while a pick-axe or mattock with negative enchantment and/or erosion, or wearing a negatively enchanted ring of increase damage, slows digging with them.[6]
  • Having intrinsic or extrinsic speed indirectly speeds up digging, since the digging actions will be complete in fewer turns

The following things have no impact on digging speed, although they might be expected to:

  • Having higher pick-axe skill
  • Using a dwarvish mattock rather than a pick-axe
  • having higher luck

Full explanation and calculations

These calculations are used for a hero digging up rock walls, boulders and statues with a pick-axe or a dwarvish mattock, as well as chopping down non-petrified trees with an axe.

Each move you spend digging, you generate

9 + d5 + strength & dexterity bonuses + enchantment - erosion  + increase damage bonus

points of digging effort, with the result doubled if you are a starting race dwarf.[6] The strength & dexterity bonuses are the same as those used in attacks.[7] The pick-axe skill does not play a role. Player speed proportionally speeds up digging, since you get more actions per turn.

Terrain type Digging effort needed Examples: expected turns
STR=11, DEX=11 and thoroughly rusty STR=18, DEX=18 and +3 mattock
through an existing pit 251 21.4 28.3 15.2 13.0
other floor, fountain, sink, any non-pit trap 51 4.8 6.1 3.4 3.0
statue, boulder, wall, solid rock, (secret) door; chop down tree 101 8.9 11.7 6.3 5.6

There is no speed difference between a pick-axe and a mattock; however, mattocks are heavier, two-handed, and can be generated enchanted.

Wielding a digging tool by applying it does not take time only if you consent to actually dig at the confirmation prompt.[8][9][10]

If you try to dig through shop doors, the game will constantly print messages to interrupt you, but the process itself will not take any longer - as mentioned previously, shopkeepers will use rough calculations of how long digging takes to prevent theft via digging holes and pits.

Special cases: Fumbling causes bad effects instead (33% chance). Digging down on an altar is impossible, but would incur the god's wrath and anger any attending priest. On the Plane of Earth, earth elementals can form, and your passage may collapse.

Strategy

Digging serves many purposes for an enterprising hero looking to make their way through the dungeon: it is useful for aspiring vault hunters to make their way in and out quickly, and the Gnome King's Wine Cellar map of Mines' End requires a means of digging if you want to access the guaranteed luckstone.

The wand of digging in particular is prized as an escape item for quickly getting away from hostiles when a hero is at low health and/or completely surrounded, but it is not always guaranteed to put you in a better position, and certain monsters can still follow you to whatever level you land on (though this also includes pets). Monsters can also use it for the same purposes, which can make chasing them down annoying and time-consuming - very few heroes enjoy trying to retrieve their stolen inventory from a nymph that has just taken their wand of digging as well.

Digging can also be used to cross certain levels that are blocked by water: Medusa's Island can be circumvented by digging down on a safe square, as creating a pit or hole next to any moat of water will cause it to immediately fill and potentially drown the hero. After safely digging to the level below, find its up stair, then ready your sources of reflection and/or blindness before going up to kill Medusa.

Digging can be used to create direct paths between "minor" objectives and speed up dungeon navigation significantly, such as quicker paths between stairways and other stairways, quicker access to rooms without relying on finding secret doors, or direct lines from stairways to altars that facilitate carrying corpses to them for sacrifice. Digging tools are best suited for digging shortcuts through maze levels, since only one square can be dug at a time using magic - this is especially true on the ascension run, where the hero will have to contend with both the Wizard of Yendor and the mysterious force.

Digging is required to cross the Plane of Earth: the minotaur and Elvenking that generate there have a wand of digging and a pick-axe respectively, and the Wizard of Yendor always carries a spellbook of dig when making his guaranteed reappearance. Wands of digging are the best means of crossing the Plane of Earth by far, since a hero usually has many spare wands - while the spell of dig can be sufficient, it requires heavy investment of energy, and spell-casting builds that are capable will prefer wands anyway in order to save that energy for other needs; digging tools are the slowest methods outright, though blessing the digging tool can partially remedy this.

Digging for victory

Main article: Digging for victory

Players that are daring or willing to try their luck can use digging as a metastrategy to try and gain entrance to the Castle as soon as possible.

Messages

You start digging downward. You dig a pit in the floor.
You dug downward with a digging tool.
This <door/wall> seems too hard to dig.
You are attempting to dig through a shop wall or door.

References

  1. src/shk.c in NetHack 3.6.7, line 3984
  2. src/dig.c in NetHack 3.6.7, line 493
  3. src/shk.c in NetHack 3.6.7, line 4000
  4. src/dig.c in NetHack 3.6.7, line 444
  5. src/dig.c in NetHack 3.6.7, line 388
  6. 6.0 6.1 src/dig.c in NetHack 3.6.7, line 300: note that 10 + rn2(5) is 9 + d5
  7. src/weapon.c in NetHack 3.6.7, line 885
  8. src/dig.c in NetHack 3.6.7, line 972: res is set to 1 if you wielded the pick
  9. src/dig.c in NetHack 3.6.7, line 1016: res is returned if you declined to specify a direction
  10. src/dig.c in NetHack 3.6.7, line 1018: The value of res is discarded before timing calculations, so the rest of the code doesn't know whether you wielded the pick at that point