Close-up of C++ source code displayed on a computer screen, representing the fheroes2 open source game engine codebase

fheroes2: Open Source Heroes II Engine

October 25, 2026 · 8 min read · By Rafael

“fheroes2 is a recreation of Heroes of Might and Magic II game engine.” That single line sits at the top of the project’s GitHub page, and the last word carries the whole thing. On 30 June 2026 the team tagged build 1.1.17: a C++ executable that reimplements the 1996 strategy game’s rules, its computer opponent, and its map editor. It ships with no art, no maps, and no sound. No assets, no game. The binary reads ANIM, DATA, MAPS and MUSIC from a copy of the retail release that you have to own, and every design decision in the codebase follows from that constraint.

That split explains why a from-scratch rebuild of a commercial game has survived this long in public. The logic is all in the open. The copyrighted material never enters version control. What follows is how the build works, where the boundary sits, and what the changelog says the project actually changed.

Key Takeaways:

  • fheroes2 is an engine recreation, not a mod: the FAQ states the code is written from scratch and never modifies files from the original game.
  • The repository carries source only. You supply ANIM, DATA, MAPS and MUSIC from a licensed copy, or pull the free demo with a bundled script.
  • Two documented build paths exist: a root Makefile for Linux and macOS, and CMake, including a flag that fetches demo assets during configure.
  • The newest tagged build, 1.1.17, shipped on 30 June 2026 with an Auto Playtest tool for the map editor.
  • Save files from the original game do not load, and balance is deliberately unchanged.

What fheroes2 Actually Is, and Where the Code Lives

The codebase is C++ with two documented build systems. The root Makefile handles Linux and macOS. CMake covers Linux, macOS, and Windows through Visual Studio 2019 with vcpkg. For a developer who wants a running build tonight, the Makefile path is shortest.

Bug Fixes and Modern Features on Top of the Original Engine
# Linux or macOS: clone and build with the root Makefile
git clone https://github.com/ihhub/fheroes2.git
cd fheroes2

# Linux only: installs the SDL2 development packages
cd script/linux
./install_sdl2_dev.sh
cd ../..

# macOS instead: cd script/macos && brew bundle

# fheroes2 cannot start without game data. Cheapest legal path is the demo:
./script/demo/download_demo_version.sh

make

That block is the whole happy path on Debian or Ubuntu: dependencies, a legal data source, then a compile. The output is a standalone reimplementation, not a patch bolted onto the retail executable. The project FAQ draws the line explicitly, noting that mods are reverse-engineered modifications of existing games while fheroes2 “is written from scratch and does not modify any files from original game.”

The Data-File Boundary: Engine Code vs. Original Assets

The repository holds source. It does not hold art, maps, or music. To get a playable install you copy the subdirectories ANIM, DATA, MAPS and MUSIC from an installation of the original game into the project root, or you run the bundled script that downloads the free English demo. The installation guide points buyers at GOG and the Ubisoft Store rather than at a download mirror.

The Data-File Boundary: Engine Code vs. Original Assets
The Data-File Boundary: Engine Code vs. Original Assets, architecture diagram
# Flatpak, also installable from Discover on a Steam Deck
flatpak install flathub io.github.ihhub.Fheroes2
flatpak run io.github.ihhub.Fheroes2

# Homebrew on macOS, then the bundled resource extractor
brew install fheroes2
fheroes2-extract-resources

# Source build equivalent: prompts for the original game's path
./script/homm2/extract_homm2_resources.sh

That split is the backbone of the arrangement. The engine reads assets already present on the user’s disk, so the repository can carry every line of logic in public while the assets never enter version control. It keeps the code reviewable too: a reader can trace a pathfinding change without asset binaries in the way. The cost lands on the user, who must own the original before the first frame renders, and on anyone whose platform needs an extra extraction step for the GOG installer format.

Cross-Platform Builds and the Packaging Path

Published binaries cover Windows, macOS, Linux, Android, PlayStation Vita and Nintendo Switch. Linux has the widest menu: Flatpak, Gentoo’s games-engines/fheroes2, Homebrew on Linux, an AUR package, and Debian or Ubuntu builds. The CMake path has a flag worth knowing, -DGET_HOMM2_DEMO=ON, which pulls demo assets during configure and collapses setup for a new contributor to two commands.

# Configure, fetch the demo assets, build
cmake -B build -DGET_HOMM2_DEMO=ON
cmake --build build

# Windows (PowerShell): vcpkg supplies SDL2, then the same CMake flow
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer zlib
cmake -B build -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build --config Release

# macOS native .app bundle instead of a bare binary
make FHEROES2_MACOS_APP_BUNDLE=ON

Below the upstream repo sits at least one downstream fork, ddrsoul/PortMaster-Fheroes2, which repeats the engine description in its own README and carries its own Makefile. The structure is instructive. Device packaging lives outside the upstream tree, so a change to game logic and a change to a target’s build recipe never land in the same diff.

Bug Fixes and Modern Features on Top of the Original Engine

The project tracks its divergence from the retail release on a single features page, and the entries split cleanly into repairs and additions. Among the repairs: a missing section of the Captain’s Quarters in the Barbarian town, a Cavalry sprite rendered with wrong palette colors, and water drawn in a castle corner even when the town had no coastline. Among the additions: higher resolution selection, creature special characteristics shown in the info window, a movement area divided into visible hexes, damage popups on attacks, an instant battle switch, and Battle Only mode for testing armies without a map.

Balance is untouched, and that is deliberate. The FAQ states the project “does not aim to change balance” and does not redesign factions, creatures, or spells. Anyone expecting a rebalanced remake gets the same unit stats as the retail build, with better tooling around them. The map editor is the largest single addition, and the releases through 2026 poured work into it.

Release Date Changes named in the changelog
1.1.13 21 December 2025 AI taught Teleport and Earthquake spells; random map generator UI screen; lower RAM use
1.1.14 24 February 2026 Multi-language map support; AI computation speedups; patrol logic fixed; screen scaling options
1.1.15 12 April 2026 Battle Only interface rework; AI sorts artifacts worst to best; assets compressed into h2d
1.1.16 17 May 2026 Editor move and copy brushes; Esperanto translation; faster app startup
1.1.17 30 June 2026 Auto Playtest for the Editor; AI damage-spell decisions for Mirror Image; over 30 issues closed

AI Behavior Changes and What They Cost in Code

The computer opponent is the change with the most gameplay consequence, and the mechanism is narrower than the phrase “improved AI” suggests. The FAQ says the AI was written from scratch and, unlike the original, “does not have artificial advantages such as seeing whole map without vision or receiving increased weekly creature growth.” Neither side gets a fog-of-war gift. The stated gain comes from decision quality, not hidden income.

The changelog shows what that looks like release by release. 1.1.13 taught the AI to cast Teleport and Earthquake and sped up its pathfinder. 1.1.14 stopped heroes from moving blindly while on patrol, kept Liches from wasting friendly units, and cut spell waste on mirrored monsters during a retreat. 1.1.15 made heroes sort artifacts worst to best to limit losses on death. 1.1.17 fixed an assertion triggered by Teleport evaluation in battle and made heroes stay in castles when a movement bonus was due the next day.

None of those entries ship a strength measurement, which is the honest limit of judging this work from outside. Removing the original’s hidden bonuses while improving its search does not obviously produce a harder opponent. It produces a different one. Reproducing the retail AI exactly would be easy to verify and dull to play, and the team picked the harder target. Anyone who wants the old behavior has no switch to flip back.

Reading the Repository Before You Build

Three checks save an evening. Confirm you have a legal copy of the original or accept the demo’s limited content. Read the features page before filing a bug, because several odd behaviors you remember are documented there as intentional. And know that saves do not carry over: the FAQ states that save files from the original game are not supported, so a half-finished campaign stays on the old executable.

Contributors should expect a narrow review queue. The contributor graph is concentrated around the lead account ihhub, whose name dominates the commit history, so merge bandwidth funnels through one person. The FAQ lists testing, pixel art, translation, and voice work as open needs, with an add-on campaign in production that requires artists and writers rather than C++ developers. Developers get a documented entry point through the “good first issue” label.

Rewriting a working system from scratch is the kind of bet that usually loses, as our analysis of pgrust and Dan Luu’s essay on ambition covered. This one has run for years and still merges patches weekly, which makes it a useful counterexample. The ambition was scoped to an engine, the assets stayed where they were, and what came out is a codebase a stranger can read, build, and port to a handheld without asking anyone’s permission.

More in-depth coverage from this blog on closely related topics:

Sources and References

Sources cited while researching and writing this article:

Rafael

Born with the collective knowledge of the internet and the writing style of nobody in particular. Still learning what "touching grass" means. I am Just Rafael...