Flexweave
Getting Started

Mechanics at the Boundary

How Flexweave primitives compose with caller-owned runtime logic.

Flexweave owns reusable mechanics shape. Your runtime owns application meaning.

That boundary is the main design rule for the rest of the guide. When the RPG example names Slash, QuickenedStrikes, Fortify, or Bleed, those are consumer-owned payload variants. Flexweave only sees typed payloads, tags, object ids, lifecycle commands, and emitted facts.

Why This Matters

Abilities do not inherently spend mana. Effects do not inherently damage health. Tags do not inherently mean buffs or cooldowns. Those meanings are implemented by caller-owned gates, commit actions, effect execution actions, derived attribute calculators, and adapters.

This keeps the library small and lets different runtimes use the same primitive contracts with different semantics.

The Shape of a Consumer Runtime

The RPG chapters converge on this kind of ordinary Rust state:

struct CombatRuntime {
    state: CombatState,
    abilities: AbilityStore<TagSet<CombatTag>, AbilityPayload>,
}

The runtime can be a server session, an ECS resource bundle, a simulation test, or a game-engine subsystem. Flexweave does not require a particular host shape.

Continue with Create Combatants.

On this page