Compile-time options

From NetHackWiki
(Redirected from Compile-time option)
Jump to navigation Jump to search

Compile-time options are certain features of NetHack that can be enabled or disabled when the game is compiled, that is, built afresh from the source code. Most of these can be selected in config.h, in particular, at the end of this file, or on a UNIX, in a hints file.

This article is principally about those compile-time options that affect gameplay by adding or removing certain features of the game. Some features, such as compression of bones and save files, are enabled by similar means to the options described here, but do not have a highly visible effect on the user's experience.

Many compile-time NetHack options change the format of the bones and save files, and will render these incompatible if they are changed.

Enabling or disabling options

In config.h

The options are mainly controlled by certain lines in config.h, which may look like this one:

#define KOPS		/* Keystone Kops by Scott R. Turner */

The above line enables the Keystone Kops. If it is commented out, then Kops no longer exist in the game, and a shopkeeper who is robbed will have to fend for himself:

/*#define KOPS*/		/* Keystone Kops by Scott R. Turner */

The /* and */ marks define a comment, a part of the source code that the compiler is instructed to ignore. Most newer compilers also accept a single-line comment like so:

//#define KOPS		/* Keystone Kops by Scott R. Turner */

In a hints file

On UNIX systems, the options can be specified in a hints file, eg. sys/unix/hints/linux, by adding lines like this:


which would define DUMPLOG


Most of the compile-time options in 3.4.3 were made unconditional in 3.6.


Output special console escape codes which act as hints for external programs such as EbonHack. Not enabled by default.


Execute an external program whenever a new message-window message is shown. The program to execute is given in environment variable NETHACK_MSGHANDLER. Not enabled by default.


Support highlighting of status fields. Enabled by default.


Enable the showscore-option. Not enabled by default.


Make the string input in TTY, Qt4, and X11 so some prompts will remember the previously input text. Not enabled by default.


Enable end-of-game dumplogs.


Set the file where dumplogs are saved. Can be set in sysconf.



SINKS is enabled by default in NetHack. If it is turned off, sinks do not appear; this may make the game harder, as it is no longer possible to get a random ring or a dishwasher by kicking a sink.


WALLIFIED_MAZE is enabled by default. If it is turned off, walls cannot be drawn with the more attractive box drawing characters via IBMgraphics or DECgraphics.


REINCARNATION is enabled by default. If it is turned off, the Rogue level does not appear.


KOPS is enabled by default. If it is turned off, the Keystone Kops do not appear, and a shopkeeper who is robbed will have to kill you himself.


SEDUCE is enabled by default. If it is turned off, foocubi become level-draining monsters similar to vampires. Unlike most options, SEDUCE does not affect bones/save compatibility.


STEED is enabled by default. If it is turned off, it is no longer possible to ride horses and other steeds, and saddles do not exist.


TOURIST is enabled by default. If it is turned off, the Tourist role is removed, along with Hawaiian shirts, T-shirts, credit cards (including the Platinum Yendorian Express Card), and expensive cameras.


ELBERETH is enabled by default. If it is turned off, engraving Elbereth does not repel monsters. Crowning is also removed, because the lawful crowned title is the Hand of Elbereth. There will still be engravings of Elbereth in the Castle and Sokoban levels, since level maps are defined outside the NetHack source code, but they will have no effect.


REDO is enabled by default. If it is turned off, control-A does not repeat the last command.


EXP_ON_BOTL is enabled by default. If it is turned off, the showexp option does not exist, and it is not possible to show the current experience points on the status display. This option sets a flag that is saved in the save file, and so EXP_ON_BOTL affects bones/save compatibility, even though one might expect that it would not.


SCORE_ON_BOTL is not enabled by default. If it is turned on, a showscore option is enabled, which shows the current score on the status display when set. Like EXP_ON_BOTL, this option sets a flag that is saved in the save file.


GOLDOBJ is not enabled by default. It enables an experimental feature, still being debugged, by which gold coins are considered an object like any other; currently your gold is stored separately from the rest of your inventory.


AUTOPICKUP_EXCEPTIONS is not enabled by default in the NetHack source code, though at least the official Linux binary includes it. If enabled, it is possible to specify, through options, certain objects that will or will not be automatically picked up in spite of the autopickup setting for their object type; using AUTOPICKUP_EXCEPTIONS, one can for instance specify that food rations are to be automatically picked up and cockatrice corpses are not. Without AUTOPICKUP_EXCEPTIONS, this distinction is not possible: either all food items are automatically picked up (by specifying % in pickup_types) or none are.


This can be found in unixconf.h. By default this is on, and it allows the user to escape to the command-line shell with !; Disabling this is a good idea on public servers.

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.