- get g++:
sudo apt-get install g++
- get expat, zlib, libpng, etc:
sudo apt-get install zlib1g-dev libvorbis-dev libogg-dev libpng-dev libexpat1-dev
- get freetype and subversion (recommended):
sudo apt-get install libfreetype6-dev subversion
- get allegro:
sudo apt-get install liballegro4.2 liballegro4.2-dev liballegro4.2-plugin-esd
- get hawkNL 1.6.8 and extract
cd to new dir,make -f makefile.linux
thensudo make -f makefile.linux install
- get Dumb 0.92 ("fixed" version) and extract
cd to new directory,make
andsudo make install
You will be asked two questions. Say 'Y' when asked if it should support Allegro. When prompted for the path, just push Enter and use the default path, /usr/local/. - update the dynamic linker cache. (See this post )
add "/usr/local/lib" to /etc/ld.so.conf, if it isn't already there (Feisty users might have to do this)
sudo echo "/usr/local/lib" >> /etc.ld.so.confsudo ldconfig
- get SVN ufo2000 (beta 1071 didn't work, beta 1086 does)
svn co https://ufo2000.svn.sourceforge.net/svnroot/ufo2000 ufo2000
and cd into trunk directory OR get the latest beta, extract it, and cd into the root directory of ufo. Note: You will only be able to play people using the same version as you. -
make
- get sqlite3-dev for server:
sudo apt-get install libsqlite3-dev
- build the server:
make server
- If you had no errors, UFO should be built! Conratulations!
Look for the ufo2000 and ufo2000-srv executables in the root directory.
Troubleshooting Sound
The initialization messages flash briefly before the title screen appears. It's very difficult to read these when you're interested in them, and they contain the sound initialization messages. To get these messages printed on the terminal you used to launch the program, edit ufo2000.ini in the game's root directory. Find the flag that says to direct console output to standard output, and set it to 1. Next time you run ufo2000, you will be able to read the initialization messages. Might be a good idea not to have it fullscreen, as well.
# Copy init output to stdout F_LOGTOSTDOUT = 1
If you get the following error:
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directoryDon't panic. That just means allegro tried to initialize sound with MIDI support, but couldn't detect it (MIDI on linux isn't exactly solid). It will then try to initialize the sound with no MIDI support, and hopefully that will work.
Unfortunately, it doesn't seem to work with my setup of Pulseaudio:
Error initialising sound system: ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument Failed.
but most people shouldn't be running that (if you're not sure, chances are you're not running it).
If you are running pulseaudio, you can get around it by temporarily killing the pulseaudio daemon.
pulseaudio -kand starting it again after you're done playing UFO2K.
pulseaudio -DI've done lots of testing to try and figure out what the problem is, and it could just be my ~/.asoundrc has become a little funky over time. Unfortunately, I have no 'graceful' solution for this... :/ I discovered that forcing allegro to initialize with ESD instead of AUTODETECT (which chooses ALSA) would give me sound while running pulseaudio, but the lag of ESD was not worth it. I believe this is a bug somewhere in Pulseaudio or Allegro, but I'm not sure which. ^.^
Hope that helps someone!
Edited by Kratos, 11 March 2008 - 07:00 PM.