NetHack with Qt interface

version 1.0.1
(for NetHack 3.2.2)

by Warwick Allison

warwick@troll.no

What is it?

NetHack is a Free graphical one-player roleplaying game with a highly modular window system interface supporting TTY, VGA, Mac, Amiga, and other displays. Qt is a graphical user interface toolkit. So, "NetHack with Qt interface" is a version of NetHack which has a user interface module written using the Qt toolkit.

What's new?

Version 1.0.1:

old changes...

What does it look like?


(click for larger version)

Where do I get it?

Currently, a Linux binary and a Windows 95/NT binary are supplied, but since all the sources for Qt are available under X11, any platform running X11 should be able to run Qt NetHack - see the compilation instructions below.

How is it better than the plain X11 interface?

The Qt interface has these extra features:

The standard NetHack X11 interface is written in C using the Athena Widgets toolkit. The strongest reason for doing it that way was that NetHack is one of the most incredibly portable programs of any kind, and the Athena Widget Set is also available for free on a large number of X11 implementations. The problem is that Athena Widgets (also known as Xaw) is very ugly, difficult to program in, and buggy. The Qt interface toolkit on the other hand is written in C++ and is freely portable to any X11 implementation, but is less widespread, making it inappropriate for the standard NetHack X11 interface.

Sound support

The QtNetHack patch includes experimental support for sounds to be played based on messages under X11. For example, you can arrange for a gong to sound when the message "... cursing shoplifter..." appears. The system maps any regular expression (can be just some text) to a sound. The QtNetHack windowport is the only one providing this method, and it does so using the NAS (Network Audio System) . As distributed, the patch enables this feature - see include/config.h once you have applied the patch, and look for USER_SOUNDS for an explanation of how to disable it if you want to.

You will also want to collect some sound samples to try it out, and a .nethackrc attaching them to messages. This package contains the .au files that I use, and my ~/.nethackrc. Many of the sounds are from the nhsound package, which you can find referenced on the NetHack Home Page. Note: Nethack runs as the user games, so be sure that user can read your ~/.nethackrc or it will be ignored.

Installing a Linux binary

Two binaries are supplied:

Follow the instruction in one of the following section, and you will then have a program /usr/games/nethack (which can usually be run just by typing "nethack"). Note that this will overwrite any previous version of NetHack, as the package places everthing in the standard NetHack directories.

Qt NetHack 1.0.1, static

For this version, simply install this package by typing (as root or look here):
  cd /
  tar xfvpz .../qnethack-3.2.2.1.0.1.bin.Linux.static.tar.gz
This binary also includes version 0.9 of the fabulous Wizard Patch from Larry Stewart-Zerba.

Qt NetHack 0.93, dynamic

To install this version, you first need to install the libraries of the Qt toolkit. QtNetHack 0.93 requires the latest stable Qt version.

Install Qt and test that it works (eg. build the example programs) before proceeding.

Note that this is a former version of Qt NetHack provided for those not wishing to use a big static binary or to use a snapshot Qt. I would rather not have bug reports for this version.

Install this package by typing (as root or look here):

  cd /
  tar xfvpz .../nh3.2.2qt0.93Linux-ELF.tar.gz
This binary also includes version 0.8 of the fabulous Wizard Patch from Larry Stewart-Zerba.

No root access?

If you don't have root access to your Linux machine, you can still install Qt NetHack by:
  cd somewhere
  tar xfvpz .../whichever.tar.gz
  vi usr/games/nethack
Edit HACKDIR=blah/nethackdir to point to somewhere you have write-access to, eg.:
     HACKDIR=$HOME/lib/nethackdir
Move usr/games/lib/nethackdir to wherever you said above, eg:
  mv usr/games/lib/nethackdir $HOME/lib
Move usr/games/nethack to somewhere in your $PATH, eg:
  mv usr/games/nethack $HOME/bin/nethack
Done!

Installing the Windows 95/NT binary

Run this self-exracting archive to extract Qt NetHack to the top level of one of your drives (eg. C:\). You will then have a program \games\qnethack\nethack.exe This binary also includes version 0.9 of the fabulous Wizard Patch from Larry Stewart-Zerba.

The Windows 95/NT Qt NetHack binary uses exactly the source code provided for the X11 version (of course, it uses the Win32 nethack main engine code, not the Unix code). The recompile, you will need a compiler for Windows 95/NT such as Visual C++, Borland C++, Symantec C++, or Watcom C++, and a professional Qt license.

Installing via Source Code

If you want, you can use the source code to build Qt NetHack 1.0.1. You will need the latest snapshot release of the Qt library (see www.troll.no), and you will need to install the full sources of NetHack 3.2.2

Install the NetHack sources, as described here, then unpack my source code from the win subdirectory of your installation:

	cd win
	gunzip .../qnethack-3.2.2.1.0.1.src.tar.gz
	tar xf .../qnethack-3.2.2.1.0.1.src.tar
In the created Qt subdirectory, you will find a patch file. From the top-level of the NetHack source directory (ie. above the "win" directory where you did the unpacking), type:
	cd ..
	patch -s < win/Qt/nhqt.patch
	(or patch -p0 -s < win/Qt/nhqt.patch )
This will reconfigure the standard NetHack sources to be able to build a Qt version. Patches to configure for Linux, and the Wizard Patch (version 0.9) are in the win/Qt/ of the distribution. You will probably want to edit the following files, just as you would have to for installing any NetHack version, to configure NetHack for your operating system (the default is SunOS4): Don't worry, you'll only have to change a few obvious things. If you have problems, I suggest you try to get the X11 version working for your system prior to attempting the Qt version.

You will then have to go to the sys/unix subdirectory and run the setup.sh script and finally run "make install" from the top-level (these steps are required for any Unix build of NetHack):

	cd sys/unix
	./setup.sh
	cd ../..
	make install
After some time, you will have a compiled game for your system. Consider packaging up the binary and uploading it to an FTP site appropriate for other users of your system, but please try to stay up-to-date with my new releases if you do so. As distributed, all files are in the directory /usr/games/lib/nethackdir, plus the script /usr/games/nethack.

If you make any changes, then send them to me so that they can be in future releases. Eventually I hope to incorporate the Qt interface into the official NetHack distributions.

Compiling for Windows 95/NT is similar, but follow the instructions in sys/winnt/Install.nt

THANKS!

Thanks to the NetHack DevTeam for the greatest game ever made; and of course, thanks to my employer Troll Tech for the Qt I used to write the interface!

What's old

These used to be "What's New".

Version 0.93:

Version 0.7:

Version 0.6:

Version 0.5:

Version 0.4:

Version 0.3:

Version 0.2:

Version 0.1: