FAILURE MAP
← Case archive

FA-86151 / Game economy crafting balance / Open access

Repeatable quest rewards: Harder quests are treated as gray · case 01

Quests far above the player pay the gray-quest penalty.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The gap uses an absolute difference, penalizing quests above the player.

THE FAILURE

The gap uses an absolute difference, penalizing quests above the player.

Unsuccessful approach: A strict comparison misses exactly five levels of gap.

Case contract

Completion k (0-based across the day, starting at done_today) pays tier 100% for k < 5, 50% for 5 <= k < 10, 0 after. Gap = player_level - quest_level: >= 5 pays 20%, >= 3 pays 60%, otherwise 100% (higher level quests are never penalized). Each reward = floor(base*tier*gap/10000). Returns the list of the next count rewards.

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.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(done_today, count, base, player_level, quest_level):
    if abs(player_level - quest_level) >= 5:
        gap = 20
    elif player_level - quest_level >= 3:
        gap = 60
    else:
        gap = 100
    out = []
    for k in range(done_today, done_today + count):
        if k < 5:
            tier = 100
        elif k < 10:
            tier = 50
        else:
            tier = 0
        out.append(base * tier * gap // 10000)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('fault site gray gap direction #2', [7, 1, 7, 40, 47], [3]),
  ('partial repair boundary #1', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('partial repair boundary #2', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [7, 1, 7, 40, 47], [3]),
  ('fault site gray gap direction #2', [8, 6, 99, 11, 18], [49, 49, 0, 0, 0, 0]),
  ('partial repair boundary #1', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('partial repair boundary #2', [6, 6, 99, 40, 35], [9, 9, 9, 9, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [0, 1, 82, 18, 25], [82]),
  ('fault site gray gap direction #2', [7, 1, 101, 1, 9], [50]),
  ('partial repair boundary #1', [4, 3, 101, 36, 31], [20, 10, 10]),
  ('partial repair boundary #2', [2, 5, 3, 43, 38], [0, 0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [3, 4, 101, 31, 28], [60, 60, 30, 30])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [2, 1, 3, 7, 12], [3]),
  ('fault site gray gap direction #2', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('partial repair boundary #1', [9, 6, 415, 6, 1], [41, 0, 0, 0, 0, 0]),
  ('partial repair boundary #2', [8, 4, 7, 23, 18], [0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [3, 2, 1, 60, 66], [1, 1]),
  ('fault site gray gap direction #2', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('partial repair boundary #1', [8, 5, 99, 34, 29], [9, 9, 0, 0, 0]),
  ('partial repair boundary #2', [3, 4, 99, 20, 15], [19, 19, 9, 9]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [9, 4, 3, 24, 23], [1, 0, 0, 0])]]
for label, args, expected in cases[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
harder quest no penalty #1[5, 5, 0][25, 25, 0]Failed
gray quest #1[19, 19][19, 19]Passed
fault site gray gap direction #1[19, 19, 9, 9, 9, 9][99, 99, 49, 49, 49, 49]Failed
fault site gray gap direction #2[0][3]Failed
partial repair boundary #1[10, 0, 0, 0, 0][10, 0, 0, 0, 0]Passed
partial repair boundary #2[10, 10, 0, 0, 0][10, 10, 0, 0, 0]Passed
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]Passed
control #1[107, 107, 107, 107, 0, 0][107, 107, 107, 107, 0, 0]Passed

SHA-256 / dba1890e009c5e8dd3bce248ba71aac42988788d6d4c6b2a22fc86043d91c0f4

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(done_today, count, base, player_level, quest_level):
    if player_level - quest_level > 5:
        gap = 20
    elif player_level - quest_level >= 3:
        gap = 60
    else:
        gap = 100
    out = []
    for k in range(done_today, done_today + count):
        if k < 5:
            tier = 100
        elif k < 10:
            tier = 50
        else:
            tier = 0
        out.append(base * tier * gap // 10000)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('fault site gray gap direction #2', [7, 1, 7, 40, 47], [3]),
  ('partial repair boundary #1', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('partial repair boundary #2', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [7, 1, 7, 40, 47], [3]),
  ('fault site gray gap direction #2', [8, 6, 99, 11, 18], [49, 49, 0, 0, 0, 0]),
  ('partial repair boundary #1', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('partial repair boundary #2', [6, 6, 99, 40, 35], [9, 9, 9, 9, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [0, 1, 82, 18, 25], [82]),
  ('fault site gray gap direction #2', [7, 1, 101, 1, 9], [50]),
  ('partial repair boundary #1', [4, 3, 101, 36, 31], [20, 10, 10]),
  ('partial repair boundary #2', [2, 5, 3, 43, 38], [0, 0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [3, 4, 101, 31, 28], [60, 60, 30, 30])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [2, 1, 3, 7, 12], [3]),
  ('fault site gray gap direction #2', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('partial repair boundary #1', [9, 6, 415, 6, 1], [41, 0, 0, 0, 0, 0]),
  ('partial repair boundary #2', [8, 4, 7, 23, 18], [0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gray gap direction #1', [3, 2, 1, 60, 66], [1, 1]),
  ('fault site gray gap direction #2', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('partial repair boundary #1', [8, 5, 99, 34, 29], [9, 9, 0, 0, 0]),
  ('partial repair boundary #2', [3, 4, 99, 20, 15], [19, 19, 9, 9]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('control #1', [9, 4, 3, 24, 23], [1, 0, 0, 0])]]
for label, args, expected in cases[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
harder quest no penalty #1[25, 25, 0][25, 25, 0]Passed
gray quest #1[59, 59][19, 19]Failed
fault site gray gap direction #1[99, 99, 49, 49, 49, 49][99, 99, 49, 49, 49, 49]Passed
fault site gray gap direction #2[3][3]Passed
partial repair boundary #1[30, 0, 0, 0, 0][10, 0, 0, 0, 0]Failed
partial repair boundary #2[30, 30, 0, 0, 0][10, 10, 0, 0, 0]Failed
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]Passed
control #1[107, 107, 107, 107, 0, 0][107, 107, 107, 107, 0, 0]Passed

SHA-256 / e46873fc240813ef1a2cb8836aa01d643949778e9d2f9e3c0105f15abe0e1fa8

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

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

Sign in to the archive ↗

Verification & scope

Deterministic toy contract stipulated for this model; integer or exact arithmetic only, not a reproduction of any specific game engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:46.947980+00:00.

Case digest / 90939ce6b87730e6001d630463788db75b70bfdce1bb2baaa0cdbcfda179e6a4