Building Bitfighter
This page is dedicated to getting Bitfighter to build on your system of choice. Some useful links:
Also, please see the README.txt included in the source.
Source Code
Bitfighter uses Mercurial (hg) to manage the source code. Here is some useful Mercurial information:
The Bitfighter code can be found here:
If you have Mercurial installed, you can easily check out a copy of the source code by running this command in a terminal in a folder of your chosing:
hg clone https://code.google.com/p/bitfighter/
After checking out the code, if you don't want to compile the current development version, you can update to a specific released version. To see a list of released versions, type in:
hg tags
We recommend to always chose the latest release as the build instructions for older releases will be different that what is shown here on this wiki page. Update to a release that you want:
hg up bitfighter-019d
Windows
We have migrated to [CMake http://www.cmake.org/] for Windows builds in version 019 and later (and currently in the most recent development code). Note that we recommend using Visual Studio 2013 (though other versions will work) for the building environment on Windows. To build:
- Install CMake from http://www.cmake.org/
- In a terminal, change to the 'build' directory in the bitfighter source code tree.
- Run the following command (A list of CMake 'generators' for different build environments can be found [here http://www.cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html#manual:cmake-generators(7)]):
- cmake -G "Visual Studio 12 2013" .. # Substitute a different generator if you like
- Open the resulting Visual Studio solution file
- To run and debug, you may need to right click "Bitfighter" in solution explorer, and choose "Set as StartUp Project" (the active project is shown in bold text)
Linux
Detailed Instructions
Bitfighter should build on any major flavor of Linux. It has been tested and is known to work on Ubuntu, LinuxMint, Centos, Fedora, Debian, Mandriva and openSUSE. If you can not get it to work, you can try running it in wine: [1]
Bitfighter has several common, open source dependencies:
- SDL
- zlib
- libpng
- openal
- libvorbis
- libspeex
- libmodplug
You must install these and their development headers using your distribution's preferred method. The development headers for these libraries have similar names with a suffix, for example:
- libvorbis-dev or vorbis-devel
You will also need the following to compile:
- cmake
- make
- gcc / g++
Once your dependencies are installed, you can build bitfighter with these steps:
- cd build
- cmake ..
- make
If you want to build a dedicated server (with no GUI), replace the 'make' step above with:
- make bitfighterd
Next, you'll need to copy the resources to where the executable was built:
- cd ../exe
- cp -r ../resource/* .
And if you wish to run in standalone mode, create a standalone.txt file in the 'exe' folder to trigger this mode:
- touch standalone.txt
Centos Dedicated Server Instructions (Easy!)
Building a dedicated server on a typical clean Centos 5 or 6 virtual server instance
# We recommend that you install and run a dedicated bitfighter server with a special # user account used only for this purpose, that does not have root access. # First, create a bitfighter user; you can skip this step if you want to use an # existing account useradd bitfighter # Create the account passwd bitfighter # Set the password. Pick a good one! # Do the following as a user that has sudo privileges sudo yum update # system should be up to date # The following sets up the EPEL repository for extra packages (needed for mercurial) # Choose one based on your server architecture # 32 bit: sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # 64 bit: sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm sudo yum install mercurial gcc gcc-c++ zip ncurses-devel readline-devel patch cmake screen # Do the following as the bitfighter user su bitfighter cd ~ # Get the source code -- this will create a folder called bitfighter in your # current location. This may take a couple of minutes! hg clone https://code.google.com/p/bitfighter/ # Update to the tag/revision you want cd bitfighter hg up bitfighter-019d # Build the dedicated server (called bitfighterd) cd build cmake .. # Creates a Makefile for the next step; may emit warnings make bitfighterd # Copy required files into exe folder (found at the root of the code tree): cd ../exe cp -r ../resource/* . touch standalone.txt # Tell bitfighterd to run in portable mode (don't skip this!!)
OS X
We have migrated to CMake for OS X as well. You must have the following software installed (in addition to the bitfighter source code):
- CMake
- XCode (includes development libraries and compilers)
To build:
- Open a terminal
- Set up the compatibility environment by running:
- export MACOSX_DEPLOYMENT_TARGET=10.6
- change into the 'build' directory within the Bitfighter source
- Run CMake:
- cmake ..
- Build with 'make':
- make bitfighter
- The .app will be built in the 'exe' sub-folder of the main bitfighter source directory
Building with XCode is supported with CMake, but it is untested with Bitfighter. To do so:
- Open a terminal
- Set up the compatibility environment by running:
- export MACOSX_DEPLOYMENT_TARGET=10.6
- change into the 'build' directory within the Bitfighter source
- Run CMake using the Xcode generator:
- cmake -G Xcode ..
- This will create an Xcode project within the 'build' directory that you can open
Notes
- The bitfighter project also builds the tnl and libtomcrypt frameworks automatically before compiling the bitfighter source itself.
- The following frameworks are added automatically to the bundle:
- libtomcrypt.framework
- tnl.framework
- Openal-Soft.framework
- Settings are found in $HOME/Library/Application Support/Bitfighter