Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Public API

The boundary

crates/kerosene/src/lib.rs is the game crate and the API boundary. Its public surface is what Kerosene’s version number follows.

PartContentsSemVer
Rootlaunch, LaunchOptions, Game, Engine, EngineConfig, VERSION, preludecovered
Stable modulesengine, entity, math, console, physics, script, ui, platform, vfs, gamecovered
tools (feature)the tool crates, for a game that ships an editorcovered
internalsasset, audio, bsp, config, kv, map, render, walk, …not covered
Re-exported third partiesegui, glam, rhai, winit, serde_json, anyhow, logfollows the upstream

Third-party crates a game names in its own signatures are re-exported so a game cannot link two versions of glam or egui.

The crate is #![warn(missing_docs)], and CI builds its docs with warnings denied.

Versioning policy

  • One lockstep version across all crates; internal dependencies are pinned with = and moved together by scripts/bump-version.sh.
  • Bare-version git tags.
  • Pre-release (1.0.0-aN) versions carry no compatibility promise. Breaking changes are recorded in CHANGELOG.md under Changed and need no migration support until 1.0 or until real games exist.
  • After 1.0, a change to the covered surface follows SemVer.

Full policy: Versioning and Releasing.

Extension points

To…Do
Add rulesimplement Game
Add entity classesregister in Game::classes; describe in Game::schema
Add console commands and convarsregister in Game::setup
Handle custom entity or console verbsGame::entity_request / console_request
Draw HUD or menusGame::wants_ui and Game::ui, or the .kui UI
Persist game stateGame::save / Game::load
React to the storeGame::platform_event
Reuse the stock gamekerosene::game::Stock

See also