FAILURE MAP
← Case archive

FA-85862 / Game economy crafting balance / Member archive

Batch crafting: Batch consumes one craft worth of materials · case 02

Long batches only charge materials for a single craft and duplicate resources.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

recipe = {inputs:{material:qty}, output, yield, stack}. Crafts = min(requested, floor(have/qty) per input), 0 when requested <= 0. With skill in [50, inf) every 5th craft adds one bonus item (bonus = crafts//5). made = crafts*yield + bonus, split into full stacks of size stack plus one partial stack. left = whole inventory (all materials) after consuming crafts*qty of each input, sorted by name.

Why this case matters

Game economies leak or destroy currency when one crafting or pricing rule is off by one boundary, rounding stage or state update; the defect is observable in exact integer outcomes.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
one short of a batch #1{"crafts": 4, "left": {"herb": 2, "ore": 11, "wood": 7}, "made": 8, "stacks": [4, 4]}{"crafts": 4, "left": {"herb": 2, "ore": 2, "wood": 1}, "made": 8, "stacks": [4, 4]}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗