[[TOC]] This page describes how to get the very latest unstable version of the code. Unless you want to actively follow and contribute to development, you probably want the [LatestRelease latest relatively-stable release] instead. The current release of the game is aimed at developers and not at 'normal' users. As such, the following instructions assume a reasonable level of technical proficiency. If you encounter difficulties, please post on the [http://www.wildfiregames.com/forum/index.php?showforum=312 forum]. == General prerequisites == You'll need: * An adequately high-spec computer - several gigabytes of free disk space, preferably at least 1GB of RAM for compiling, a fast CPU unless you want to spend ages waiting for the compiler, etc. Modern graphics hardware is also recommended, though the game can run (slowly) on fairly old devices (!GeForce 4, Intel 945GM, etc). * Up-to-date system software (Windows service packs, graphics driver updates, etc). * Some technical proficiency. We try to make the build process as smooth and painless as possible, but it's designed to be followed by programmers - if you just want to play the game, wait for a pre-packaged installer instead. == Windows == Windows 7, Vista and XP are the main supported versions; 2000 should work too but is rarely tested. Visual C++ 2010 and 2008, and 2005 with a sufficiently modern Platform SDK, are supported. Only 32-bit builds are supported (though they can be compiled and run on 64-bit Windows). === Acquiring the code === The game's code, data and build environment are stored on a Subversion server. The recommended way to get an up-to-date copy is with TortoiseSVN: * Download and install [http://tortoisesvn.net/ TortoiseSVN]. (Make sure you reboot when it asks you to.) * Use TortoiseSVN to check out `http://svn.wildfiregames.com/public/ps/trunk/`. This may take a while, and will use around 700MB of disk space. The [http://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html TortoiseSVN manual] has information on [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-checkout.html checking out], as well as [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-update.html updating] and [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html creating patches]. (This is the read-only public SVN URL. If you have commit access, you need to use `http://svn.wildfiregames.com/svn/ps/trunk/` instead.) === Setting up the build environment === The game must be compiled with Microsoft Visual C++. If you already have Visual C++ 2005 or 2008 installed, make sure you have SP1 and then continue. Otherwise, you can get the free Express edition: * [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Visual C++ 2008 Express Edition] is recommended as project files are currently only generated for 2005/2008 and the upgrade process is not perfect. * Or download and install [http://www.microsoft.com/express/Downloads/#2010-Visual-CPP Visual C++ 2010 Express Edition]. Pyrogenesis solution will need to be upgraded upon opening and also any time `update-workspaces` is run. (If you have the old VC++ 2005 Express, you need to install the separate [http://www.microsoft.com/express/2005/platformsdk/default.aspx Platform SDK] (steps 1-3).) The Visual Studio project/solution files are automatically generated from the source files: * Run `build/workspaces/update-workspaces.bat`. * Open `build/workspaces/vc2008/pyrogenesis.sln`. (If you have VC++ 2005, use the `vc2005` directory instead. If you have VC++ 2010, use `vc2008` and accept the automatic project format upgrade.) Now you should be able to build the code from within Visual Studio, using "Build Solution" (F7). === Running === Run the game with F5 inside Visual Studio (assuming "pyrogenesis" is set as the startup project, which is default). If you want to run it outside the debugger, run `binaries/system/pyrogenesis_dbg.exe`. To run the automated tests, run the "test" project. (Right click on "test" and "set as !StartUp Project" and F5; or right click, "Debug", "Start new instance"). In VS's debug output window, ignore any "first-chance exception" messages; it should say ".......OK!" if it succeeded. === Keeping up to date === After you've set everything up, the process for staying up to date is: * [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-update.html Update] the root directory of the checkout. * Close the solution in Visual Studio if you've got it open. Run `update-workspaces.bat` again. (This is only needed if any source files have been added or removed. If you forget to run this, you'll probably get build errors about missing symbols.) * Build again. == Unix == This is much less streamlined than the process for Windows. But you're cooler than a Windows developer, so you should be able to cope: === Linux === * Install various standard tools and development libraries: * GCC (at least 4.0, preferably 4.3) * Subversion * NASM * There is a [http://sourceforge.net/tracker/?func=detail&aid=2821249&group_id=6208&atid=106208 bug] in NASM 2.06 on x86_64, so you might want to try a different version if you get errors. * SDL * Boost * zlib * libpng * libxml2 * OpenGL * OpenAL * libogg * libvorbis * libcurl * wxWidgets (probably called wxgtk on Linux) (optional, but required for the editor tools) * Gamin (FAM should work too) (Linux only) * ENet 1.2.x ('''not''' 1.3.x) * DevIL * CMake * ''Optionally'': [http://code.google.com/p/nvidia-texture-tools NVTT] (pass the flag `--with-system-nvtt` to `update-workspaces.sh` to use the installed version; otherwise we'll automatically use a bundled copy of the library) * For '''Ubuntu''' or '''Debian''' (at least unstable and testing) the following might help: {{{ #!html
sudo apt-get install subversion build-essential cmake libsdl1.2-dev zlib1g-dev libpng12-dev libjpeg62-dev libgamin-dev nasm libwxgtk2.8-dev libboost-dev libboost-signals-dev libboost-filesystem-dev libopenal-dev libalut-dev libvorbis-dev libogg-dev libdevil-dev libenet-dev libxml2-dev libcurl4-gnutls-dev libcurl4-openssl-dev}}} * For '''Mandriva''' (tested with 2009.1): {{{ #!html
urpmi libboost-devel libwxgtk2.8-devel libwxgtku2.8-devel libopenal-devel zlib1-devel libpng-devel libogg0-devel libvorbis-devel libSDL-devel libdevil-devel libgamin-1_0-devel libjpeg62-devel libfreealut-devel nasm libcurl-devel make svn}}} No ENet package is available, so [http://enet.bespin.org/Installation.html install it from source]. * For '''Fedora''' (tested with 14): {{{ #!html
su -c 'yum -y install subversion gcc-c++ nasm SDL-devel boost-devel zlib-devel libpng-devel libjpeg-devel libxml2-devel openal-devel libogg-devel libvorbis-devel wxGTK-devel gamin-devel enet-devel DevIL-devel binutils-devel cryptopp-devel nspr-devel js-devel DevIL-ILUT-devel libcurl-devel'}}} * Download and compile the code with: {{{ svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad cd 0ad/build/workspaces ./update-workspaces.sh cd gcc make CONFIG=Release -j3 }}} "`-j3`" gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. * Alternatively you could download the code from a [http://github.com/0ad/0ad/ Git mirror] (which may be slightly less up-to-date than SVN). * The Release mode builds are more optimised, are harder to debug. Use `CONFIG=Debug` (and run `pyrogenesis_dbg`) if you need better debugging support. * If you encounter any build errors, look for an existing bug report or report a new bug. Also check the [#Knownproblemsandsolutions known problems section] below. * Run the automated tests to verify that everything works as expected, then run the game: {{{ cd ../../../binaries/system ./test ./pyrogenesis }}} * If you have already compiled the game from SVN and want to update to the latest version: {{{ cd 0ad svn up cd build/workspaces ./clean-workspaces.sh ./update-workspaces.sh cd gcc make CONFIG=Release clean make CONFIG=Release -j3 }}} * You may don't want to type all these commands every time you test the new trunk version. Simply save the following lines in a script (e.g.