Widelands

Widelands is a free, open source real-time strategy game inspired by Settlers II with singleplayer campaigns and multiplayer mode.

README

Widelands

Build Status AppVeyor Code Quality Build Mirrored on Launchpad

Widelands is a free, open source real-time strategy game with singleplayer campaigns and a multiplayer mode. The game was inspired by Settlers II™ (© Bluebyte) but has significantly more variety and depth to it.

Widelands Screenshot

License License

GPL v2+. Some assets are released under various Creative Commons licenses – see the respective folders.

Download

On how to download Widelands, see https://www.widelands.org/wiki/Download/

Compiling

We support compiling Widelands for Linux, Windows under MSys2 and MSVC, and MacOS with GCC >= 8 or Clang/LLVM >= 7, though it might work with other compilers too. We have more detailed documentation available at: https://www.widelands.org/wiki/BuildingWidelands/

Dependencies

You will need to install the following dependencies:

On most common systems, you can install these automatically by running:

./install-dependencies.sh

It auto-detects your OS, or you can pass it explicitly, e.g. ./install-dependencies.sh debian.

Compiling with our convenience script

You can then compile by running our convenience script.

CommandPurpose
./compile.shFull debug build
./compile.sh -r -wRelease build
./compile.sh -e -wRelease build with debugging symbols
./compile.sh -hList available options

When compiling has finished, you can call Widelands with

./widelands
Compiling with CMake

You can also call CMake manually:

mkdir build
cd build
cmake ..
make

When compiling has finished, you can call Widelands with

cd ..
mv build/src/widelands .
./widelands

We have various CMake options available. For example, to create a release build, call

cmake -DCMAKE_BUILD_TYPE=Release ..

For using the Ninja build system, call

mkdir build
cd build
cmake -G Ninja ..
ninja

Depending on the Ninja installation, the last line can also be ninja-build.

CMake options

Note that CMake options are prefixed with -D. These are the available options:

NameValuesDefaultFunction
CMAKE_BUILD_TYPEDebug/Release/RelWithDebInfoDebugCreate a release or debug build
OPTION_ASANON/OFFON for Debug builds /OFF for Release buildsUse AddressSanitizer. Switching this off only works once. You will have to clear the build directory if you want to switch this off again in a later build.
OPTION_TSANON/OFFOFFUse ThreadSanitizer. Mutually exclusive with OPTION_ASAN.
OPTION_BUILD_CODECHECKON/OFFONBuild codecheck. Only available in Debug builds.
OPTION_BUILD_WEBSITE_TOOLSON/OFFONBuild website-related tools
OPTION_BUILD_TESTSON/OFFONBuild unit tests
CMAKE_INSTALL_PREFIXA directorySee CMake documentationDefine the target directory for the "install" target, e.g. -DCMAKE_INSTALL_PREFIX=~/widelands-install.
WL_INSTALL_BINDIRA directory${CMAKE_INSTALL_PREFIX}/gamesDefine the destination of executables files (if installing)
WL_VERSIONA version stringAutodetected from git/bzr, or set by adding a VERSION fileDefine the Widelands version
USE_FLTO_IF_AVAILABLEON/OFFAutodetectedUse link-time optimization
USE_XDGON/OFFONFollow XDG-Basedir specification. Only available on Linux.
OPTION_USE_GLBINDINGON/OFFOFFUse glbinding instead of GLEW
OPTION_GLEW_STATICON/OFFOFFUse static GLEW Library
OPTION_BUILD_WINSTATICON/OFFOFFBuild a static linked .exe on windows
OPTION_FORCE_EMBEDDED_MINIZIPON/OFFOFFUsed embedded minizip sources (skip checking for installed minizip library)
NEEDS_EXTERNAL_FILESYSTEMON/OFFAutodetected from compiler versionWhether std::filesystem needs to be linked against an extra library
make/ninja targets

You can add targets to the make or ninja command, e.g. make codecheck to only run the code check suite. These are the available targets:

NameFunction
ALL or no targetCompile everything, up to executable with the settings from the cmake call
codecheckRun the codechecks
docGenerate Doxygen documentation. Currently only with Build Type Debug, but this is easily changed if necessary.
installInstall into the target dir, this is /usr/local per default (you need root privileges!) unless you change it (see CMake options above)

Contributing

We have some instructions on how to use Git to help you if you're new to Git: https://www.widelands.org/wiki/GitPrimer/

Code

The master branch and all issues and pull requests are mirrored bidirectionally between our developer environments on Codeberg and GitHub by bunnybot. Bunnybot also formats the code (C++, Lua, and Python) in all mirrored branches.

We follow the Google Styleguide.

Scenarios

For scripting scenarios, see https://www.widelands.org/documentation/lua_index/

Art

For contributing art, see https://www.widelands.org/wiki/GraphicsDevelopment/

Translations

For contributing translations, see https://www.widelands.org/wiki/TranslatingWidelands/

Testing

For helping with testing, see https://www.widelands.org/wiki/TestingBranches/

Triaging Issues

For helping with issue management, see https://www.widelands.org/wiki/TriagingBugs/

AI-Generated Content Policy

Please do not submit content generated purely or largely by or with Artificial Intelligence, Machine Learning, or Large Language Models (AI, ML, LLMs). We will not accept such content as it conflicts with the objectives of the Widelands project.

We hold that AI-generated content generally stands on dubious ethical and legal grounds, as it violates the copyright of creators whose work was scraped for the AI's training data set without their permission and without due attribution. Also, we find that it is frequently of low overall quality and/or is overly generic and fails to embrace requirements specific to Widelands.

Pull requests that have been generated by AI may be closed immediately in order to prevent their time-consuming and often fruitless reviews and discussions.

Widelands is created by people, for people.

Directory Structure

DirectoryContents
cmakeBuild system and codecheck rules
dataThe game's data files. Images, sounds, music, scripting, maps, campaigns, tribes, ...
debianPackaging for Debian-based Linux distributions
docSphinx documentation
srcC++ source code
testScripted maps for our regression test suite
utilsDiverse utilities: Building translations, code formatting, packaging Mac & Windows, ...
xdgFiles related to X Desktop Group Base Directory Specification

Obtaining MacOS and MS-Windows builds and testsuite runs

All pushes to master will be built on AppVeyor. Pull request branches are deployed for MS-Windows using a GitHub action. To obtain MS-Windows builds if you do not wish to open a pull request, temporarily add the name of your branch to the branches section in appveyor.yml. This will not work if the branch is in a fork though.

All pull request branches as well as master are additionally deployed for MacOS, and a testsuite checks them under various compilers. To obtain MacOS builds or testsuite results, temporarily add the name of your branch to the branches section in .github/workflows/build.yaml. This does work for branches in forks as well.