Skip to main content

Crate clairlune_scene

Crate clairlune_scene 

Source
Expand description

Deterministic scene generation for Clairlune.

seed -> SceneRecipe -> SceneGraph. This crate is pure: no OS calls, no I/O, no clocks. The same inputs give byte-identical outputs on every platform, which is why it uses its own stable hashing, ChaCha8 as a raw bit source with hand-written integer sampling, and libm for transcendental functions.

Re-exports§

pub use activity::Activity;
pub use activity::Catalog;
pub use build::BuildError;
pub use build::BuildOptions;
pub use build::build;
pub use compose::compose;
pub use graph::Cell;
pub use graph::CharacterTrack;
pub use graph::GridSpec;
pub use graph::Lighting;
pub use graph::Motion;
pub use graph::SceneGraph;
pub use graph::SpriteInstance;
pub use graph::SpriteKind;
pub use graph::grid_spec;
pub use ident::APP_ID;
pub use ident::APP_NAME;
pub use palette::PaletteFamily;
pub use palette::Rgb;
pub use palette::Theme;
pub use recipe::Aspect;
pub use recipe::ContentContext;
pub use recipe::GENERATOR_VERSION;
pub use recipe::SceneRecipe;
pub use recipe::TimeOfDay;

Modules§

activity
Activities: what the character is doing (PLAN.md section 4.7).
anim
The seeded activity state machine (PLAN.md section 4.7).
archetype
Archetypes declare the capabilities they offer. Activities declare the capabilities they need. Neither names the other, so a new archetype works with existing activities and vice versa (PLAN.md section 4.7).
build
build(recipe, size, theme, buddy) -> SceneGraph.
compose
compose(seed, aspect, ctx) -> SceneRecipe: sequential, seeded, weighted picks.
focal
Focal-group layout: the character’s motion range, the activity’s props on either side, and the unattended variant. Shared by every archetype; the archetype only supplies the ground line.
glyphs
The global glyph table and the glyph families used by layers.
graph
The scene graph: a resolution-specific, theme-specific description of what to draw. Static layers are a grid of glyph cells; animated elements are sprite instances and particle emitters.
hash
Stable hashing.
ident
The app’s name, in one place. Window titles, the tray tooltip, config and data directory names and the bundle identifier all derive from these two constants.
math
Small math helpers.
noise
Hand-written value noise. Small, dependency-free and deterministic: only floor, +, -, * on f64, with lattice values from the stable hash.
palette
Palette families (data). The render crate turns a family into an indexed palette of at most 255 entries.
particles
Seeded, periodic particles. Each particle’s state is a pure function of t mod life, and every life divides the loop length, so animations loop seamlessly (needed for GIF export, free for live mode).
placeholder
Milestone M1 placeholder pixel maps, taken from the Python prototype (PLAN.md section 13). Milestone M2 replaces them with project-drawn sprite sheets behind a Character trait in a sprites crate.
recipe
The scene recipe: a small, theme-independent JSON document that reproduces a scene at any resolution, in either theme it supports, with or without Clawd. The recipe, not the pixels, is what gets archived.
rng
Deterministic random numbers.