8 BuildInstructionsGettingTheCode
Itms edited this page 2024-03-28 20:41:11 +01:00

This page explains how to download the development tools and the source code of 0 A.D., in order to start developing. If you are a user wanting to test the latest development version, or a package maintainer testing packaging on a version resembling a release, you should use the NightlyBuild repository instead.

You may be interested in BuildAndDeploymentEnvironment for a general description of the development environment.

Necessary tools

Windows

Git

0 A.D. is developed using git as a version control system.

  • If you are confortable with using git through command-line, just download and install Git for Windows. If you are not using the default config, make sure you install the Git LFS extension.
  • If you are not familiar with command-line git, or prefer using a GUI, we recommend downloading and installing TortoiseGit. Make sure you reboot when it asks you to.

Subversion (SVN)

Some binaries (specifically bundled libraries) are served over Subversion.

  • Download and install TortoiseSVN. Make sure you enable the "command line client tools" option, and reboot when it asks you to.

macOS

  • Git is part of the Xcode Command Line Tools package, and can be installed via the GUI or the terminal.
xcode-select --install
brew install git-lfs
  • SVN is no longer part of the Xcode Command Line Tools package, but can be installed, e.g. via Homebrew.
brew install svn

Linux

Git

git is usually present on modern distributions of Linux, however, you might need to install it in some cases. You also need to install the Git LFS extension.

Depending on your Linux distribution, the method for installing packages might differ. For instance, on Ubuntu it would be:

sudo apt update
sudo apt install git git-lfs

Subversion (SVN)

Subversion is probably not installed by default on your system, but it is easily found in package managers. Depending on your Linux distribution, the method for installing packages might differ. For instance, on Ubuntu it would be:

sudo apt update
sudo apt install subversion

Getting the code

The git repository contains the 0 A.D. source code as well as all the game binaries (images, 3D models, game maps, music, fonts). Those binaries are handled using Git LFS, a git extension for holding large files: make sure you installed it as explained above.

The source code itself weighs around 100MiB. The binaries weigh around 12GiB (6GiB that are duplicated between the objects under .git and the checked-out files). Building the libraries and the engine will also take up a couple GiB, which can be reclaimed if needed. So we recommend having around 25GiB free to be safe.

Important: Avoid placing your development environment in a path containing special characters (spaces or non-ASCII characters).

To checkout the latest version of the source code, run

git clone -b future https://gitea.itms.ovh/wfg/0ad.git

For slow connections

If your Internet connection is slow or prone to hiccups, it it strongly recommended to clone the git repository without LFS files (only 100MiB), then pull the LFS files which is a resumable operation. To do that, run

GIT_LFS_SKIP_SMUDGE=1 git clone -b future https://gitea.itms.ovh/wfg/0ad.git
cd 0ad
git lfs pull # if that command fails after a while, run it again to resume the download

For package maintainers and CI/CD environments

If you only plan to build the game engine and run the tests, you do not need to pull the entire repository. You only need the source (only 100MiB) and a couple test binaries (under ). Pulling and building the libraries and the engine will take up around . To do that, run

GIT_LFS_SKIP_SMUDGE=1 git clone -b future https://gitea.itms.ovh/wfg/0ad.git
cd 0ad
git lfs pull -I
# then proceed to the build instructions

Github and GitLab mirrors

Our git repository is mirrored at the following addresses (but development does not happen on these platforms).

  • Github: https://github.com/0ad/0ad.git
  • GitLab: https://gitlab.com/0ad/0ad.git

Building and running the game

When you have pulled the code, you can proceed to the BuildInstructions.