Docs

Building for HTML5

Doriax can export to the web (HTML5) using Emscripten, producing JavaScript and WebAssembly output that runs in the browser.

Let the editor build it

The Export Window's Web mode runs this entire build for you — it locates the Emscripten SDK, compiles the project, and copies the .html/.js/.wasm/.data files to your destination folder. The manual steps below are for Source Code exports and custom setups. See Export Window.

If the SDK is not on PATH, point the editor at your emsdk folder once in Edit → Editor Settings → Web.

Page customization

The generated page is not fixed. Project Settings → Platforms → Web sets the page title, a favicon, extra <head> markup, whether the canvas follows the browser window, and whether Emscripten's default logo, status line and console are hidden. For full control, supply a Custom HTML Shell: any HTML file containing a {{DORIAX_DEFAULT_HTML}} marker, which the build replaces with the page Emscripten generated. See Web settings.

Game portals

To publish on a web game portal, pick it under Project Settings → Platforms → Web → Game Portal: CrazyGames, Poki, GameDistribution, Yandex Games or YouTube Playables. The export builds that portal's SDK in for the WebPortal class, so each portal needs its own export. A build configured by hand takes the same choice as -DDORIAX_WEB_PORTAL=poki, plus -DDORIAX_WEB_PORTAL_GAME_ID=<id> for GameDistribution. See Monetization → Web portals for the API and for testing each portal on localhost.

1. Install Emscripten

Download and install the Emscripten SDK by following the official installation instructions.

After installation, make the SDK available in your environment:

source <path-to-emsdk>/emsdk_env.sh

Install CMake and a compatible toolchain, and ensure both cmake and the Emscripten tools are on your PATH. Test with:

cmake --version
emcc --version

Emscripten builds on Windows with Ninja, not with Visual Studio. The editor and doriax.py take Ninja from PATH, or else the one the C++ CMake tools for Windows component of Visual Studio installs. Without it, install Ninja and add it to PATH.

2. Build the web target

Configure and build using the Emscripten toolchain. The output is a set of .js, .wasm, and .html files for your project.

emcmake cmake -S engine -B build-web -G "Ninja" \
    -DPROJECT_ROOT=/path/to/project \
    -DCMAKE_BUILD_TYPE=Release
cmake --build build-web --config Release --target doriax-project

The runtime selects the gles3 graphics backend and Emscripten app backend for web builds. Assets and Lua files are preloaded into the virtual filesystem when the project contains assets/ and lua/ folders. The experimental Native Resource Pack setting does not apply to Web mode — Emscripten still emits its .data bundle from the loose folders. Leave packing off if you export Source Code and then run this Emscripten build yourself.

In a Source Code export, python3 doriax.py -p web finds the SDK and runs both commands. See Build Script — Web builds.

Thread support

Thread support is disabled by default for Emscripten builds. Enable it only when your hosting environment supports the required cross-origin isolation headers:

emcmake cmake -S engine -B build-web -G "Ninja" \
    -DPROJECT_ROOT=/path/to/project \
    -DEMSCRIPTEN_THREAD_SUPPORT=ON

Web builds use memory growth and start with a 256 MB initial memory configuration.

3. Run it

Opening the generated .html file directly from the filesystem can trigger browser security errors. Serve it over HTTP instead:

python3 -m http.server

Then open http://127.0.0.1:8000 in your browser.

Tooling is being refreshed

The web export pipeline is being updated under the Doriax name. Some steps may still reference the legacy Supernova layout while the transition completes. Check the repository for the latest workflow.