Digging

From NetHackWiki
Revision as of 00:58, 12 September 2024 by Umbire the Phantom (talk | contribs) (expand, todo, upcoming, messages, etc.)
Jump to navigation Jump to search

In NetHack, digging is the act of tunnelling through the walls or floor of the dungeon level.

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

"Detailing - list more undiggable levels, including particulars of the Castle, and cover digging sideways while within pits 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.

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.

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, and are capable of magically repairing any damage to them.

Strangely, digging through a shop's floor does not anger the shopkeeper, 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.

Undiggable 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). Some walls can also restrict digging by limiting the effects of digging rays to one square per charge or casting - this is mostly applied for maze levels, particularly those found in Gehennom. 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.

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 Wizard's Tower is surrounded by non-diggable walls that separate it from the rest of the Gehennom levels surrounding them.

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 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.

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.[4]
  • 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.[4] The strength & dexterity bonuses are the same as those used in attacks.[5] 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.[6][7][8]

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: 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.

You can escape by digging downwards and making a hole. You will generally need a one-action method to dig, such as a wand or spell. Remember that this will deepen your dungeon level, and you might find yourself in a worse position. Monsters which follow you on stairs will also follow you when you do this. Monsters will also use this escape technique when they possess a wand of digging, which can be aggravating.

If you do not have a way to cross water, you can access Medusa's island by digging down then taking the upstair from the level below. You should be prepared to kill Medusa. Also, make sure you're not standing next to water, since your hole will fill with water, and you may drown.

You must cross solid rock to access the portal on the Plane of Earth. Digging is usually the most convenient method. Fortunately, several digging methods are provided for you on the plane itself, although it pays to go prepared.

It is frequently convenient to dig through the walls of mazes, to make shortcuts between the stairs and minimize the chances that the Wizard of Yendor will show up when you're racing to the upstairs. Similar shortcuts can also make it more feasible to carry sacrifices to altars from adjacent levels.

Digging is an essential part of the metastrategy digging for victory.

You can identify undiggable levels by attempting to make a hole by digging. If you can't make more than a pit, it is an undiggable level. This is particularly useful for identifying the deepest level of Gehennom, where the vibrating square is located; this level otherwise looks like another level of Gehennom. If you don't want to move deeper when the level is diggable, you can levitate and zap a wand of digging or cast the spell downward.

Frequently, digging out of or into a room can be easier (and sometimes faster in game time) than searching for a secret door.

Some areas, such as vaults and the luckstone in the Gnomish King's Wine Cellar, can be most easily accessed by digging.

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. 4.0 4.1 src/dig.c in NetHack 3.6.7, line 300: note that 10 + rn2(5) is 9 + d5
  5. src/weapon.c in NetHack 3.6.7, line 885
  6. src/dig.c in NetHack 3.6.7, line 972: res is set to 1 if you wielded the pick
  7. src/dig.c in NetHack 3.6.7, line 1016: res is returned if you declined to specify a direction
  8. 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