Getting started

Tapiti is a Rust workspace. You need a recent stable Rust toolchain (rustup); nothing else to try the generator. The desktop app also needs the usual graphics libraries of your platform (on Linux: xkbcommon, Wayland and/or X11, and OpenGL).

git clone https://github.com/Lucas-BRT/tapiti
cd tapiti

The desktop app

cargo run --release

Pick a level (1 to 5), change the seed, and edit any parameter: the floor is dug again a moment after each change. The side panel has three tabs: the floor reading and layout, every parameter of Λ, and the analysis. The language (English or Portuguese) and the theme are in the bottom bar.

Shortcuts: Alt+1 to 5 switch the level, Alt+R draws a random seed, Alt+← and → step the seed. Drag the map to pan, scroll to zoom, double-click to fit.

The website and the lab

The website you are reading is a Topcoat app. To run it with live reload:

cargo install topcoat-cli
./build.sh                      # the WebAssembly module of the lab
topcoat dev -p tapiti-site      # http://127.0.0.1:3000

The lab (/lab) runs the generator in your browser, compiled to WebAssembly.

Docker

docker compose -f compose.local.yml up --build

serves the same site on http://localhost:8090. compose.yml is the version meant for a Dokploy deployment; set TAPITI_SITE_URL to the public address so canonical links and social previews point to it.

Using the crate

tapiti-core is the generator, with no UI. Add it as a git dependency:

[dependencies]
tapiti-core = { git = "https://github.com/Lucas-BRT/tapiti" }
use tapiti_core::{params::params_of_level, stage::stage};

fn main() {
    let params = params_of_level(5);
    // Up to 8 draws: a floor the validator rejects is dug again from a derived seed.
    let staged = stage(42, &params, 8);
    assert!(staged.violations.is_empty());
    println!("{} rooms, {} corridors", staged.d.rooms.len(), staged.d.edges.len());
}

The same seed and parameters always give the same floor, native or WebAssembly.

Command-line tools

cargo run --release -p tapiti-core --example dump               # a hash per stage, to compare two builds
cargo run -p tapiti-render --example export_svg -- 5 26 floor.svg dark   # level, seed, output, theme
cargo bench -p tapiti-core --bench generator                    # Criterion benchmarks

Where to go next

Edit this page on GitHub