Unvanquished is an arena game with RTS elements (you can build) in which two very different factions fight.
Windows | macOS | Linux |
---|---|---|
ℹ️ We provide ready-to-use downloads for the Unvanquished game on the download page.
ℹ️ This repository contains the source code for the game logic of Unvanquished.
💡️ If you only want to play the game or run a server and want to rebuild, you only need to build the Dæmon engine and download the game's assets.
💡️ You need to build this repository if you want to contribute to the game logic or make a mod with custom game logic binaries.
See below for build and launch instructions.
The Unvanquished game is translated on the Weblate platform, this is the easier way to contribute translations since it offers a central place where people can contribute and review translations while reducing risks of merge conflicts. Weblate preserves authorship and automatically produces commits that can be associated with your GitHub account.
To fetch and build Unvanquished, you'll need:
git
,
cmake
,
python
≥ 2,
python-yaml
,
python-jinja
,
and a C++14 compiler. The following are actively supported:
gcc
≥ 9,
clang
≥ 11,
Visual Studio/MSVC (at least Visual Studio 2019).
Required:
zlib
,
libgmp
,
libnettle
,
libcurl
,
SDL2
,
GLEW
,
libpng
,
libjpeg
≥ 8,
libwebp
≥ 0.2.0,
Freetype
,
Lua
,
OpenAL
,
libogg
,
libvorbis
,
libopus
,
libopusfile
.
Optional:
ncurses
.
MSYS2 is the recommended way to build using MinGW on a Windows host.
Required packages for 64-bit: mingw-w64-x86_64-gcc
, mingw-w64-x86_64-cmake
, make
Required packages for 32-bit: mingw-w64-i686-gcc
, mingw-w64-i686-cmake
, make
See the wiki for more detailed instructions.
Unvanquished requires several sub-repositories to be fetched before compilation. If you have not yet cloned this repository:
git clone --recurse-submodules https://github.com/Unvanquished/Unvanquished.git
If you have already cloned:
cd Unvanquished/
git submodule update --init --recursive
ℹ️ If cmake complains about missing files in daemon/
folder or similar issue then you have skipped this step.
If you don't have the assets, you can download them first. You can download an universal zip from the download page, here is the link to the latest version.
The pkg/
folder can be stored in the homepath.
Otherwise you can use the package downloader script. This script can use aria2c
, curl
or wget
.aria2c
is recommended.
You can do ./download-paks --help
for more options.
./download-paks build/pkg
The above snippet places the pkg
directory in the
libpath of the Daemon engine that you are building,
so it will only be automatically found from this build directory. If you prefer the paks to be
found by from all installations/build directories, consider downloading to the pkg/
subdirectory
of the homepath.
ℹ️ This will build both the game engine and the game logic. Building both makes things more convenient for testing and debugging.
💡️ Instead of -j4
you can use -jN
where N
is your number of CPU cores to distribute compilation on them. Linux systems usually provide a handy nproc
tool that tells the number of CPU core so you can just do -j$(nproc)
to use all available cores.
Enter the directory before anything else:
cd Unvanquished/
- Run CMake.
- Choose your compiler.
- Open
Unvanquished.sln
and compile.
Produced files will be stored in a new directory named build
.
mkdir build; cd build
cmake ..
make -j4
mkdir build; cd build
cmake .. -G "MSYS Makefiles"
make -j4
💡️ For a 32-bit build use the cross-toolchain-mingw32.cmake
toolchain file instead.
mkdir build-win64; cd build-win64
cmake .. -DCMAKE_TOOLCHAIN_FILE=../daemon/cmake/cross-toolchain-mingw64.cmake
make -j4
ℹ️ On Windows you'll have to use daemon.exe
and daemonded.exe
instead of ./daemon
and ./daemonded
, everything else will be the same.
First, enter the build/
folder:
cd build
Assuming the pkg/
folder is stored next to the daemon
binary:
./daemon
You can also use -pakpath
to load assets from a pkg/
folder stored somewhere else, <PATH>
stands for the path to the pkg/
folder.
./daemon -pakpath <PATH>
If you want to run a server, you may prefer to use the non-graphical daemonded
server binary instead of daemon
and start the first map (here, plat23 is used as an example) from the command line.
Assuming the pkg/
folder is stored next to the daemonded
binary:
./daemonded +map plat23
You can use -pakpath
to load assets from a pkg/
folder stored somewhere else (see above).
You may want to copy and extend some configuration samples, they must be stored in your user home directory, for details see the game locations wiki page and the page about running a server.
ℹ️ This is not a tutorial to distribute a modified game usable by players. See the wiki for mod building and hosting tutorials.
ℹ️ This is not needed to run the released game or a server.
As a developer, you may want to run the game logic as a shared library and load modified assets from the pkg/unvanquished_src.dpkdir
submodule.
Assuming you already have a release pkg/
folder, you can do it this way:
./daemon -pakpath ../pkg -set vm.sgame.type 3 -set vm.cgame.type 3
Note that only the basic unvanquished_src.dpkdir
asset package is provided that way, and running Unvanquished only with that package will bring you some warnings about other missing packages and you will miss soundtrack and stuff like that.
ℹ️ If you are looking for the sources of the whole assets, have a look at the UnvanquishedAssets repository. Beware that unlike the unvanquished_src.dpkdir
package most of them can't be loaded correctly by the engine without being built first.
Please don't commit submodules in pull requests, as the submodule references may not exist after the pull requests are rebased and merged.
When a feature is split across more than one repository, submodules are expected to be committed after each pull requests has been merged.
ℹ️ More details can be found in the wiki: wiki:Dealing with submodules.