Skip to content

Getting Started

import { Steps, Aside, Tabs, TabItem } from ‘@astrojs/starlight/components’;

Welcome to Kani Game Engine — a visual-novel runtime for Rust built on top of Bevy and driven by KAG scripts with embedded Rhai expressions.

  • Rust 1.80 or newer (install via rustup)
  • Cargo (bundled with Rust)
  • A Bevy-compatible platform (Windows, macOS, or Linux)
  1. Create a new Bevy project

    Terminal window
    cargo new my-vn
    cd my-vn
  2. Add kani-runtime to your dependencies

    Terminal window
    cargo add kani-runtime
    cargo add bevy

    Or edit Cargo.toml manually:

    [dependencies]
    bevy = "0.15"
    kani-runtime = "0.1"
  3. Write your entry scenario

    Create assets/scenario/first.ks:

    *start
    #Narrator
    Welcome to my visual novel!
    @l
    The adventure begins here.
    @l
    @jump target=*start
  4. Wire up the plugin

    Replace the contents of src/main.rs:

    use bevy::prelude::*;
    use kani_runtime::{AssetBackend, KaniRuntimePlugin};
    use std::path::PathBuf;
    fn main() {
    App::new()
    .add_plugins(DefaultPlugins)
    .add_plugins(KaniRuntimePlugin {
    asset_backend: AssetBackend::FileSystem {
    base: PathBuf::from("assets"),
    },
    entry_script: "scenario/first.ks".into(),
    })
    .run();
    }
  5. Run

    Terminal window
    cargo run
my-vn/
├── Cargo.toml
├── src/
│ └── main.rs
└── assets/
├── scenario/
│ └── first.ks ← entry script
├── bg/ ← background images
├── chara/ ← character sprites
├── bgm/ ← background music
└── se/ ← sound effects