FA-85845 / Game economy crafting balance / Member archive
Batch crafting: Available crafts count raw material units · case 05
More crafts are performed than the stockpile can pay for and inventories go negative.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| exact material multiple #1 | {"crafts": 10, "left": {"ore": -15}, "made": 12, "stacks": [5, 5, 2]} | {"crafts": 5, "left": {"ore": 0}, "made": 6, "stacks": [5, 1]} | 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 ↗