fheroes2 · Online — source code of the browser build
=====================================================

This is the complete source of the game engine served at https://fheroes2-online.pages.dev,
exactly the version that built the fheroes2.wasm currently running there, together with the
pages that run it (files/emscripten/).

It is a modified version of fheroes2 (https://github.com/ihhub/fheroes2), licensed under the
GNU General Public License v2 -- see LICENSE. The changes add online play, the Battle Campaigns,
the Legacy 1996 and Deep battle AIs (their trained weights are compiled in from src/fheroes2/ai/),
the map editor on the original game's data alone (with map export and import), online scenarios
that can be saved and continued, online battle tournaments, and the seasonal themes.

Not included: game data. Heroes of Might and Magic II's data files are not part of this source;
the site serves only the freely redistributable 1996 demo data.

Building the browser version (Docker required):

    docker run --rm -v "$PWD":/src -w /src -u "$(id -u):$(id -g)" -e HOME=/src \
        -e FHEROES2_WITH_THREADS=ON \
        emscripten/emsdk:latest emmake make -f Makefile.emscripten -j"$(nproc)"

(The site runs the multi-threaded build, hence FHEROES2_WITH_THREADS=ON; it needs the page to be
served cross-origin isolated. Without the flag you get the single-threaded build.)

The emsdk image has no gettext, so build the translations on the host first:
    make -C files/lang && make -C src/dist/fheroes2 pot

A desktop build works as described in README.md and docs/.
