Hazel

Export Templates

An export template is the game runtime for one platform, built ahead of time: the renzora binary without the editor image, the shared libraries it was linked against, and its plugins/ folder. The copy-mode exports (Export System) take a template, pack the project beside it or onto it, and are done. No compiler is involved, which is why they take seconds.

Exporting for the platform the editor runs on needs no separate template in practice: a build of the engine is itself a runtime for its own platform. Exporting anywhere else needs one, either built with the toolchain containers or downloaded from the release. The lean mode does not use a template at all; it compiles its own runtime.

The code is crates/renzora_export/src/templates.rs (finding templates) and download.rs (fetching them).

Platforms

templates::Platform names every export target. Its dist_dir_name() is both the folder build-all.sh writes to and the platform's key in a release:

PlatformKeyTemplate file
Windows x64 / ARM64windows-x64, windows-arm64renzora.exe
Linux x64 / ARM64linux-x64, linux-arm64renzora
macOS x64 / ARM64macos-x64, macos-arm64renzora
Android ARM64android-arm64renzora-runtime-android-arm64.apk
Android x86_64android-x86renzora-runtime-android-x86_64.apk
Fire TVfiretv-arm64renzora-runtime-firetv-arm64.apk
iOSios-arm64renzora-runtime-ios-arm64.zip
Apple TVtvos-arm64renzora-runtime-tvos-arm64.zip
Webweb-wasm32renzora-runtime-web-wasm32.zip

Desktop templates are a folder (binary, shared libraries, plugins/); mobile and web templates are a single file.

Where templates are found

TemplateManager::scan looks in two places per platform and takes the first hit:

  1. dist/<key>/ in the engine checkout, which is where cargo renzora dist and renzora build stage their output. A local build always wins: if you built it, you meant to use it. The binary is found where each lane puts it:
    • Windows: dist/windows-x64/renzora.exe, flat.
    • Linux: inside the AppImage folder, dist/linux-x64/<name>.AppDir/renzora.
    • macOS: inside the bundle, dist/macos-*/<name>.app/Contents/MacOS/renzora.
    • Mobile and web: the template file, flat in dist/<key>/.
  2. ~/.renzora/templates/<ENGINE_VERSION>/<key>/, the per-user store downloads go to. It is scoped by engine version, so an upgraded editor can never pick up the previous version's runtime, and it is outside the install directory, so it survives a reinstall and works when the engine is installed somewhere read-only. A downloaded desktop template is always flat (the release script unwraps the bundle when it packages it).

A downloaded template carries a template.json stamp beside it:

{ "tag": "r1-alpha8-nightly-01dec26", "sha256": "..." }

The Export window shows the tag as the template's version, local for a dist/ build, and downloaded if the stamp is unreadable (the template still works; it is only a folder of files).

Plugins for another platform

plugins_dir_for(platform) decides which plugins/ a copy-mode export ships from. A template that brought its own plugins/ is used for its platform; otherwise the editor's own folder is used. That fallback is right for the host platform and wrong for any other: a Windows editor's plugins/ holds .dll files a Linux game cannot open. Native plugins are built from source on the machine that installs them (see Native Plugins), so for a cross-platform export with plugins, use the lean mode, which compiles them in.

Downloading

The Download button in the Export window calls download::fetch_release_info, then spawn_download. Which release it picks matters: the runtime and the editor are two halves of one version, and a runtime from another version may not load the scenes this editor saves. So it resolves, in order:

  1. The editor binary's own release tag, when CI stamped one in (renzora_platform_api::version::release_tag).
  2. A release tagged exactly ENGINE_VERSION.
  3. The newest nightly for this version (<version>-nightly-*), which is the case for an editor built from source. The window reports that it fell back.

There is deliberately no fourth step. Falling back to an older version would bring back exactly the mismatch this order exists to prevent.

The asset is renzora-runtime-<key>.zip. Its SHA-256 is checked against the digest GitHub publishes for the asset, and a mismatch aborts the install: this is a binary that will be handed to players. The zip is extracted into the per-user store and stamped.

Install from file copies a runtime you choose into the same per-user store under the platform's template name, then rescans. It is the way to use a template built on another machine.

What a release carries

scripts/package-release.sh packages each staged dist/<key>/ into:

AssetContents
<key>.zipThe engine (editor plus runtime) for that platform
renzora-runtime-<key>.zipThe export template
manifest.json, SHA256SUMSThe asset list and checksums
engine-source.zipThe source tree (git archive), which a lean export compiles from on a machine without a checkout

Only the desktop platforms and web-wasm32 are packaged. Releases carry no mobile templates; Android and iOS templates are built locally (below).

Building templates

Desktop and web

The desktop and web templates are what the engine build itself produces. On your own platform, cargo renzora dist stages dist/<key>/, and the scan finds it. For other platforms, renzora build <platform> runs docker/build-all.sh in that platform's toolchain container and stages dist/<key>/ the same way. See Cross-Compiling for the container setup.

build-all.sh runs one lane per platform family: linux, windows, macos (x64 and ARM64 through osxcross), wasm, android and ios. The wasm lane builds the web runtime, and also a web build of the editor (renzora_editor_app, binary renzora-editor); that is a compile target for now and cannot open a project. The android and ios lanes compile only the native library (libmain.so, librenzora_ios.a), not a template. There is no Fire TV or Apple TV lane.

Android and Fire TV

templates/android/build-template.sh builds the native library with cargo-ndk, then the APK with Gradle. It needs Android Studio (SDK, NDK, Java), cargo-ndk, and the Android Rust targets.

./templates/android/build-template.sh              # Android ARM64
./templates/android/build-template.sh --x86_64     # Android x86_64 (emulators)
./templates/android/build-template.sh --firetv     # Fire TV ARM64
./templates/android/build-template.sh --all        # all three

The crate is crates/renzora_android (package renzora-android, a cdylib named main, which the APK's GameActivity loads through android.app.lib_name). The APKs are written unsigned to target/templates/ and to a per-user folder (%APPDATA%/renzora/templates on Windows, ~/.config/renzora/templates elsewhere). The Export window does not scan either folder. Use Install from file, or copy the APK into dist/<key>/ under its template name. The export signs the final APK itself.

iOS and Apple TV

templates/ios/build-template.sh needs a Mac with Xcode. It compiles the static library (crates/renzora_ios, package renzora-ios), builds the Xcode project, and zips RenzoraRuntime.app.

./templates/ios/build-template.sh                    # iOS device
./templates/ios/build-template.sh --simulator        # iOS simulator
./templates/ios/build-template.sh --tvos             # Apple TV
./templates/ios/build-template.sh --tvos-simulator   # Apple TV simulator

The zip goes to target/templates/ and ~/Library/Application Support/renzora/templates/; as with Android, install it from file or copy it into dist/<key>/. At export time the project's game.rpak is injected into the .app and the result is written as an .ipa. Signing for a device or the App Store is done with Xcode afterwards.

Web

The web template is the wasm lane's output zipped as renzora-runtime-web-wasm32.zip. templates/web/ holds a small Vite scaffold for working on the page that hosts the runtime.

Version matching

A template must come from the same engine version as the editor. Scenes are saved with reflected type paths, and a runtime from another version may not have, or may have renamed, a type the editor wrote. The version-scoped store and the download order above both exist to prevent that pairing. If you build templates yourself, build them from the same commit as the editor you export with.