Bash.tv → GitHub → itch.io

Recipes, resources and crafting mechanics. Recipes as data with inputs, outputs, tools that aren't consumed, required stations, craft time, learning and discovering recipes, "what can I craft now" and "how many can I make", missing-ingredient lists, safe crafting that rolls back when the bag is full, recursive raw-material costs for planning, and crafting UI. Includes a tested crafting.js that ...

Download skill (.zip) Files on GitHub

Crafting system

Drop-in: assets/crafting.js (tests: unlearned recipes, missing tools and inputs, required station, crafting several at once, max craftable, rollback when there’s no room, raw cost expansion). Uses any inventory with count / has / add / remove (inventory-system).

import { createCrafting } from "./core/crafting.js";
const RECIPES = {
  plank:  { in: { log: 1 }, out: { plank: 4 } },
  table:  { in: { plank: 4, nail: 2 }, tools: ["hammer"], station: "bench", out: { table: 1 }, time: 2 },
  torch:  { in: { stick: 1, coal: 1 }, out: { torch: 4 }, discoverWith: ["coal"] },
};
const crafting = createCrafting(RECIPES, { known: ["plank"] });
crafting.canCraft("table", bag, { station: nearStation })   // { ok } or { ok:false, reason, missing: { nail: 2 } }
crafting.craft("plank", bag, {}, 3)                           // { ok, made: { plank: 12 } }
crafting.discover(bag)                                        // after pickups → ["torch"]: "New recipe!"
crafting.rawCost("table")                                     // { log: 1, nail: 2 } for planning UI

The loop

Gather → craft → use the result to gather better or survive longer. Every recipe should unlock a new action or area, not just a bigger number.

Design rules

UI for every device

List or grid; tap/click a recipe to see inputs with have/need counts (red when short); big Craft button; hold to craft many. Gamepad: d-pad through recipes, A to craft.