Windows builds can be made in more than one way and with more than one tool. This guide focuses on the simplest building process using Microsoft Visual Studio 2022
Windows Vista or newer.
Microsoft Visual Studio 2022 download
Git or git GUI, for example: SourceTree download, or GitKraken download
CMake download. During install after accepting license agreement make sure to check "Add CMake to the system PATH for all users".
7-zip For unpacking pre-build Vcpkg
Create a directory for VCMI development, eg. C:\VCMI We will call this directory %VCMI_DIR%
Warning! Replace
%VCMI_DIR%with path you've chosen for VCMI installation in the following commands.It is recommended to avoid non-ascii characters in the path to your working folders. The folder should not be write-protected by system.
Good locations:
C:\VCMI
Bad locations:
C:\Users\Michał\VCMI (non-ascii character)
C:\Program Files (x86)\VCMI (write protection)
We strongly recommend to use pre-built vcpkg.
Vcpkg Archives are available at our GitHub: https://github.com/vcmi/vcmi-deps-windows/releases
Once extracted, a vcpkg directory will appear with installed and scripts subfolders inside.
Move extracted vcpkg directory into your %VCMI_DIR%
https://github.com/vcmi/vcmi/ as source%VCMI_DIR%/source as destinationdevelopRecursive submodulesclick Clone
git clone --recursive https://github.com/vcmi/vcmi.git %VCMI_DIR%/source
%VCMI_DIR%/build folder%VCMI_DIR%/buildcd %VCMI_DIR%/buildcmake %VCMI_DIR%/source -DCMAKE_TOOLCHAIN_FILE=%VCMI_DIR%/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A x64Open %VCMI_DIR%/build/VCMI.sln in Visual Studio
Select Release build type in combobox
Right click on BUILD_ALL project. This BUILD_ALL project should be in CMakePredefinedTargets tree in Solution Explorer.
VCMI will be built in %VCMI_DIR%/build/bin folder!
Make sure you have:
Data, Maps and Mp3 folders from Heroes III to: %USERPROFILE%\Documents\My Games\vcmi\Debug builds with MSVC are generally extremely slow since it's not just VCMI binaries are built as debug, but every single dependency too and this usually means no optimizations at all. Debug information that available for release builds is often sufficient so just avoid full debug builds unless absolutely necessary. Instead use RelWithDebInfo configuration. Also Debug configuration might have some compilation issues because it is not checked via CI for now.
For installing / uninstalling mods you need to launch VCMI_launcher.exe
For Map Editor you need to launch VCMI_mapeditor.exe