Compiling for Linux (UFO2000)

From UFOpaedia
Jump to: navigation, search

Introduction

UFO2000 is written in portable C, so of course it is also possible, to compile it on linux. The following instructions have been tested on an Ubuntu 14.04 x64 without any additional software or libraries installed by the user. The apt-get-commands should work on any Debian-related Linux. If you run a different distribution, you may need the corresponding commands and library-names. There's also a Video about how to compile and set up UFO2000 on Linux.

Compiling the game

Requirements for the game

In principle, you only need a few libraries like allegro or dumb:

  • build-essential (only for compilation)
  • subversion (only for downloading the code)
  • liballegro4.2-dev
  • libexpat1-dev
  • zlib1g-dev
  • libfreetype6-dev
  • libdumb1-dev (only necessary for ogg-music-files)
  • libpng12-dev (usually already there, at least with an Ubuntu 14.04)

You also will need these libraries on a target computer, if you intend to copy an already compiled UFO2000 version, for running. As well, you will need Subversion for downloading the source-files, which can be installed like this:

sudo apt-get install subversion

To install them all at once, run:

sudo apt-get install build-essential liballegro4.2-dev libexpat1-dev zlib1g-dev libfreetype6-dev libdumb1-dev libpng12-dev subversion

It is also recommended, to have X-COM and TFTD original files at hand for the game, but it is not necessary for playing.

So now we're ready to compile UFO2000. You will need the source-files as well:

svn checkout svn://svn.code.sf.net/p/ufo2000/code/trunk ufo2000-code
cd ufo2000-code

This downloads the current svn-version of UFO2000 into the directory ufo2000-code and switches into that new directory. You can as well get that with the .tar.bz2-file from the project site.

Compiling the game

You have two options for compiling UFO2000. Easy way with ogg-music-support:

make

Or if you prefer not to have ogg-support:

make no_dumbogg=1

Getting ready to play

UFO2000 doesn't exactly rely on files from original X-COM, but if you have it, or TFTD for that matter, you might want to copy the files into the folders XCOM and TFTD after compilation. You will have a much better game experience. For further information, see Quick guide to UFO2000 online playing. One piece of warning: The game needs writing-permissions to the games own folder in order to save settings, squad-files and replays. So do not place it somewhere, useres don't have write permissions.

Compiling the server

Requirements for the server

For the server you (only) need these libraries:

  • build-essential (only for compilation)
  • subversion (only for downloading the code)
  • libhawknl-dev
  • libsqlite3-dev

Same as for the game goes here: If you intend to copy the serverfile to another system, you will also need these libraries there for running. As well, you will need Subversion for downloading the source-files, which can be installed like this:

sudo apt-get install subversion

To install them all at once, run:

sudo apt-get install build-essential libhawknl-dev libsqlite3-dev subversion

You also will need the source-files (if you don't already have them from compiling the game):

svn checkout svn://svn.code.sf.net/p/ufo2000/code/trunk ufo2000-code
cd ufo2000-code

This downloads the current svn-version of UFO2000 into the directory ufo2000-code and switches into that new directory. You can as well get that with the .tar.bz2-file from the project site.

Compiling the server

For this there is only one command necessary:

make server

That's it. You then should find a binary named ufo2000-srv. You can now start it on demand from console/script or start it with an init-script of some kind. There's also the option to run it in demonized mode, but there have been reports of problems with that, so one might refrain from using it. For running the server, have a look at Setting up an UFO2000 server.