Garmin Edge 205 GPS Cycle Training Tool
Reading Email with PHP and IMAP/POP3
Using Multi-Byte Character Sets in PHP (Unicode, UTF-8, etc)
Using PHP pspell Spell Check Functions with a Custom Dictionary
Development Resource Project
Installing Proprietary nVidia Drivers on Ubuntu Linux

Compiling and Installing Freespace 2 on Ubuntu Linux

Sunday, 30 December 07, 3:31 pm
Rich
The first thing to do is install Freespace 2 under WINE (you will need WINE already installed and configured for this step). If you have the retail CDs, insert the first disk, browse to it in nautilus and double click the setup.exe file. As a Windows executable, it should start up using WINE. If you don't own the retail disks, read up on the open freespace wiki and forums for other methods of getting hold of the necessary data files for the game.

Proceed through the setup as if on Windows, but without the nagging feeling of nausea. I installed to the default location, although you may be able to install to another location. The only thing you may get stuck on is when it asks for the next disk - here you just need to put in the required disk, and change the path in the dialog accordingly (eg when you put in the 2nd disk, change the path from /media/cdrom/FREESPACE2_1/ to /media/cdrom/FREESPACE2_2/).

Once installed, you can try to run the retail .exe using WINE if you like, although I found the graphics to be a bit glitchy and there was no sound. In fact, it was while I was googling for info on these problems that I discovered that Freespace 2 had been made open source by its developers before they went bust, and that the community had gone and made a native Linux version of the game. The Open Source version even has a few improvements, as well as a handful of cool-looking mods and total conversions available. I thought I'd give it a try, and after a couple of teething troubles it now works perfectly.

The project wiki has a guide for the compilation and install process which I followed.

You need CVS:

sudo apt-get install cvs

and a bunch of development libraries (the following should be typed on a single line):

sudo apt-get install libopenal-dev libvorbis-dev build-essential automake1.9 autoconf libsdl-dev libtheora-dev

Now create a folder in your home directory called CVS for CVS source code. In that folder, create a script called cofs2 (for 'checkout freespace 2'), and paste in the following commands:

#!/bin/bash
CVS="cvs -d:pserver:anonymous:anonymous@warpcore.org:/home/fs2source/cvsroot"
MODULE="fs2_open"
BRANCH="${*}"

${CVS} co -d ${BRANCH} -r ${BRANCH} ${MODULE}


Save it, navigate to your CVS directory from a terminal, and run it specifying the branch you wish to checkout (fs2_open_3_6_9 for the most recent stable release):

cd ~/CVS
./cofs2 fs2_open_3_6_9


This will create a folder off ~/CVS called fs2_open_3_6_9. Go into that directory, and run the autogen.sh file to set up your environment for compiling the game:

cd ~/CVS/fs2_open_3_6_9
./autogen.sh


It may take a minute or two to run. The last line of its output should read Now type `make' to compile fs2_open. (Note that you only need to run this script the first time you checkout the project)

So go ahead and run the make command. It will splurge out a lot of compilation info, including various C++ compile warnings. Once it's finished, you should have a directory in the fs2_open_3_6_9 folder called code, within which lurks the newly-compiled Linux executable, fs2_open_r. We're nearly good to go.

Copy this executable to the Freespace 2 directory created by WINE when you installed the game off the CDs. If you've used the default locations for everything, run the following command:

cp ~/CVS/fs2_open_3_6_9/code/fs2_open_r ~/.wine/drive_c/Games/FreeSpace2

You should now be able to play the game by running this executable. There are a host of command line options you can specify for it, which enable certain effects and enhancements, so it's worth making a script in your home directory to start the game:

cd ~/.wine/drive_c/Games/FreeSpace2/
./fs2_open_r -spec -env -glow -cell -mipmap -missile_lighting -dualscanlines -orbradar -ship_choice_3d -targetinfo -3dwarp -warp_flash -snd_preload -safeloading


The game also looks for a file called .openalrc in your home directory in order to set up audio. If you do not already have this file, create it with the following contents:

(define devices '( alsa native ))
(define speaker-num '( 2 ))


Having this file present fixes a lot of sound problems, such as stuttering sound or no sound at all. It's also necessary to change a config file to specify the screen resolution and colour depth you want freespace to use. First though, you need to run the game once (in the default 16-bit 640x480 resolution). You can exit straightaway, and there should now be a folder off your home directory called fs2_open, and containing a file called fs2_open.ini, amongst other things. Open this file and change the line which reads VideocardFs2open=OGL -(640x480)x16 bit to the resolution you wish to use, eg VideocardFs2open=OGL -(1024x768)x32 bit. Now start the game, and enjoy!
 
Leave Comment