How to compile the game from sources, on GNU/Linux.
Compiling on Windows, is usually a nightmare. Yes, it is, and thus should be avoided.
For compiling on Windows, using VS2010 Express see this Wiki page.
Compiling Stunt Rally on Ubuntu using CMake is quite easy.
Recently (on 14.04) all dependencies can be just installed using apt-get.
This is the recommended way, even if you don't know any Ubuntu OS or GNU/Linux at all.
On other GNU/Linux distributions building probably isn't much trouble,
if you know how to build 1 or 2 dependencies from sources (if they aren't available).
It is recommended that you get the latest version directly from the Git code repository.
Use software manager to install git or this command:
sudo apt-get install git
Then, use these commands to get sources:
git clone --depth=1 git://github.com/stuntrally/stuntrally.git stuntrally cd stuntrally/data git clone --depth=1 git://github.com/stuntrally/tracks.git tracks
This will get sources to a directory called “stuntrally” and inside it will download the tracks to a subdirectory “data/tracks”.
If you got sources some other way, be sure to have tracks/ inside data/.
Note: The parameter –depth=1 tells git to not get history (to lower download time and space).
This way data is about: 300 MB and 500 MB for tracks.
With history it's quite big: 500 MB and 1,5 GB for tracks.
If you want to use a (stable) release version, instead of the (latest) development version,
use the following command (replace 2.6 with the desired version number):
git checkout 2.6
You can see the available versions with the following:
git tag
Here's a list of libraries you will need.
Newer versions should be used (except Ogre), listed here are only minimal versions needed (for VM with Ubuntu 12.04 LTS).
| Library | Downloads page | Sources |
|---|---|---|
| OGRE 1.9 (or 1.10) with plugins: OgrePaging, OgreTerrain, Plugin_ParticleFX | http://www.ogre3d.org/download | https://bitbucket.org/sinbad/ogre |
| MyGUI 3.2 with Ogre support | http://mygui.info | http://github.com/MyGUI/mygui |
| SDL2 | http://libsdl.org/download-2.0.php | http://libsdl.org/hg.php |
| OGG, VorbisFile | http://xiph.org/downloads | |
| Boost (system, thread, filesystem, wave) | http://www.boost.org/users/download | |
| ENet | http://enet.bespin.org/Downloads.html | https://github.com/lsalzman/enet |
| Bullet Physics 2.81 | http://www.bulletphysics.org/Bullet/phpBB3/viewforum.php?f=18 | https://github.com/bulletphysics/bullet3 |
| OpenAL Soft 1.13 | http://kcat.strangesoft.net/openal.html | https://github.com/kcat/openal-soft |
Either install them from your distribution's package manager (including the -dev packages), or download and compile them yourself.
In Ubuntu, those commands should get you all dependencies.
sudo apt-get update sudo apt-get install --assume-yes git cmake g++ # boost sudo apt-get install --assume-yes libboost-wave-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev # graphics sudo apt-get install --assume-yes libogre-1.9-dev libmygui-dev libsdl2-dev # sound sudo apt-get install --assume-yes libogg-dev libvorbis-dev libenet-dev libopenal-dev # bullet sudo apt-get install --assume-yes libbullet-dev libbullet-extras-dev
Note1: extras may be already inside libbullet, on older. Needed for BulletFileLoader and BulletWorldImporter.
Note2: libbullet and libopenal are present since ver 2.6 or master since late Aug 2015.
These are included in sources and compiled with project (no need to do anything):
Marked modified sources with #.
Project is written in C++. For compilation, we use CMake.
Use following commands (for Unix-like shell environments, such as Bash or MSYS):
cd stuntrally # Change directory to the game sources mkdir build # Create a build directory cd build # Change to the build directory cmake .. # Create build files make -j4 # Compile using 4 threads (change to your number of CPUs) # Optionally install everything (you can run without installing) make install # might need administrator privileges
If you get errors on the “cmake”-step, you are most likely missing some library or CMake couldn't find it. Install the development files for the library in question and if automatic finding fails, tell the paths to CMake manually. On Windows you should be able to open up a graphical interface by double-clicking the CMakeCache.txt file in the build directory. Similar interface is also available on other platforms, but the command-line alternative “ccmake” is also quite popular on GNU/Linux.
CMake has various generators besides Makefiles for you to choose from, including Visual Studio, Eclipse CDT and Code::Blocks project files.
Here's some variables that come in handy frequently. You can set them on command line by: cmake -DVARIABLE_NAME=VALUE or use one of the GUIs.
make install is invoked (on GNU/Linux, usually /usr or /usr/local).For more information about CMake, see the documentation and wiki.
Once everything is compiled, you can run the game from the build directory (./stuntrally).
If you didn't use CMake, you'll probably have the exe in the source root, from where you can also run the game.
Same also applies to the editor, which is called sr-editor.
More information available in the Running wiki page.