Install Steps: 0) Prerequisites: You will need the XPM library to compile the client. If you want to run the gtk client, you will need to install the gtk libraries. If you want png support, you will need to install the png library. If you want sdl support ( recommended) you will need both gtk and png as well as the main SDL library and the SDL_image library, both of which can be found at http://www.libsdl.org if not already installed on your system. 1) type './configure' to configure for your OS/system. Most options normally understood by configure should be available. The configure script will try to make all the right decisions. It will search for the needed libraries and headers. You may need to give hints on the locations of some files (png library, gtk library). If configure finds gtk libraries, it will build the gcfclient in addition to the cfclient. If you don't want this (only cfclient), use the --disable-gtk (there is no way to disable the cfclient at this time - if you are able to compile the gtk client, you also have all the tools for for the cfclient). If SDL libraries are found on your system, SDL support is automatically compiled it (Note: only the gcfclient supports sdl). Use --disable-sdl if you don't want this. The system will use the new sound system if available (this is a separate sound daemon). If you want to use the built-in sound system, use the --enable-old-sound. See sound notes further down. To specify additional places to find header files, use the --with-includes=value - this includes any -I or other options to provide the compiler. Example: ./configure --with-includes="-I/usr/local/include -I/opt/xpm/include" Similarly, there is a --with-ldflags option. Example: ./configure --with-ldflags="-L/usr/local/lib -R/usr/local/lib" -R is used on many systems to specify run location for libraries so you don't need to set LD_LIBRARY_PATH. Generally, if you are setting --with-includes, your probably need to set --with-ldflags, as if one is not in a standard place, the other probably is not either. The client works with the 0.5 version of the ALSA sound system. If you are using a newer version and are having troubles compiling, try running configure with the '--disable-alsa' option. 2) Type 'make depend; make' to compile the client. If you get link errors, it may be because you have an older version of the gtk libraries. If you get errors like 'can't find target client.c', your make program isn't very good and use should get/use gnu make instead. 3) Type 'make install' to install the binaries. 4) The client can be run by typing 'cfclient' for the X11 version, gcfclient for the gtk client, gcfclient -sdl for the SDL version. ------------------------------------------------------------------------------ Converting keybindings from old save files for use with the client: 1) You will need to get a copy of your character file. 2) Type "mkdir ~/.crossfire". This will automatically be done the first time you run the client. 3) Type awk 'BEGIN {ORS=" "} /^key / {for (i=2; i<=NF; i++) print $i;printf "\n"}' infile > ~/.crossfire/keys (Note that this should all be entered on one line, but is broken up here to be more readable.) 'infile' is the name of the character file. Note that the client use global keybindings, and not per character. This means that the same keybindings will be for all characters you play with the client. The gtk client and x11 client both use the same keybindings file. ------------------------------------------------------------------------------ Sound support: If you wnat sound support (only useful if you have a system that has good sound hardware), you will also need to get some sounds for the program. You will need the raw sound files - the .au files no longer work with the client. The sounds file determines what file is played for what sound. The default location for the sound files is <prefix>/share/cfclient/sounds. <prefix> is the -prefix= option given when running configure, default of /usr/local. You can set this to another directory at the configure stage by using --with-sound-dir=/some/directory. This file is only used for compiled in defaults. If you have a ~/.crossfire/sounds file (some format), that file will be used instead of the built in defaults. Sound are now played by separate process invoked from crossfire client. The process - called sound server - adjusts sounds' volume according to relative position of player and sound source on map and mixes the sounds together, so many sounds can be played simultaneously. CONFIG FILE The config file ~/.crossfire/sndconfig contains some configurable settings. If there is no such file, one with default settings will be created. The file contains following fields: stereo: 1 means stereo sound, 0 - mono bits: bitrate of generated sound - 8 or 16 16 means better quality, especially when more sounds are to be played simultaneously, but takes more memory signed: if we should sent signed data to the soundcard. 1 means yes. frequency: speed of playing data. This should be 11025, or sound pitch will change buffers: how many buffers to allocate buflen: how big the buffers should be. buffers*buflen shouldn't be smaller than the longest sound to be played. simultaneously: home many sound can be played at the same time. When this setting is bigger, each sound volume will decrease. HOW DOES IT WORK? The sound server gets information about sounds to be played on standard input. The information is a line: <sound number> <sound type> <relative x> <relative y> All those numbers are hex. The file ~/.crossfire/sounds contains description of sound numbers and types. For example: 3 0 5 0 Means that normal sound SOUND_FUMBLE spell should be played as it's source was 5 units to the right of player. Sounds are mixed in special buffers, which are in fact one buffer, which should be big enough for the biggest sound to be played. The buffers, if contain anything, are sent one by one to the sound device. Each buffer is cleaned after playing. Sounds data is multiplied by some ratio (<1) evaluated from it's position and volume and added to the buffers, starting from the next after the one being played. So bigger buffer means bigger delay, before the sound is actually played, but the smaller buffer is, the bigger is possibility, we won't succeed filling the next buffer, before last is played. ------------------------------------------------------------------------------ IMAGES The client will get any images that it is missing from the server. This can include the entire image set. To decrease bandwidth used when actually playing the sounds, it is suggested you download the image archive and install it. The default location for the archive is <prefix>/share/cfclient/, where <prefix> is determined by the -prefix= option given when running configure. The mechanism the client uses to find a matching image file when the server tells it an image name is thus: 1) Look in ~/.crossfire/gfx. If an image is found here, irrespective of the set and checksum of the image on the server, it will be used. The only way images are placed into the gfx directory is by the user actually copying them to that directory. The gfx directory allows a user to override images with versions he prefers. 2) Look in ~/.crossfire/image-cache then <prefix>/share/cfclient/crossfire-images. If the checksum matches the image from the respective directory is used. Note that if the checksums match, it really doesn't matter what image location we use, as it is the same image. 4) Get the image from the server. If -cache is set, a copy of it is put into ~/.crossfire/image-cache.