Compile and Play Nethack4

As I mentioned earlier, Nethack4 is an active variant of Nethack which currently only works online or on Linux. Several months ago I posted a “how to compile Nethack4” article on my main blog, but not here. Then the developer needed to change the way it compiles which made my instructions obsolete.  I figure it’s time to have an article showing you how to compile and play the game here, on my Nethack blog.

main menu for Nethack4

main menu for Nethack4

Nethack4 seems to be the closest fork to vanilla Nethack at this time – there are no new roles or races added, and I think the dungeon layout has not been changed. The reason you’d want to play it instead of regular Nethack is that the interface has been greatly improved and some easy typo deaths now warn you first (the options file lets you disable these warnings).

The homepage for Nethack4 is located here. You will want to download the current copy of the source file from here. Click on the “downloads” button on the upper right, to the left of the “clone” button (don’t worry about that button).

Unpack the .tgz file you just got (it should be 1.7 MB in size before unpacking), and you’ll have a new directory named “nitrohack-ais523”.  (Nitrohack was an older fork of Nethack, now obsolete due to some game-breaking bugs. The developer stopped maintaining it.)

Before you can compile Nethack4, you’ll need to install a number of files that it needs. The README file inside of the new directory lists most of them, but currently you need a couple of others.

On a Debian, Ubuntu, Mint, or similar system the files you need to install are:

– build-essential

– flex

– bison

– libjansson4

– zlib1g-dev

and if you want a working server, also install

– postgresql-server-dev-all

– postgresql-contrib-9.1 (to get “pgcrypto”)

Once you have all the files you need, open a terminal and cd into the nitrohack-ais523 directory. From there, issue the following commands:

mkdir build

 cd build

   ../aimake -i ~/nethack4 ..   #spaces are crucial in this command

This will create a new directory in your home folder called “nethack4” and compile and install a local copy of the game. It only makes a copy for the current user, but if you really want to make a system-wide copy available for everyone who uses your Linux system, the README will tell you how you can do that.

If you are using Windows, Nethack4 does (technically) compile and run, but the README indicates that, practically speaking, it’s so slow that you can’t play it. What I would personally recommend for Windows users is to play online. You can play online via connecting to nethack4.org via telnet or ssh (username “nethack”, password “nethack”).

Playing Nethack4

I tend to maximize the terminal to fill the screen. This makes the game easier to read. (Nethack4 currently has no option to use tiles).

An orc rogue on dungeon level 1

An orc rogue on dungeon level 1

The main menu will let you choose the following options:

n – start a new game. If you choose to let the game pick your race, gender, and role, you are shown the result before being asked to name the character. For someone like myself, who likes to pick names related to either the race or role, this is one of the many small improvements over vanilla Nethack.

l – load a saved game. Vanilla Nethack does let you keep several active characters at once and pick one each time you begin a game, but the way it’s done here is just more convenient. When you save a game, you are asked to either save, abandon the character, or cancel and keep playing.

v – view a character’s moves, one turn at a time. It defaults to the list of dead characters, but if you don’t have any you can view one of your currently active ones instead.

Turn by turn reviewing of a game

Turn by turn reviewing of a game

o – set options. A slightly more convenient way to toggle all the myriad of options in Nethack. This file persists between games.

s – to look at your current scores list (only completed characters – dead or ascended – will be shown).

c – connect to a server.

q – to quit the game.

News about Nethack

Last December 8 marked the tenth anniversary of the current release of “vanilla” Nethack. There has been no definite statement from the dev team that there will be no future releases, but it doesn’t seem very likely. As I’ve said before, this extended period of dormancy has spurred the creation of new versions of Nethack in an effort to fix the bugs that remain and introduce gameplay and interface options meant to make it a more enjoyable experience.

As of now, 18 January 2014, there are 3 or 4 actively maintained variants of Nethack that can be played offline (i.e. without connecting to a Nethack server). They are:

Nethack4 – this version differs the least from vanilla Nethack 3.4.3, unfortunately at the moment it’s not really possible to play on Windows except on a server. It runs great on Linux, though, and compiling it is simple once you have all the needed dependencies. This variant is updated fairly often. Created and maintained by Alex Smith

Dynahack – this version has a binary for Windows, which seems fine. It can be compiled for Linux but I’m having a minor difficulty doing that at the moment. The Windows version works great, aside from the fact that the terminal won’t let you really increase font size that much and won’t open full-screen. [Luckily, the final 2 options in Dynahack’s option menu allow you to set window height and width!]. Dynahack has a lot more changes in it than Nethack4 does. Like UnNetHack, you can play a vampire, and there is a new role of convict. DynaHack doesn’t make it easy to choose “conducts” as a challenge, which is something UnNetHack lets you do. Much like Nethack4 and Nitrohack, you can easily create and load several characters, and play on a server from the main menu screen. Created and maintained by Tung Nguyen.

picking a role in Dynahack

picking a role in Dynahack

UnNetHack – This variant has binaries for both Windows and Linux so it’s one of the quickest to get started with no matter which system you use. Current version is 5.1, released in December of 2013. There are quite a lot of changes in this from vanilla, including 3 new classes, a new race, and a tutorial mode. There are dungeon changes including a shorter Sokoban that has more variety in its puzzles, and the Town and Dragon Caves special areas. Some of the regular areas have been altered so as to increase variety between games. Veterans who ascend fairly regularly can also select “conducts” – voluntary challenges such as not praying, not eating meat (for non-monks), not reading anything ingame, etc – that make it more difficult to win. The Windows edition of UnNetHack includes both ASCII and a tiled version, and the tiles are quite nicely done. Created by Patrick Mueller

UnNetHackPlus – A fork of UnNetHack, approved of by Patrick. It seems to be mainly an increase in variety and challenges from UnNetHack.

Also available (but dormant) are GruntHack,  SporkHack and SLASH’EM.

Nitrohack is no more

About a week ago, I noticed that nitrohack.org had gone offline.  Apparently, that fork is no longer being maintained, but instead the effort is now being put into Nethack4, a combination of Acehack and Nitrohack. I have heard that Nitrohack had a bug that corrupted save files, which I can’t dispute even though I never had a problem in over 40 games. I speculate that my inability to survive beyond the Sokoban levels may be related to my non-corrupted saves, but there’s no way to be sure.

Nethack4 seems to be the current “unofficial sequel” to Nethack. Unfortunately there’s no binary at the moment, and compiling on Windows is not yet possible. My efforts to compile it on Linux haven’t succeeded yet, so the easiest way to play it is online (by ssh or telnet to nethack@nethack4.org).

NH4

One useful change in Nethack4 is that you receive a warning when you are about to eat tainted food. I appreciate things like that…it doesn’t make the game easier but just avoids some of the more annoying problems in the original game.

valk-startThis Valkyrie didn’t last too long, but I am out of practice. With some more playtime, I should manage to reach Minetown pretty consistently, and after that work on the Sokoban levels.

First Impressions of UnNethack

UnNetHack has a blog, a main website, and some public servers to play it online. Patric Mueller is the developer and he also has created Nethack-de, a German translation of Nethack.

One of the first things you’ll notice when firing up the game is that it offers a tutorial. No other variant of Nethack does this. Throughout the early game, either at specific turn points, or when something happens in the game, you get an explanation of what you can do, or find out about the environment around you.

Even if you don’t use the tutorial, you sometimes get hint scrolls during the game.

Only three roles are available if you choose the tutorial. I like the fact that they are your standard fighter/mage/archer archetypes, so you can choose the style of play you love while you learn. They also happen to be among the easier roles to play.

Also, the game allows you to issue context sensitive commands from inventory, like Nitrohack does. This is actually more useful here, since as far as I know UnNetHack does not display your inventory on the sidebar.

According to the Nethack wiki, some of the main differences are:

– the vampire player race, limited to the roles of barbarian, rogue, ranger, or wizard.

– some added monsters, items, and artifact changes.

– some patches, mostly to enable colors in menus and status lines, which improves the user interface.

– like Nitrohack, stairs leading to special levels are colored yellow.

– major changes in the Gehennom dungeon levels.

– dragons have significant differences from vanilla.

Also, if you like cavemen or rangers, they might start with a cat (in vanilla they can only have dogs).

So my first vampire character died, letting me discover that the page identifying your possessions encloses unknown info in brackets, and lets you know how many charges are on wands. Interesting.

Also, your “Final Attributes” screen gives more info, such as alignment status, monster difficulty level, and hunger level.

(I restarted the game with a ranger, a role I hadn’t really tried before. The following 3 pictures are from that character.)

One very useful feature is the “dungeon overview”, seen by pressing Ctrl-o. Notable features will be listed so you know where to return if, say, you want to drop some items on the nearest altar but forgot where it is.

Of course, UnNetHack just has to make Sokoban a little more difficult. It accomplishes that by not only flipping/mirroring levels, but using some from Slash’EM. Like this one… (the third [and last] puzzle I got).

[9/14/12 EDIT: In comments, the creator of UnNetHack reminded me to point out that unlike vanilla, there are only 3 levels of Sokoban (not 4), and you have a choice of three prizes to choose from instead of just two. That is probably to make up for the increased difficulty in each level]

Luckily I managed to solve the entire thing, and escaped with an amulet of reflection. Went back upstairs and entered the Gnomish Mines. I made my way to Minetown and discovered that UnNetHack pulls a special trick on occasion. (Sporkhack does the same, from what I understand).

Unfortunately, I didn’t survive too much longer after that. I was fairly low on ammo, was losing hp, and didn’t make sure to equip a helmet. So when I read a scroll of earth in desperation…

UnNethack is definitely an enjoyable variant and I’ll keep playing it. This ranger has done better than any other character I’ve been working on.

An Introduction to Nitrohack

One of the Nethack variants that is still active is called Nitrohack, being developed by Daniel Thaler. It has quickly supplanted vanilla Nethack for me, when I just want to play regular Nethack. I spent some time looking over the development logs on his site, and as far as I can tell, Nitrohack has no gameplay differences from Nethack. He has fixed numerous bugs, but nearly all of the changes made to vanilla have been in the area of interface improvement.

Now, if you are tired of the same old Nethack, you should see how UnNethack, Sporkhack, or Slash’EM suit you. I’ll devote future articles to each of them. But Nitrohack offers the exact same challenge as vanilla, with a much improved interface and options.

Here’s a screenshot of a recent (and my best) attempt with the Valkyrie role:

Sokoban level 1 – almost completed. Almost.

(yes, one reason I got so far is that I did indeed find the artifact “Vorpal Blade” on the second dungeon level. I also still had my pet alive, on the level below Sokoban 1)

Nitrohack is available in both Windows and Linux binaries, and also features access to its own server for online play. The Linux .deb files and static builds are both available in 32 and 64 bit versions.

When you run it, you have 7 menu options: New game, Load saved game, View replay, set Options, show Score list, Connect to a server, or Quit. Loading a save game is nice for me on Linux, because usually you have to run Nethack with the -u <player-name> option in order to create more than one character. View replay is just that – you can re-run through any character’s old game that you still have available, even the dead ones.

Improve your play by viewing past attempts step by step.

As you see above, Nitrohack lists your inventory on the right side of the screen (I like to play it with the terminal size maxed out). Objects occupying the same tile blink so you’ll notice that there’s more than one. The “:” command is superfluous, since your message space (below inventory) always tells you if you are standing on a square with some other object such as a throne, sink, or fountain. I haven’t checked yet, but I hope that the options file will let you adjust the relative sizes of all the frames.

Connecting to a server is cool because you don’t have to run Putty or some other program to connect, the online access is built in to Nitrohack. Of course, you can view current games by others, or play your own.

Try to ascend while the world watches!

Nitrohack, like some other variants, uses color to inform you of changes to your condition, power, and hp. It allows you to use the Numpad as your directional movement but also lets you use the arrow keys. This is great because on my old Crunchbang laptop, vanilla Nethack by default only uses the vi keys for movement, and I cannot use arrow keys at all.

So if you are new to Nethack addiction, I’d strongly recommend you try Nitrohack. It fixes some of the most annoying interface issues with the original game, in my opinion, while maintaining the same play experience. I’m going to check out how the other variants change the game, but I don’t think people should skip the original game completely. After all, if you don’t know how Nethack plays, you won’t really appreciate the improvements or changes that the variants have made.

Race and Role options in the Nethack variants

The variants of vanilla Nethack don’t, for the most part, add a lot of extra choices for character creation. Sporkhack and Nitrohack have no additional races or roles.

Unnethack lets you play as a vampire race, but has no extra roles. In Grunthack, you can play as a kobold, ogre, or giant, but otherwise seems just like vanilla.

In Sporkhack, although you have no extra roles, all races can play any role.

Slash’EM is the one variant that really throws a lot more options at you – in fact the Monk role in vanilla started out in Slash’EM. When you start a game of Slash’EM, you can pick a Flame Mage, Ice Mage, Necromancer, Undead Slayer, or Yeoman,  in addition to the base 13 roles. You can then choose to play as a doppelganger, drow, lycanthorpe, hobbit, or vampire if the role allows it. In Slash’EM normal elves are only lawful or neutral – if you want to be a chaotic elf, you’re going to need to play a drow.

The Nethack wiki has this to say about the playable races in vanilla, Sporkhack, and Nitrohack:   “Humans can be any alignment (subject to your chosen role allowing that alignment), but for the others, your race indirectly determines your alignment: dwarves are always lawful, gnomes are always neutral, and elves and orcs are always chaotic.
In general, dwarves are strong, elves and gnomes are smart, orcs are poison resistant, and humans are good all-rounders.”

Unique to Slash’EM is the concept of techniques. These are extra abilities each role and each race may get, that can be used every so often and improve as your character gains levels.

Here are typical starting equipment pictures for each role. These will vary somewhat but do give an idea of the sort of items that each one starts out with. Slash’EM roles are in bold, (Slash’EM races are in parentheses), and [Grunthack races are in brackets]. Unnethack vampires have the same 4 role options as Slash’EM vampires do.

Archeologist – can be human, dwarf, or gnome (or doppelganger).

Barbarian – can be human or orc (or doppelganger, drow, vampire) [or ogre, giant].

Caveman/woman – can be human, dwarf, or orc (or doppelganger) [or ogre, giant].

Flame Mage – (can be doppelganger, drow, elf, gnome, hobbit, human, orc).

Healer – can be human or gnome (or doppelganger) [or giant].

Ice Mage – (can be doppelganger, drow, elf, gnome, hobbit, human, orc, or vampire).

Knight – can be human only [or elf].

Monk – can be human (or doppelganger, hobbit) [or elf].

Necromancer – (can be doppelganger, drow, human, orc, or vampire).

Priest/ess – can be human or elf (or doppelganger, drow, or hobbit) [or giant].

Ranger – can be human, elf, gnome, or orc (or doppelganger, drow, hobbit, lycanthorpe, or vampire) [or kobold].

Rogue – can be human or orc (or doppelganger, lycanthrope, or vampire) [or kobold, ogre].

Samurai – can be human only.

Tourist  – can be human only (or doppelganger, hobbit).

Undead Slayer – (can be doppelganger, drow, elf, gnome, hobbit, human, lycanthrope or orc).

Valkyrie – can be human or dwarf (or doppelganger) [or giant].

Wizard – can be human, elf, gnome or orc (or doppelganger, drow, hobbit, or vampire) [or kobold, ogre, giant].

Yeoman – (can be elf, hobbit, or human).

I was somewhat surprised to see that in Slash’EM, hobbits cannot be rogues. I guess none of the developers read The Hobbit?

I’ll go into more details about the racial benefits/drawbacks and the Slash’EM techniques in a later post.