I (Remco Gerlich, email@example.com) am only the compiler of this FAQ; I don't think I actually contributed any of the answers. In fact, I asked most of these questions myself, I think :-).
Thanks to, among others, Greg Wooledge, Keldon Jones, Gwidon S. Naskrent, and Linley Henzell.
This FAQ assumes installing Angband 2.8.3, but it will work just the same with virtually any modern variant.
All of the extra files, patches and so on in this FAQ can be found in a tarball at http://www.thangorodrim.net/linux/faq_files.tar.gz.
This file itself is at http://www.thangorodrim.net/linux/faq.html (html) and http://www.thangorodrim.net/linux/faq.txt (text).
I put Angband 2.8.3 under /usr/local/games/angband/angband-283/, then make a symlink so that it is also called angband, so that when Angband 2.8.4 comes out I can put that in its own dir, and just change the symlink.
Place the .tar.gz in /usr/local/games/angband/, and type "tar xvzf angband-283.tar.gz", and it will untar itself into the right directory. If the source comes in .zip format, you should unzip it using "unzip -aL", so that filenames become lowercase, and any MS-DOS format text files are properly converted.
Some variants may unpack into a different dir, in which case you should rename it. "ln -s angband-283 angband" will make the symlink.
CFLAGS = -Wall -O2 -m486 -pipe -g -D"USE_XAW" -D"USE_GCU" LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lcursesThis supports both X windows and the console. For console only use:
CFLAGS = -Wall -O2 -m486 -pipe -D"USE_GCU" LIBS = -lcursesAnd for X Windows only use:
CFLAGS = -Wall -O2 -m486 -pipe -g -D"USE_XAW" LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11Most people will just want to support both.
With some variants, it will be called "testing", for some historical reason that probably looked like a good idea at the time. Rename it to something like "zangband".
If you are building the game as user "games", you can now do "chmod +xs angband" which makes the game executable for everyone, while turning on the "suid bit". That bit makes the game run as if it were user "games", so that the game has write access to savefiles and so on, but normal users don't.
cd /usr/local/games/angband/zangband TERM=linux-c-nc stty start undef exec ./zangband $1 $2 $3 $4 $5 TERM=linux stty start ^Q cd $OLDPWD clear resetThis one is for Zangband of course, to illustrate a few points. The directory is a symlink to zangband225e/, so I don't have to change this script every two days when a new Zangband comes out. I just change the link. The two TERM= lines are to set the terminal right for Keldon's new main-gcu, as explained in the console problems section. Also, Zangband uses ctrl-Q as a command, but that key has special meaning under Linux; the two stty commands turn that meaning off, and later on again, so that the key can be used. The "cd $OLDPWD" is useful, but may only work under bash, I'm don't know. The "reset" prevents the text from staying brown after the game finishes, a side effect of Keldon's gcu patches.
Or just run the game as ./angband in whatever directory you put it in.
In short, you take the new main-gcu.c and copy it into the src/ dir, and put the graf-gcu.prf in lib/user/. You also need a new terminfo entry. Get linux-c-nc.terminfo and compile it using "tic linux-c-nc.terminfo". Since this will put the compiled version at the right place for terminal definitions (/usr/share/terminfo/ under Red Hat linux), you will need to be root to do this. All these files are in the tarball that goes with this faq, see the top of this file.
Now use TERM=linux-c-nc before you run Angband in the console, and the colours will be fixed.
Note that some variants, like Zangband, already have the new gcu files, so that you only need the terminal file.
First you'll need a copy of the keymap normally used by your machine. On Red Hat-systems you can find out the name from the file /etc/sysconfig/keyboard. The keymaps reside in the directory /usr/lib/kbd/keytables, so you can propably figure out the one you use by looking at the filenames there. Copy this somewhere safe, like your homedirectory and use your favourite editor on the copy (not the original, mind you). The keymap might be compressed, so you might do well to run gunzip on it.
First we'll need to define the functions that the keys will be bound to, and make them produce strings that we can use to define the keyboard macros for Crawl. So enter the following lines into the keymap-file.
string F101 = "\033[1C~" string F102 = "\033[2C~" string F103 = "\033[3C~" string F104 = "\033[4C~" string F105 = "\033[5C~" string F106 = "\033[6C~" string F107 = "\033[7C~" string F108 = "\033[8C~" string F109 = "\033[9C~" string F111 = "\033[1S~" string F112 = "\033[2S~" string F113 = "\033[3S~" string F114 = "\033[4S~" string F115 = "\033[5S~" string F116 = "\033[6S~" string F117 = "\033[7S~" string F118 = "\033[8S~" string F119 = "\033[9S~"Then we need to bind the keys to the functions. Search for a line that along the lines of 'keycode xx = KP_7'. Add the following lines somewhere close to the line you found.
control keycode xx = F107 shift keycode xx = F117Of course, you'll need to replace the xx with the value you found in your own keymap-file. Now, whenever you press Shift-keypad 7 the computer acts as if you typed an escape, followed by '[7S~'. Repeat this for all keypad keys, i.e KP_1 - KP_9, but replace the final digit in the F1-strings with the number of the keypad key (ie. 'control keycode xx = F108 for KP_8). After that you can load your new keymap using the loadkeys program on the file.
The tarball contains my version of this, which is adapted from the us.map keymap that came with Red Hat 5.2. It may or may not work for you. It does the same thing with control as with shift.
This keymap can now be loaded with "loadkeys <filename>". It works for all virtual consoles, until the system reboots. You may want to put this in a bootup script.
Now that Linux can recognize the keys, we need to tell Angband what to do with them. For that, pref-gcu.prf needs extra keymaps. Put these into pref-gcu.prf (maybe some maintainers read this faq and put them there already :-)):
A:+0 P:\e[0C~ A:+1 P:\e[1C~ A:+2 P:\e[2C~ A:+3 P:\e[3C~ A:+4 P:\e[4C~ A:+5 P:\e[5C~ A:+6 P:\e[6C~ A:+7 P:\e[7C~ A:+8 P:\e[8C~ A:+9 P:\e[9C~ A:\\.1 P:\e[1S~ A:\\.2 P:\e[2S~ A:\\.3 P:\e[3S~ A:\\.4 P:\e[4S~ A:\\.5 P:\e[5S~ A:\\.6 P:\e[6S~ A:\\.7 P:\e[7S~ A:\\.8 P:\e[8S~ A:\\.9 P:\e[9S~ A:\\.0 P:\e[0S~
The fix for this is to use the "`" key, which is right below Escape on most keyboards. This is already compiled into Angband to work as a synonym for Escape, apparently. Takes a while to get used, but it's much faster.
Angband takes its default settings for Window sizes and so on from ~/.Xdefaults, like a good program should. Since this question is The Question Frequently Answered By Greg Wooledge, I'll just paste his .Xdefaults entries here:
angband*angband*font: 9x15 angband*angband*geometry: +300+220 angband*recall*font: 7x13 angband*term-1*font: 7x13 angband*recall*geometry: 80x15+460+0 angband*term-1*geometry: 80x15+460+0 angband*choice*font: 7x13 angband*term-2*font: 7x13 angband*choice*geometry: +0+440 angband*term-2*geometry: +0+440 angband*mirror*font: 7x13 angband*term-3*font: 7x13 angband*mirror*geometry: 80x15+460+590 angband*term-3*geometry: 80x15+460+590 angband*color6: #3070f0 angband*color7: #907027 angband*term-4*iconic: true angband*term-5*iconic: true angband*term-6*iconic: true angband*term-7*iconic: truePut this in your own .Xdefaults. It opens up the Angband Window, and three extras to be used as windows for monster recall, and so on. You may need to adjust the actual sizes of the windows and so on to your own wishes.
(yes, the last question is 10 times as long as its answer. I like that :-)).