fheroes2 build and contribution guide
Building the fheroes2 Project
Please follow the instructions below to be able to build the project from source:
Note: You will need to clone the fheroes2 project before following the instructions below.
Windows
- Go to the directory
script/windowsand run the fileinstall_packages.bat. This script will install all the required packages to build the project using Microsoft Visual Studio. - If you have the original game, then copy the subdirectories
ANIM,DATA,MAPSandMUSIC(some of them may be missing depending on the version of the original game) to the project root directory. - Alternatively, go to the directory
script/demoand run the filedownload_demo_version.bat. This script will download a demo version of the original game, which is the minimum required for development. - Open the file
fheroes2-vs2019.vcxproj(targeted for Visual Studio 2019) and build the project. - Visual Studio will automatically copy game files in the root directory to the build directory.
macOS and Linux
- Depending on your OS, run the following scripts to install the dependencies required for the build:
- macOS: go to the directory
script/macosand runbrew bundleto install the required dependencies. - Linux: go to the directory
script/linuxand run the fileinstall_sdl2_dev.sh.
- macOS: go to the directory
- If you have the original game, then copy the subdirectories
ANIM,DATA,MAPSandMUSIC(some of them may be missing depending on the version of the original game) to the project root directory. - Alternatively, go to the directory
script/demoand run the filedownload_demo_version.sh. This script will download a demo version of the original game, which is the minimum required for development. - Run the
makecommand in the root directory of the project to build it.
Android
- Go to the directory
script/androidand run the fileinstall_packages.batif your development platform is Windows orinstall_packages.shif your development platform is macOS or Linux. This script will install all the required packages to build the project using Android Studio. - Launch Android Studio, open the project in the
androiddirectory and run the build.
iOS
- To build this build you need to have the necessary Data, Anim, Maps and Music folders for the engine present in the fheroes2 project’s folder.
- Download and install Xcode on your macos device. Download the iOS SDK during installation.
- Open
fheroes2.xcodeprojin the “iOS” folder”. - Download SDL2 and SDL_mixer source codes from their GitHub repositories’s release pages. Make sure you get SDL2 and not SDL3.
- Paste the SDL2 and SDL_mixer folders in the same parent directory as your fheroes2 source folder. This means that next to the folder containing your fheroes2 local clone, you will have the two SDL folders.
- Remove any version number from the name of the SDL2 and SDL_mixer folder so that their names are respectively
SDLandSDL_mixer. - In Xcode SDL and SDL_mixer should now be recognized in the Navigator area, recognized by them not having read names. Open on
SDL_mixerin the Navigator on the left side. - Click “fheroes2” in the Navigator area on the left side of Xcode.
- In the right side Editor area select “fheroes2” under “Project”. Open the
Build Settingstab. Make sure to setAlloptions and scroll down toSearch Paths. - Open up the
User Header Search Pathsand add$(SRCROOT)/../../SDL/includeto the list of paths. - In the Editor area select “fheroes2” under the “Targets” menu instead of “Projects”. Open the “Signing & Capabilities” tab. Under “Signing”, add your AppleID in the “Team” field.
- Connect your iOS device to your mac device with the necessary cable. Select the device in the devices in Xcode’s upper Toolbar.
- Click the play button or command + B to build. If asked if you want to download the Metal toolchain, agree to this as it is necessary for the app. After this you will be prompted to enable developer mode on your iOS device. Follow the steps provided on your macOS and iOS devices to enable this.
- Once you have setup developer mode on your device and added your AppleID to Xcode, you can build and run the project. The first build will likely take a while. Once fheroes2 starts on your iOS device a white screen will show for a minute or more.
PlayStation Vita
If you would like to build and run this project on PlayStation Vita please follow the instructions on this page.
Nintendo Switch
If you would like to build and run this project on Nintendo Switch please follow the instructions on this page.
Emscripten (Wasm)
If you would like to run this project in a web browser please follow the instructions on this page.
Build with CMake
If you would like to build the project using CMake please follow the instructions on this page.
Building the front end website
We host the website on Github pages, which is a highly customized version of the Jekyll static site engine. The instructions for developing the website can be found in the website local dev guide.
Contribution
We welcome and appreciate any help, even if it is a tiny text or code change. Please read our contribution guide before starting work on a pull request. Not sure what to start with? Feel free to refer to good first issue or help wanted tags.