KosunoSource

Native game engine & editor · built in Rust

Kosuno

One editor. Any kind of game.

A native game engine and editor. Start with scenes, physics, scripting and UI, then add what your game needs: destructible voxel worlds, visual novels, vector UI, procedural meshes. Ship to desktop, web and Android.

Try it · press PlayIllustrative editor
FileEditViewPackagesBuild
island.rvs
SceneGameedit · 0.00s
ConsoleAssetsContent
  1. infoOpened scene island.rvs · 7 nodes
  2. infoPackages: core · voxel · physics.current · story

Play runs the authored scene in place. Stop restores the document exactly as it was, so runtime changes never leak into what you save.

Built in
Rust · native
Graphics
wgpu · WGSL
Scripting
Rhai · Rust components
Targets
Desktop · Web · Android

01 Packages

Pick what your game needs. Compile away the rest.

A project's packages.toml decides which capabilities exist. The editor, the player, the content CLI and the build tool all resolve it through one crate, so they always agree. Leave out voxels and you have a mesh game: none of the voxel code is compiled in.

Packages panel

Assets/packages.toml

Compiled into this build

    Packages

    Leave voxels out. None of that code ships.

    02 The editor

    An editor built like the engine: open all the way down.

    The editor is the primary product, not a debug overlay. Scroll through it.

    1. 01 · Inspector

      Inspectors for free

      Components that derive Inspector get a field visitor automatically: ranges, sliders, enums and asset pickers. Write a custom inspector only when you want one.

      #[kosuno_derive::engine_component]
      pub struct Turret {
          #[inspector(range = 0.0..=720.0, suffix = "°/s")]
          pub turn_speed: f32,
          #[inspector(range = 1.0..=500.0, log)]
          pub range: f32,
          pub target: NodeRef, // a handle, never a path
      }
    2. 02 · Hierarchy

      Prefabs that compose

      A prefab is a scene referenced by a component. Instances store only their override, so editing the template updates every instance and saving writes exactly what you changed.

    3. 03 · Scene view

      Views with gizmos

      A free-fly Scene camera and a Game view that mirrors the scene camera at the resolution and zoom you pick. Components contribute their own gizmos, handles and tools.

    4. 04 · Scene view · UI

      Lay out game UI in place

      The Scene view shows your HUD at the Game view's resolution. Pick, move and resize screen UI right there, and the canvas scales evenly to other screen shapes.

    5. 05 · Assets

      Hot reload, per file

      Change a scene, voxel object, shader, controller or Rhai script on disk and only what depends on it reloads. Every asset has a GUID, so renaming or moving files breaks nothing.

    6. 06 · Game State

      Watch and edit game state live

      While you play, the Game State panel shows every resource and Gameplay Actions logs each command. Edit a value in place: the change is validated like a gameplay command and carries into later saves.

    7. 07 · Play controls

      Checkpoints in Play

      Pause, take a checkpoint, and return to it later in the same session. Stop always restores the authored scene exactly, with entity ids kept, and Play keeps its own undo history.

    8. 08 · Menus & panels

      Everything is a plugin

      Panels, menus, inspectors, importers, documents and tools all register through one plugin API. The built-in panels use the same calls a plugin does, and View → Architecture shows a wiki generated from the code.

    03 One frame

    What you press Play on is what you ship.

    The engine owns the frame: the phase order and the gameplay work inside each phase. The editor and every player host only add platform work around it. Play in the editor and a shipped game run the same code path.

    kosuno_engine · simulation frame fixed order · every host
    Editor · Playviewport input
    1. Pose sync
    2. Pointer
    3. Scripts
    4. Components
    5. Tweens
    6. Animation
    7. Physics
    8. Triggers
    9. Debris
    10. Clock
    gizmos + dock UI
    Desktopwinit eventspresent
    Web (wasm)canvas eventspresent
    Androidactivity eventspresent
    iOSUIKit eventspresent

    Preflight before side effects

    Before a scene loads or Play starts, preflight walks what the scene references and checks every capability against the project's packages. A refusal names the missing package and leaves the current scene untouched.

    Stop means restore

    Preflight validates the unsaved document, not the last saved file, so what is checked is what runs. Stop puts the authored scene back exactly as it was.

    Same input, everywhere

    One winit adapter translates window events into the engine's per-frame Input, so keys, mouse and touch behave the same in the editor and in a shipped game.

    04 Renderer

    A render graph that does only the work you can see.

    Kosuno renders with wgpu through a feature-driven render graph. Features declare their passes and resources, the graph culls passes nothing consumes, and transient textures are pooled. The mesh path works on its own; voxel ray marching is a backend the voxel package adds.

    render graph · this frame culled passes cost nothing
    Mesh
    1. Depth prepass
    2. Shadow maps
    3. Opaque
    Voxel (package)
    1. Brick DDA march
    Post
    1. SSRculled · no consumer
    2. TAA
    3. Upscale
    UI + Vector
    1. UI
    2. Vector coverage
    → swapchain

    Shaders

    Materials without engine changes

    A material names a shader and its properties. Custom .rvsl shaders are tracked assets: the renderer reflects their uniforms and fills them from the material, and they hot-reload.

    Settings

    Live-tunable

    Rendering and environment settings load from config/ and can be tuned live. A setting that changes compiled shader branches rebuilds that one pipeline; anything else is a uniform and applies on the next frame.

    Profiling

    GPU timestamps built in

    Per-pass wgpu timestamp queries feed a readback ring buffer, so you can see what each pass costs on real hardware, Android included.

    05 Animation

    Animate any property. Wire it as a state machine.

    Clips key any component field: transforms, UI, materials, even Machina graph parameters. A dope sheet edits the keys, and reusable controllers wire clips into states and transitions as a node graph, with crossfades, typed parameters and layers. Try it: fire the triggers and watch the state machine run.

    examples/cards/ember_card.rvctrl ● Live · Card
    ⚡drawon end⚡playon end · fade 0.3⚡reset▶ deckdeck.rvanim ⟳drawdraw.rvanimhandhand.rvanim ⟳playplay.rvanimAny state
    Triggers
    state deck · clip deck.rvanim

    Controllers

    Reusable .rvctrl assets

    Every Animator that references a controller shares its states, rules and layers. Saving the controller hot-reloads every Animator using it.

    Layers

    Override and additive

    Layers blend over the base with property masks, so a hover wobble can play on top of whatever state the card is in.

    Scripting

    Drive it from Rhai

    animator_trigger("draw") queues a trigger; parameters feed conditional transitions; completion callbacks tell scripts when a clip ends.

    06 Plugins

    Whole genres, shipped as packages.

    Each plugin comes in two halves: a runtime crate the player links, and an editor crate that registers documents, inspectors and hot reload through the editor's open registries. The editor core never names their formats.

    story · kosuno_story · .story

    Visual novels in plain text

    Scenes, lines, choices, conditions and @ stage commands. Mistakes become diagnostics on their line and the rest still runs. Every stop takes a snapshot, so rollback and save slots come from the same mechanism.@run hands control to a minigame prefab. Try it: the highlighted line is the one being played.

    examples/story/demo.story $trust = 0
    zoom 1.0×

    vector · kosuno_vector · .svg · .rvv

    GPU vector graphics

    A Rust and WGSL port of the Rive Renderer's coverage pipeline. Curves stay sharp at any scale without a texture atlas. .rvv adds bone rigs, keyframes and a state machine scripts can drive. Scroll to morph the path.

    cooked 3 nodes

    machina · kosuno_machina · .rvg

    Procedural geometry graphs

    Machina is a node-graph mesh system in the style of Houdini SOPs, linked as a pinned Rust library with no FFI. Changing a parameter recooks only the nodes downstream of it.

    Oakmere Crossing · 512 × 512 m

    57 million voxels. One file.

    07 The voxel package

    Worlds made of tens of millions of 25 cm voxels.

    Selecting the voxel package compiles in sparse brick volumes, a ray-marching renderer backend, voxel shells as a physics shape, streaming and destruction. Every surface in these worlds is voxel data: buildings, trees, water, vehicles and signs. There are no imported meshes and no billboards.

    destruction · click to carve

    Click the bridge pillars ↓

    Illustration in canvas 2D, not the engine renderer.
    Top-down plan of Oakmere Crossing, a country-town railway diorama with a river, lake, fields and 40 buildings
    Oakmere Crossing512 × 32 × 512 m · 57.2M voxels
    Top-down plan of Saint Alder, an overgrown post-apocalyptic city district with a river and roundabout
    Saint Alder73 buildings · 46.7M voxels
    Top-down plan of Brightwater Bay, a colourful city-builder town grid with a stadium, park and beach
    Brightwater Bay512 × 64 × 512 m · towers to 57 m

    Plans of three demo worlds built by the repository's world generators (tools/worlds/).

    Format

    One file for worlds and bodies

    .rvo is a bag of chunks, each a brick table, a brick pool and optional terrain sections. A rigid body is a one-chunk file with its exact voxel extent recorded beside its bricks.

    Streaming

    Large worlds, paged

    Chunks page in and out around the camera into a ring-buffer grid, and a disk cache keeps decoded chunks between runs.

    Destruction

    Carve, detach, simulate

    Damage carves voxels. Pieces that lose support detach as new rigid bodies. Physics dispatches per pair, per pass or per ray, never per voxel.

    08 Ship anywhere

    One player core. Every screen.

    kosuno_player holds one Scene, one Renderer and the per-frame loop. Every platform shell is a thin wrapper around it, so your game behaves the same on desktop, in the browser and on mobile. Builds start from the editor's Build Settings panel and cook only the content your scenes reference.

    kosuno_playerScene · Renderer · frame loop
    • Desktop

      kosuno_desktop

      Windows · macOS · Linux

    • Web

      kosuno_web

      WebAssembly on WebGPU

    • Android

      kosuno_android

      APK builds

    • iOS

      kosuno_ios

      Simulator builds today

    Toolchains install from the editor

    Each platform page lists what it needs, with sizes, and installs, repairs or removes it in the background. Nothing downloads without a click, and the same operations run from the command line.

    Linux builds from macOS and Windows

    A pinned Zig toolchain cross-compiles the Linux player with no VM, Docker or sysroot. It runs on glibc 2.28 and newer.

    Ship only what you use

    A scene list picks what goes in the build. The build preview lists every asset it will include, with its size and the reason it's included.

    In the repository

    Demo scenes you can open today.

    Open any of them in the editor and press Play. The city worlds are built by the world generators in tools/worlds/.

    • Oakmere Crossing demo scene
      voxel worldOakmere Crossingoakmere.rvs · generated
    • Saint Alder demo scene
      voxel worldSaint Aldersaint_alder.rvs · generated
    • destructionTank combat labtank_combat_lab.rvs
    • physicsMesh physicsmesh_physics.rvs
    • visual novelCafé storystory.rvs
    • GPU vectorVector showcasevector.rvs
    • procedural meshMachinamachina.rvs
    • GPU particlesParticle labparticle_lab.rvs
    • input + UIRTS input labrts_input_lab.rvs
    • no voxelsMesh onlymesh_only.rvs

    09 Principles

    Built on rules that tests enforce.

    The architecture page is generated from the code, and a test fails when the two drift apart. These invariants are part of it.

    1. 01

      Handles, never paths

      Entities reference each other by EntityId inside a session and by Uuid across sessions. Assets are referenced by GUID. A rename touches one field.

    2. 02

      Components are pure data

      Runtime state lives in side-stores keyed by entity, never in component fields. Inspector edits cannot wipe a physics body handle.

    3. 03

      No closed lists

      Components, assets, importers, panels, inspectors and shape kinds all register into open registries. Adding a type never means editing a central match.

    4. 04

      Prefabs compose on read

      A node stores only what its host authored. Prefab state is composed from the cached template plus the instance override, never appended.

    5. 05

      Exactly one physics provider

      Gameplay talks to a solver-neutral physics API. A second provider is an adapter that passes the same conformance suite, not a rewrite.

    6. 06

      Every composition builds

      The engine and the editor compile without warnings, with and without the voxel package, and a check builds each composition.

    Get started

    Open the editor
    in two commands.

    Clone the repository, build with stable Rust 1.95 or newer, and launch through the restart supervisor. Machina is fetched automatically at a pinned commit.

    terminal macOS · Linux · Windows
    # first build also prepares offline launches
    $ cargo build --locked -p kosuno_editor -p xtask
    $ ./run-editor.sh            # run-editor.cmd on Windows
    
    # an optimized editor for performance work
    $ ./run-editor.sh --release
    
    # ship a player
    $ cargo xtask web build
    $ cargo xtask android build