Flexweave

Flexweave

Deterministic, domain-neutral mechanics primitives for Rust runtimes.

Flexweave is a Rust library for building deterministic mechanics without tying an application to a particular genre, engine, content format, or scheduling model. It provides domain-neutral building blocks for stable objects, typed attached data, numeric attributes, tags and queries, ability and effect lifecycles, clocks, lifecycle facts, and signals.

Flexweave owns the shape of mechanics state and its transitions. Your runtime decides what those mechanics mean, how they are orchestrated, and how their facts become application events. Given identical primitive inputs, Flexweave preserves object ids, iteration and query order, lifecycle facts, and results, making it useful for tests, simulations, replays, validation, and server-side command processing.

This site is organized as a progressive guide. Start with a quick orientation, then build a complete RPG combat runtime, then use the concept and pattern chapters to adapt the primitives to your own application.

The Reader Path

  1. Getting Started introduces the crate and local setup.
  2. Building an RPG Combat Runtime walks through a cohesive example with a player, enemies, attributes, abilities, effects, buffs, lifecycle events, signals, and cleanup.
  3. Core Concepts explains the primitives behind the example.
  4. Runtime Patterns shows focused integration recipes for consumer apps.
  5. Design Notes explains mechanics tradeoffs.
  6. API Reference is separate from the guide and covers the public library surface.

Main Example

The RPG combat chapters are backed by a compile-checked example in the Flexweave crate:

cargo run -p flexweave --example rpg_combat

On this page