Project Structure
A map of the engine repository: one Cargo workspace of about 170 crates, found by member globs, plus Bevy and the third-party crates built on it.
For how the pieces fit together at run time, read Architecture first. This page is about where things are on disk.
The repository
engine/
├── Cargo.toml workspace root, and the renzora_app package (the `renzora` binary)
├── Cargo.lock
├── build.rs Windows icon and version resource, zstd link directive
├── rust-toolchain.toml the pinned Rust version for native builds
├── .cargo/config.toml cargo aliases (`cargo renzora`, `cargo dist`, ...) and per-target linker flags
├── src/main.rs the single entry point: editor, game and server
├── crates/
│ ├── api/ the contract layers, one renzora_<job>_api per subject
│ ├── shared/ renzora, renzora_sdk, renzora_dylib, renzora_text_mesh
│ └── renzora_*/ every engine crate (flat, no category folders)
│ └── editor/ the editor half of a split crate (renzora_<name>_editor)
├── bevy/ Bevy's own source, a git subtree of Bevy main (never edit)
├── vendor/ third-party crates built on Bevy, pointed at bevy/ by path
├── xtask/ `cargo renzora`: build, stage, sync, SDK, coverage
├── docker/ toolchain Dockerfiles and the container build scripts
├── .github/ CI workflows and the scripts they call
├── scripts/ release packaging, nightly notes, the version check
├── templates/ Android, iOS and web packaging templates
├── tools/ the update sidecar (its own workspace) and the OpenXR loader
├── assets/ the engine's default assets (themes, shaders, materials, UI, ...)
├── languages/ translation packs, one .toml per language
├── docs/ these docs; docs/r1-alpha8/ is the current version
├── RELEASE_NOTES.md the running changelog (see Releases)
├── releases.json what each released version froze
└── dist/ build output, one folder per platform (not committed)
target/ holds cargo's build output. Everything there is disposable, and on a normal machine it should contain a dist/ directory and no debug/ one: see Building from Source.
Workspace members
The root Cargo.toml finds members by glob, so adding a crate never means editing a list:
[workspace]
resolver = "2"
members = [
"crates/api/*", # the contract layers
"crates/api/*/macros", # a layer's own proc-macro crate, nested in it
"crates/shared/*", # what hands the contracts out
"crates/renzora_*", # every engine crate
"crates/renzora_*/editor", # nested editor halves of split crates
"vendor/bevy_hui", # the one vendored crate that is a member
]
exclude = [
"bevy",
"vendor/bevy_oxr",
"vendor/dlss_wgpu",
"vendor/vleue_navigator",
]
Things worth knowing about it:
- There is no
".". The root package is a member anyway, and listing"."would cover every path under the root and so make eachexcludeentry a member again. - The excluded trees build only as dependencies. Bevy and the vendored subtrees are never linted or tested as Renzora code, and a subtree pull never touches a workspace list.
xtaskis not a member. It is its own workspace root, because it writes the generated plugin dependencies and must still build when a dangling one stops the engine workspace from loading. Run it throughcargo renzorafrom the repository root.tools/updateris its own workspace too, with its owndistprofile.cargo renzoraanddocker/build-all.sheach build it separately.- The
crates/renzora_*/editorglob must match at least one directory. A member glob that matches nothing is a hard cargo error.
Every crate opts into the workspace lint table with [lints] workspace = true. The table ([workspace.lints.rust]) is currently empty, but it must exist because every crate inherits from it.
crates/
Only Renzora's own crates live here; third-party code goes in vendor/.
| Folder | What it holds |
|---|---|
crates/api/ | 25 contract layers, renzora_<job>_api. See the contract |
crates/shared/ | renzora (re-exports the lowest layers at their historic paths), renzora_sdk (re-exports every layer as renzora, for plugins and scripts), renzora_dylib (the shared image), renzora_text_mesh |
crates/renzora_*/ | Everything else: about 110 engine crates |
crates/renzora_*/editor/ | 33 editor halves, each renzora_<name>_editor |
A few crates form the spine:
| Crate | Role |
|---|---|
renzora_runtime | What the binary builds the App from: init_app, the rendering setups, add_engine_plugins, the editor image loader, and the generated Runtime plugin list |
renzora_engine | The editor-free game core: the virtual filesystem and asset reader, scene IO, crash reporting |
renzora_editor | The editor image (dylib + rlib), holding the generated Editor plugin list |
renzora_editor_app | The web editor's second .wasm bundle; builds only with its wasm feature |
renzora_editor_framework | Shared editor implementation the editor crates build on |
renzora_native_plugin | The native plugin loader |
renzora_plugin_build | The rustc driver that compiles a native plugin against the SDK |
renzora_native_build | The compiler invocation the plugin driver and the staged binary share |
renzora_rust_script | .rs scripts, each compiled as a native plugin |
renzora_export | The game exporter, including the lean static build |
renzora_static_plugins, renzora_static_scripts | Generated. Empty stubs in the checkout; the lean exporter rewrites them in its own copy of the workspace to compile a game's plugins and scripts into the binary. Editing them by hand changes nothing about an export |
renzora_android, renzora_ios | The mobile entry points, excluded from desktop builds |
renzora_test_harness | A dev-dependency that builds test apps; see Testing |
Split crates
Because a plugin's scope is either Runtime or Editor, a feature that needs both is two crates:
crates/renzora_physics/ package renzora_physics (runtime, in every build)
crates/renzora_physics/editor/ package renzora_physics_editor (linked only by the editor image)
Editor-only features with no runtime half at all (the hierarchy, the inspector, the asset browser and so on) are ordinary top-level crates with an Editor plugin table.
Generated files
| File | Written by |
|---|---|
crates/renzora_runtime/src/plugins.rs | cargo renzora sync, from every Runtime plugin table. Committed; CI fails if it is stale |
crates/renzora_editor/src/plugins.rs | the same, for Editor plugin tables |
the generated dependency blocks in renzora_runtime and renzora_editor's Cargo.toml | the same |
Never hand-edit these; change the plugin tables and run cargo renzora sync (or any cargo renzora build).
Adding a crate
-
Create
crates/renzora_<name>/. Thecrates/renzora_*glob picks it up. -
Depend on Bevy through the workspace, and on the contract layers you actually use:
[package] name = "renzora_myfeature" version = "0.1.0" edition = "2021" [dependencies] bevy = { workspace = true } renzora_scene_api = { path = "../api/renzora_scene_api" } [lints] workspace = true [[package.metadata.renzora.plugin]] type = "MyFeaturePlugin" -
Write the plugin. It must implement
Plugin + Default:use bevy::prelude::*; #[derive(Default)] pub struct MyFeaturePlugin; impl Plugin for MyFeaturePlugin { fn build(&self, app: &mut App) { // add_systems, register_type, insert_resource, ... } } -
Build with
cargo renzora dist. The generator adds the dependency and theadd_pluginsline, and you commit both along with your crate.
For an editor-only half, create crates/renzora_<name>/editor/ with package name renzora_<name>_editor and scope = "Editor" on its plugin table. Use crates/renzora_oit as a small, complete template. To delete a crate and every reference to it, use cargo renzora remove <crate>.
A plugin meant to be installed rather than shipped with the engine does not belong in this repository at all: see Native Plugins.
Output: dist/<platform>/
cargo renzora dist stages a complete engine:
| File | What it is |
|---|---|
renzora / renzora.exe | the binary |
renzora_editor.dll (or librenzora_editor.so / .dylib) | the editor image |
bevy_dylib, renzora_dylib, std-<hash> libraries | the shared images the binary imports |
renzora-companion | the editor's companion process (see Companion) |
renzora-update | the update sidecar |
sdk/ | the plugin SDK, cut from this build |
plugins/ | installed native plugins. The build never writes here; the marketplace and users do |
Platform folders are named <os>-<arch>: windows-x64, windows-arm64, linux-x64, linux-arm64, macos-x64, macos-arm64, plus web-wasm32 for the web build.
Where to go next
- Building from Source: the commands that produce
dist/. - Plugins: writing an in-workspace plugin.
- Code Style: module layout and conventions inside a crate.