Difference between revisions of "Naming artifacts"

From NetHackWiki
Jump to navigation Jump to search
m (Categories on this wiki seem to be plural.)
(spacing - until there's citations added in the main text I think this should do)
 
(47 intermediate revisions by 31 users not shown)
Line 1: Line 1:
The '''naming artifacts''' trick is a [[bug]] exploitation that allows you to [[identify]] certain item types.  
+
{{For2|the method for creating artifacts|[[Sting]] or [[Orcrist]] (and in [[SLASH'EM]] also [[Elfrist]])}}
 +
The '''naming artifacts''' trick refers to an [[bug|exploit]] in certain versions of ''[[NetHack]]'' that let you [[identify]] certain item types.
  
The way NetHack internally keeps track of which items are [[artifact]]s is through the item's name; this saves memory and allows a flexible artifact set (i.e. multiple artifacts can have the same base item type). If you try to name an item (say, a [[helm of brilliance]]) with the name of an artifact with the same base type (say, [[The Mitre of Holiness]]), you'll misengrave.  
+
==Description==
 +
Early versions of NetHack, such as [[NetHack 3.0.0]], kept track of which items are [[artifact]]s through their names, allowing a flexible artifact set (i.e., multiple artifacts can be of the same item type) without needing separate fields in the object structure to track artifact status. As a consequence of this mechanic, the game needed to prevent non-artifacts being turned into artifacts via naming them (e.g. naming a long sword "Excalibur" to turn it into [[Excalibur]]).  So if you tried to name a non-artifact with the name of an artifact of the same base type, the game would prevent you and you will mis-engrave. ("Your hand slips...")
  
The abuse is that this only works on the same item type, even if [[randomised appearance|appearances are randomized]]. In other words, naming a magical helmet "The Mitre of Holiness" will misengrave if and only if the magical helmet is a helm of brilliance. You must [[name]], not [[call]], the object in question (answer yes when it asks you to "Name an individual object?"). Use of this exploitation is frowned upon by some, because this behavior is obviously unintentional.
+
In later versions of NetHack, items used a separate "artifact flag" to identify whether they were artifacts (and which artifact they were), meaning that this mechanic was no longer necessary to prevent inadvertent creation of artifacts, but it remained in the codebase. This made it possible to identify items; for example, naming a helmet "The Mitre of Holiness" would fail ''if and only if'' the helmet is a helm of brilliance.
  
In this way you can identify (or rule out) the following items:
+
By this exploit, you could identify (or rule out) the following items:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
!Appearance !! Item type !! Artifact name
 
!Appearance !! Item type !! Artifact name
 
|-
 
|-
|amulet || [[amulet of ESP]] || [[The Eye of the Aethiopica]]
+
|[[amulet]] || [[amulet of ESP]] || [[The Eye of the Aethiopica]]
 
|-
 
|-
|gray stone || [[luckstone]] || [[The Heart of Ahriman]]
+
|[[gray stone]] || [[luckstone]] || [[The Heart of Ahriman]]
 
|-
 
|-
|magic helmet* || [[helm of brilliance]] || [[The Mitre of Holiness]]
+
|magic [[helm]]* || [[helm of brilliance]] || [[The Mitre of Holiness]]
 
|}
 
|}
  
<nowiki>*:</nowiki> The appearances of magic helmets are: [[plumed helmet]], [[etched helmet]], [[crested helmet]], and [[visored helmet]].
+
<nowiki>*:</nowiki> The appearances of magic helmets are [[randomized appearance|randomized]] - [[plumed helmet]], [[etched helmet]], [[crested helmet]], and [[visored helmet]].
  
A possible fix is to prevent the naming of ''any'' item with the name of an artifact (so no items period could be named "The Eye of the Aethiopica"), or perhaps just those with the same appearance as the artifact (so no gray stones could be named "The Heart of Ahriman", but, say, [[frost horn]]s could).
+
Although this exploit never appeared on the official bug list, it was fixed in [[NetHack 3.6.0]]; naming any item in the the appropriate category, if you haven't identified its type, with the appropriate name, will mis-engrave whether or not the item's type is the artifact's base. Thus, attempting to name an unidentified gray stone "The Heart of Ahriman" will fail, regardless of whether it's a luckstone or touchstone, but if you've formally identified it as a touchstone you can name it successfully (and ineffectively).
  
Note: this is not the same as naming [[Sting]] and [[Orcrist]].
+
===Post-3.4.3===
 +
The original fix in 3.6.0 still allowed a slightly different exploit with the same results, relying on the fact that formatting (capitalization and article placement) is corrected only for the actual type -- if naming the item in all lowercase, the exploit still works. Similarly, if using the correct capitalization but dropping the article (e.g. naming a [[gray stone]] "Heart of Ahriman" instead of "[[The Heart of Ahriman]]"), the missing article will be inserted only if the type matches the artifact.
  
 +
{{upcoming|3.7.0|The artifact-naming trick is fully patched as of {{commit|d886b43107d57235ca0d7d464ab2a9f8660b855b|commit d886b43}}.}}
 +
 +
==History==
 +
NetHack 3.0.0 lacked an artifact marker on items, but instead checked the name and object base type of an item to determine whether it is an artifact; this allowed naming Sting or Orcrist to work, but the game had to forbid naming attempts that would create other artifacts. In the code:
 +
 +
* [[NetHack_3.0.0/do_name.c#line157]] which causes your hand to slip if you try – although with a different message.
 +
* See [[NetHack_3.0.0/weapon.c#line58]] for a call from the weapons code to the spec_abon function that determines the to-hit bonus of an artifact, or [[NetHack_3.0.0/weapon.c#line143|line143]] or [[NetHack_3.0.0/mhitu.c#line674]] for other similar calls.
 +
* [[NetHack_3.0.0/artifact.c#line237]] contains the definition of spec_abon, which calls the function get_artifact to determine whether an item is an artifact.
 +
* get_artifact in [[NetHack_3.0.0/artifact.c#line109|line109]] compares the base type and name of the item to those in the artifact tables [[NetHack_3.0.0/artifact.c#line12|above]].
 +
 +
==Variants==
 +
Many variants adopt the aforementioned fixes for the artifact-naming trick, with some exceptions.
 +
 +
===SLASH'EM===
 +
In [[SLASH'EM]], the artifact naming trick remains unpatched, and is even more effective due to the addition of new artifacts.
 +
 +
Below is a list of artifacts that are compatible with the naming artifacts trick:
 +
 +
{| class="wikitable"
 +
!Appearance !! Item type !! Artifact name
 +
|-
 +
|[[bag]] || [[bag of holding]] || [[Wallet of Perseus]]<ref>Trivially identifiable in SLASH'EM with the showweight option enabled.</ref>
 +
|-
 +
|[[candle]] || [[magic candle]] || [[The Candle of Eternal Flame]]<ref>Trivially identifiable by having a light radius of 3, vs. 2 for normal candles.</ref>
 +
|-
 +
|[[amulet]] || [[amulet of ESP]] || [[The Eye of the Aethiopica]]
 +
|-
 +
|[[gray stone]] || [[luckstone]] || [[The Heart of Ahriman]]
 +
|-
 +
|magic [[boots]] || [[speed boots]] || [[Whisperfeet]]
 +
|-
 +
|magic [[cloak]] || [[cloak of displacement]] || [[Deluder]]
 +
|-
 +
|magic [[gloves]] || [[gauntlets of dexterity]] || [[Gauntlets of Defense]]
 +
|-
 +
|magic [[helmet]] || [[helm of brilliance]] || [[The Mitre of Holiness]]
 +
|-
 +
|magic [[helmet]] || [[helm of telepathy]] || [[The Crown of Saint Edward]]
 +
|-
 +
|[[whistle]] || [[magic whistle]] || [[The Storm Whistle]]<ref>Easily identified by applying it.</ref>
 +
|}
 +
<references/>
 +
 +
===GruntHack===
 +
In [[GruntHack]], items can now bear the same name as an artifact, removing the ability to determine object identities this way.
 +
{{nethack-367}}
 
[[Category:Bugs]]
 
[[Category:Bugs]]
 +
[[Category:Identification]]
 +
[[Category:Cheating]]

Latest revision as of 12:08, 9 March 2024

For the method for creating artifacts, see Sting or Orcrist (and in SLASH'EM also Elfrist).

The naming artifacts trick refers to an exploit in certain versions of NetHack that let you identify certain item types.

Description

Early versions of NetHack, such as NetHack 3.0.0, kept track of which items are artifacts through their names, allowing a flexible artifact set (i.e., multiple artifacts can be of the same item type) without needing separate fields in the object structure to track artifact status. As a consequence of this mechanic, the game needed to prevent non-artifacts being turned into artifacts via naming them (e.g. naming a long sword "Excalibur" to turn it into Excalibur). So if you tried to name a non-artifact with the name of an artifact of the same base type, the game would prevent you and you will mis-engrave. ("Your hand slips...")

In later versions of NetHack, items used a separate "artifact flag" to identify whether they were artifacts (and which artifact they were), meaning that this mechanic was no longer necessary to prevent inadvertent creation of artifacts, but it remained in the codebase. This made it possible to identify items; for example, naming a helmet "The Mitre of Holiness" would fail if and only if the helmet is a helm of brilliance.

By this exploit, you could identify (or rule out) the following items:

Appearance Item type Artifact name
amulet amulet of ESP The Eye of the Aethiopica
gray stone luckstone The Heart of Ahriman
magic helm* helm of brilliance The Mitre of Holiness

*: The appearances of magic helmets are randomized - plumed helmet, etched helmet, crested helmet, and visored helmet.

Although this exploit never appeared on the official bug list, it was fixed in NetHack 3.6.0; naming any item in the the appropriate category, if you haven't identified its type, with the appropriate name, will mis-engrave whether or not the item's type is the artifact's base. Thus, attempting to name an unidentified gray stone "The Heart of Ahriman" will fail, regardless of whether it's a luckstone or touchstone, but if you've formally identified it as a touchstone you can name it successfully (and ineffectively).

Post-3.4.3

The original fix in 3.6.0 still allowed a slightly different exploit with the same results, relying on the fact that formatting (capitalization and article placement) is corrected only for the actual type -- if naming the item in all lowercase, the exploit still works. Similarly, if using the correct capitalization but dropping the article (e.g. naming a gray stone "Heart of Ahriman" instead of "The Heart of Ahriman"), the missing article will be inserted only if the type matches the artifact.

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.

The artifact-naming trick is fully patched as of commit d886b43.

History

NetHack 3.0.0 lacked an artifact marker on items, but instead checked the name and object base type of an item to determine whether it is an artifact; this allowed naming Sting or Orcrist to work, but the game had to forbid naming attempts that would create other artifacts. In the code:

Variants

Many variants adopt the aforementioned fixes for the artifact-naming trick, with some exceptions.

SLASH'EM

In SLASH'EM, the artifact naming trick remains unpatched, and is even more effective due to the addition of new artifacts.

Below is a list of artifacts that are compatible with the naming artifacts trick:

Appearance Item type Artifact name
bag bag of holding Wallet of Perseus[1]
candle magic candle The Candle of Eternal Flame[2]
amulet amulet of ESP The Eye of the Aethiopica
gray stone luckstone The Heart of Ahriman
magic boots speed boots Whisperfeet
magic cloak cloak of displacement Deluder
magic gloves gauntlets of dexterity Gauntlets of Defense
magic helmet helm of brilliance The Mitre of Holiness
magic helmet helm of telepathy The Crown of Saint Edward
whistle magic whistle The Storm Whistle[3]
  1. Trivially identifiable in SLASH'EM with the showweight option enabled.
  2. Trivially identifiable by having a light radius of 3, vs. 2 for normal candles.
  3. Easily identified by applying it.

GruntHack

In GruntHack, items can now bear the same name as an artifact, removing the ability to determine object identities this way.