Skip to content

Cookbook

Small, complete compositions built entirely from the public API — things the seams allow that nothing in the framework points at.

What a recipe is

One class you drop into a project that already exists. Not a tutorial, not a demo of how a system works, and not a scene you have to run. A pattern, and a starting point you can lift, read, change, or throw away once you have seen how it goes together.

There is a gap between being comfortable with the patterns in the Teachables and being experienced enough to look at the public seams and see what could be composed from them. These pages are for that gap. Each one leads with something you might not have realised the framework lets you build, then shows the whole implementation and the traps found while writing it.

What do you want to build?

Every recipe appears under each question it genuinely answers, so several are listed more than once. Nothing here needs configuring — scroll, and take whatever looks interesting.

The small italic line is the other two ways in

The systems a recipe needs installed, and its shape — how conceptually involved the composition is. Both are explained under the table, and neither is something you have to care about to browse.

The sidebar files each recipe under one category and this page files it under all of them. That is deliberate: a menu should put a thing in one place so you can find it again, while this page is answering "what could I build", and plenty of recipes answer more than one question.

Combat & Survival

  • Brewing straight into a buff — A craft that ends in an effect on the crafter rather than an item in the bag
    Crafting, Status Effects · Composite
  • Buffs that run down while the game is closed — Offline time that expires effects rather than running them, on a save participant that has to go last
    Status Effects, Save · Subtle
  • A curse that bleeds gold — An effect you wrote yourself, draining currency every second through the ordinary status pipeline
    Status Effects, Currency · Focused
  • A cursed item — Wearing it applies a status effect; taking it off removes that one and leaves the potion's alone
    Inventory, Status Effects · Subtle
  • Death drops — On death, scatter some of what the actor was actually carrying — a drop table built from the corpse, not authored in advance
    Health, Inventory, Loot · Composite
  • An encounter that replays roll for roll — One seeded crit stream shared by every CritRule, so an encounter replays roll for roll — through the one of two install doors that survives a re-enable
    Health · Composite
  • Fire damage that actually sets you on fire — A hit tagged Fire leaves a burn behind — and the burn still runs out, because a status tick comes back through the same pipeline carrying the same tag
    Health, Status Effects · Subtle
  • A healer who charges by the point — Bill for the healing that actually landed, not the healing that was asked for
    Health, Currency · Composite
  • Healing that gets weaker the more you receive — Anti-stacking diminishing returns, on the one Health seam the pipeline consumes and nothing implements
    Health · Composite
  • Last stand — Survive one otherwise-lethal hit, then go on cooldown — and only spend the save when it was needed
    Health · Focused
  • Loot odds that shift with the player's condition — Better odds when the player is nearly dead, or while a buff is running — real odds, decided at the roll
    Loot, Health, Status Effects · Composite
  • Only your worst debuff counts — Two 1.5x curses make you take 50% more damage, not 125% — on the one seam the framework checks first and nothing implements
    Health · Composite
  • Recipes that cost blood — A bench that charges health: it refuses what you cannot survive, and takes the price when the craft lands
    Crafting, Health · Composite
  • A shield that spends money — A ward that buys off damage a point at a time — charging first, because a mitigation that can be sized to the payment should be
    Health, Currency · Subtle
  • A shop that takes payment in blood — The same shop service and the same price bundle, with a wallet that happens to be a body
    Economy, Health, Currency · Focused

Shops & Economy

Crafting & Progression

  • Brewing straight into a buff — A craft that ends in an effect on the crafter rather than an item in the bag
    Crafting, Status Effects · Composite
  • A craft that cleans up after itself — Charge, consume and deliver in one transaction — a leg that fails after another succeeded is compensated, and a repeat of the same request is replayed rather than charged again
    Crafting, Economy, Currency · Subtle
  • A craft that costs two currencies — Fifty gold and three shards, with the shards reserved the moment the craft is accepted and taken only when it lands
    Crafting, Currency · Composite
  • Crafts that fall on the floor instead of vanishing — A job that finishes into a full bag drops its output on the ground rather than evaporating
    Crafting, Loot, Pickups · Composite
  • Each bench fills its own chest — Send each bench's output to the chest it feeds — and never route on the quantity, because batch crafting binary-searches the count
    Crafting · Subtle
  • Recipes that cost blood — A bench that charges health: it refuses what you cannot survive, and takes the price when the craft lands
    Crafting, Health · Composite
  • Salvage, without authoring a single salvage table — Break an item back down into some of what it was made of, by reading the recipes you already wrote backwards
    Crafting, Loot, Inventory · Composite
  • A search box that knows what you can make — The search seam is handed a raw string, so the box can be a query language — @craftable lights up exactly the ingredients for something you could finish right now
    Inventory, Crafting · Composite
  • While you were away — What finished, what could not be delivered, and what is still on the bench when a save loads
    Crafting · Focused

Items & Equipment

  • Crafts that fall on the floor instead of vanishing — A job that finishes into a full bag drops its output on the ground rather than evaporating
    Crafting, Loot, Pickups · Composite
  • A cursed item — Wearing it applies a status effect; taking it off removes that one and leaves the potion's alone
    Inventory, Status Effects · Subtle
  • Death drops — On death, scatter some of what the actor was actually carrying — a drop table built from the corpse, not authored in advance
    Health, Inventory, Loot · Composite
  • Facing works, and your sprite never rotates — Face-to-pick-up works for a sprite that never rotates — without a provider the fallback points permanently up, so in 2D this seam is required rather than optional
    Pickups · Focused
  • A pouch that arrives whole or not at all — A loot pouch that arrives whole or not at all — because a partial delivery reported as a refusal is not a refusal, it is duplication
    Inventory · Subtle
  • Salvage, without authoring a single salvage table — Break an item back down into some of what it was made of, by reading the recipes you already wrote backwards
    Crafting, Loot, Inventory · Composite
  • A search box that knows what you can make — The search seam is handed a raw string, so the box can be a query language — @craftable lights up exactly the ingredients for something you could finish right now
    Inventory, Crafting · Composite
  • A shop that hands over the goods when the bag is full — The purchase lands on the floor instead of the sale failing: the same shop, with a different store
    Economy, Pickups, Inventory · Subtle
  • A tidy that leaves your favourites alone — Hit Sort and the potion you always keep in slot two stays in slot two — on the seam whose last line of comparison is the whole of a documented stable sort
    Inventory · Composite
  • Turning the fireworks off without touching the content — Silence chosen decorator types on every effect chain built while it is installed — on the one seam whose default is public, so it can be wrapped instead of transcribed
    Pickups · Composite

Loot & Rewards

Persistence & State

  • Buffs that run down while the game is closed — Offline time that expires effects rather than running them, on a save participant that has to go last
    Status Effects, Save · Subtle
  • A chest that stays looted — Open it once and it is empty forever, including across a reload
    Loot, Save · Subtle
  • A save that survives a crash mid-write — Keep the previous save, so an interrupted write does not take the run with it — the fourth time the thing to vary turned out to already be a parameter
    Save · Subtle
  • A shop that remembers — Stock that goes down when players buy things, and is still as they left it after a reload
    Economy, Save · Subtle
  • While you were away — What finished, what could not be delivered, and what is still on the bench when a save loads
    Crafting · Focused

Rules & Authority

  • A craft that costs two currencies — Fifty gold and three shards, with the shards reserved the moment the craft is accepted and taken only when it lands
    Crafting, Currency · Composite
  • One switch that refuses everything — A cutscene lock, safe zone or spectator mode built from the authority seam every system already ships — without touching timeScale
    Crafting, Currency, Health, Inventory, Pickups, Status Effects · Composite
  • Recipes that cost blood — A bench that charges health: it refuses what you cannot survive, and takes the price when the craft lands
    Crafting, Health · Composite
  • Turning the fireworks off without touching the content — Silence chosen decorator types on every effect chain built while it is installed — on the one seam whose default is public, so it can be wrapped instead of transcribed
    Pickups · Composite

All of them, in one table

Recipe Systems Package Shape What it gives you
Brewing straight into a buff Crafting, Status Effects Complete Composite A craft that ends in an effect on the crafter rather than an item in the bag
Buffs that run down while the game is closed Status Effects, Save Health & Status Effects Subtle Offline time that expires effects rather than running them, on a save participant that has to go last
Catching a loot tree that quietly awards nothing Loot Inventory, Pickups & Crafting Focused Finds the cycles, dead branches and truncated nesting that award nothing in a release build
A chest that stays looted Loot, Save Inventory, Pickups & Crafting Subtle Open it once and it is empty forever, including across a reload
A craft that cleans up after itself Crafting, Economy, Currency Complete Subtle Charge, consume and deliver in one transaction — a leg that fails after another succeeded is compensated, and a repeat of the same request is replayed rather than charged again
A craft that costs two currencies Crafting, Currency Complete Composite Fifty gold and three shards, with the shards reserved the moment the craft is accepted and taken only when it lands
Crafts that fall on the floor instead of vanishing Crafting, Loot, Pickups Inventory, Pickups & Crafting Composite A job that finishes into a full bag drops its output on the ground rather than evaporating
A curse that bleeds gold Status Effects, Currency Complete Focused An effect you wrote yourself, draining currency every second through the ordinary status pipeline
A cursed item Inventory, Status Effects Complete Subtle Wearing it applies a status effect; taking it off removes that one and leaves the potion's alone
Death drops Health, Inventory, Loot Complete Composite On death, scatter some of what the actor was actually carrying — a drop table built from the corpse, not authored in advance
Each bench fills its own chest Crafting Inventory, Pickups & Crafting Subtle Send each bench's output to the chest it feeds — and never route on the quantity, because batch crafting binary-searches the count
An encounter that replays roll for roll Health Health & Status Effects Composite One seeded crit stream shared by every CritRule, so an encounter replays roll for roll — through the one of two install doors that survives a re-enable
Facing works, and your sprite never rotates Pickups Inventory, Pickups & Crafting Focused Face-to-pick-up works for a sprite that never rotates — without a provider the fallback points permanently up, so in 2D this seam is required rather than optional
Fire damage that actually sets you on fire Health, Status Effects Health & Status Effects Subtle A hit tagged Fire leaves a burn behind — and the burn still runs out, because a status tick comes back through the same pipeline carrying the same tag
A healer who charges by the point Health, Currency Complete Composite Bill for the healing that actually landed, not the healing that was asked for
Healing that gets weaker the more you receive Health Health & Status Effects Composite Anti-stacking diminishing returns, on the one Health seam the pipeline consumes and nothing implements
Last stand Health Health & Status Effects Focused Survive one otherwise-lethal hit, then go on cooldown — and only spend the save when it was needed
Loot odds that shift with the player's condition Loot, Health, Status Effects Complete Composite Better odds when the player is nearly dead, or while a buff is running — real odds, decided at the roll
One switch that refuses everything Crafting, Currency, Health, Inventory, Pickups, Status Effects Complete Composite A cutscene lock, safe zone or spectator mode built from the authority seam every system already ships — without touching timeScale
Only your worst debuff counts Health Health & Status Effects Composite Two 1.5x curses make you take 50% more damage, not 125% — on the one seam the framework checks first and nothing implements
A pickup you have to pay for Pickups, Currency Complete Subtle A coin-operated door or vending plate, ordered so the money only moves once the goods have landed
A pity counter, built on the seam that cannot do pity counters Loot Inventory, Pickups & Crafting Subtle After a dry spell the next award is swapped for one from a table you author — and the printed odds never move
A pouch that arrives whole or not at all Inventory Inventory, Pickups & Crafting Subtle A loot pouch that arrives whole or not at all — because a partial delivery reported as a refusal is not a refusal, it is duplication
Recipes that cost blood Crafting, Health Complete Composite A bench that charges health: it refuses what you cannot survive, and takes the price when the craft lands
Salvage, without authoring a single salvage table Crafting, Loot, Inventory Inventory, Pickups & Crafting Composite Break an item back down into some of what it was made of, by reading the recipes you already wrote backwards
A save that survives a crash mid-write Save Any Subtle Keep the previous save, so an interrupted write does not take the run with it — the fourth time the thing to vary turned out to already be a parameter
A search box that knows what you can make Inventory, Crafting Inventory, Pickups & Crafting Composite The search seam is handed a raw string, so the box can be a query language — @craftable lights up exactly the ingredients for something you could finish right now
A shield that spends money Health, Currency Complete Subtle A ward that buys off damage a point at a time — charging first, because a mitigation that can be sized to the payment should be
A shop that hands over the goods when the bag is full Economy, Pickups, Inventory Complete Subtle The purchase lands on the floor instead of the sale failing: the same shop, with a different store
A shop that remembers Economy, Save Currency & Economy Subtle Stock that goes down when players buy things, and is still as they left it after a reload
A shop that takes payment in blood Economy, Health, Currency Complete Focused The same shop service and the same price bundle, with a wallet that happens to be a body
A shopkeeper who charges you more when you are cursed Economy, Status Effects Complete Focused Prices that read the buyer's condition at the moment of the sale
Short on gold, but you have silver Currency, Economy Currency & Economy Subtle Short on gold and long on silver, the till converts the exact minimum — by searching a quote that only runs the other way
A tidy that leaves your favourites alone Inventory Inventory, Pickups & Crafting Composite Hit Sort and the potion you always keep in slot two stays in slot two — on the seam whose last line of comparison is the whole of a documented stable sort
Turning the fireworks off without touching the content Pickups Inventory, Pickups & Crafting Composite Silence chosen decorator types on every effect chain built while it is installed — on the one seam whose default is public, so it can be wrapped instead of transcribed
While you were away Crafting Inventory, Pickups & Crafting Focused What finished, what could not be delivered, and what is still on the bench when a save loads

The three things each row tells you

Systems is what a recipe needs installed. It comes from the recipe's own assembly definition, so it cannot drift away from the code — with one honest exception: five recipes reach a further system at runtime through an integration assembly, a bootstrap, or an interface whose only consumer lives elsewhere, rather than by reference. Those are listed too, because "what do I need installed" is the question being asked, and each page explains its own case.

Package follows from the systems. Read it first if you own a single package, because systems are grouped and it is not guessable: Loot ships inside Inventory, Pickups & Crafting, so a recipe naming two systems from different packages needs Complete however modest it looks. Where a recipe is Complete-only the page is still worth reading on a single package — the seam it finds is usually in your systems even when the composition is not.

One row says Any, and it is not a rounding error. Save lives in Core, and Core ships in every package, so a save that survives a crash mid-write runs wherever RevFramework does.

Shape is signposting, and nothing else

Focused is one idea — read it top to bottom and you have it. Composite is two or more behaviours where the relationship between them is the point. Subtle means correctness turns on timing, ordering, atomicity or lifecycle: transactions, re-entrancy, restore order, partial success.

It describes the composition, never you, and never support status — every recipe here is supported identically. It is not a difficulty ladder to climb in order. Plenty of people will want the subtle ones first, because that is where the interesting findings are.

Shape is also not size or system count. Lockdown touches six systems and is Composite; a forty-line save store is Subtle because one line in it has to be in the right place.

One of them is deliberately much wider than the rest. One switch that refuses everything needs six systems, and so compiles only where all six are present. That is the recipe, not an accident of how it was written: every system ships an authority seam, and the only way to show that they are the same seam is to answer for all of them at once. Split it into three narrower recipes and the finding it exists to carry disappears. The test applied here is whether a recipe needs its width or is collecting systems — and that one needs it.

How to use them

Copy the class into your own project and change it. That is the intended path — these are not a library, nothing here ships in the package, and there is no RevFramework.Cookbook assembly to reference. Every recipe uses only the public API, and CI compiles each one against the framework on every change — so a release that moved a seam one of them depends on would break the build rather than break it quietly.

That is a compile guarantee, and it is worth being precise about what it does not cover. A recipe is example code: it is compiled, not run. A framework change that keeps a signature and changes what it does — or an id, a default or a wiring step that stops matching — compiles perfectly and is exactly the kind of thing that has needed catching here before. Read a recipe as a pattern to understand, not as a component under warranty.

Once you change it, it is your code

That is not a disclaimer bolted on — it is what "copy it and change it" means. A recipe you have edited is part of your codebase, and debugging it is your job in the same way the rest of your game is. Support covers the framework's behaviour, and a reproducible framework bug is always worth reporting. It does not cover a modified copy of a class from this page.

Which is also why every page spends more words on why the composition works than on what the code does line by line: the pattern is the part you keep after you have changed everything else.

Read the warnings, even if you skip the code

The boxed notes on each page are the parts that cost time to find — a swap that raises no unequip event, a preview that must run your arithmetic but touch no state, a runtime object Unity will not collect for you. They are worth a minute whether or not you use the recipe they came from.

  • System documentation — what each system is for, how it is put together, and its public API. Start there if a system is new to you; come here once you want to combine two of them.
  • Teachables — the guided, in-editor demonstrations. They show a system working; these show systems meeting.