diff --git a/.gitea/workflows/push-policy.yml b/.gitea/workflows/push-policy.yml index 7caa947..36ba057 100644 --- a/.gitea/workflows/push-policy.yml +++ b/.gitea/workflows/push-policy.yml @@ -1,6 +1,6 @@ # When the route model changes on main, send it to the bot: open (or update) a pull request on the bot's repo, -# DragonKind/DragonKind, that replaces vendor/threshing-atlas/{policy.json,solver.js,graph.js} with this repo's -# data/public/policy.json, core/solver.js and core/graph.js. The three always travel together, so the policy and the +# DragonKind/DragonKind, that replaces vendor/threshing-atlas/{policy.json,solver.js,graph.js,known_answers.json} with +# this repo's data/public/policy.json, core/solver.js, core/graph.js and data/public/known_answers.json. They always travel together, so the policy and the # solver that reads it never get out of step. Ken reviews and merges it; the running bot reloads the files after a pull. # # Secrets: ATLAS_BOT_TOKEN (repository: read and write, with write access to DragonKind/DragonKind). @@ -12,6 +12,7 @@ on: - data/public/policy.json - core/solver.js - core/graph.js + - data/public/known_answers.json workflow_dispatch: jobs: send: @@ -34,7 +35,7 @@ jobs: GIT_CONFIG_VALUE_0="AUTHORIZATION: token $ATLAS_BOT_TOKEN" git clone --quiet --depth 1 https://git.kenschiano.net/DragonKind/DragonKind.git "$dst" mkdir -p "$dst/vendor/threshing-atlas" - cp data/public/policy.json core/solver.js core/graph.js "$dst/vendor/threshing-atlas/" + cp data/public/policy.json core/solver.js core/graph.js data/public/known_answers.json "$dst/vendor/threshing-atlas/" id=$(python3 -c "import json; print(json.load(open('data/public/policy.json')).get('id', ''))") sha=$(git rev-parse --short HEAD) cd "$dst" diff --git a/analysis/known/build_known.py b/analysis/known/build_known.py new file mode 100644 index 0000000..118cad5 --- /dev/null +++ b/analysis/known/build_known.py @@ -0,0 +1,131 @@ +"""Known answers: what the Atlas knows about every answer the bot can be offered, for screens its other sources don't +cover (issue #35). The bot looks the screen's choices up here first (solver.js `knownAnswer`), and passes what it finds +to Clef as evidence when nothing is certain. + + python analysis/known/build_known.py [--check] -> data/public/known_answers.json + +Two sources, keyed by the answer text normalised exactly as the bot does (collection/etl/transform/bot.py normalize): + + guide every answer in the community route PDF's encounter trees (data/public/pdf_encounters.json): the + encounter, how it ends there (or "continues"), the guide's rate, whether the guide marks it unconfirmed, + and `on_path`: the colours whose recommended path in the guide goes through it + bot every answer in the bot's screen tree (data/public/tree.json): times played, times it died straight + after, and the bonds the runs that took it ended in +""" +import argparse +import json +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT)) +from collection.etl.transform.bot import normalize # noqa: E402 + +GUIDE = ROOT / "data/public/pdf_encounters.json" +TREE = ROOT / "data/public/tree.json" +OUT = ROOT / "data/public/known_answers.json" +# the colours each of the guide's encounters can end in a bond with (the two Greens can also end with an Orange or a +# Brown swooping in), and the encounter a colour's route continues to from there (the shadow leads on to the Black) +ENC_COLOURS = {"valley-Red": ["Red"], "tree-Red": ["Red"], "tree-Greens": ["Green", "Brown", "Orange"], + "meadow-Orange": ["Orange"], "meadow-Brown": ["Brown"], "meadow-Blue": ["Blue"], + "shadow": ["Black", "Blue"], "black": ["Black"]} +ONWARD = {("shadow", "Black"): "Black"} + + +def is_goal(end, colour, onward): + end = end or "" + if onward: + return end.startswith(f"On to the {onward}") + if not (end.startswith("Bonded") or "Bonded (" in end): + return False + return "(" not in end or colour in end + + +def leads_to(o, colour, onward): + if "end" in o: + return is_goal(o["end"], colour, onward) + return any(not c.get("roll") and leads_to(c, colour, onward) for c in o.get("then", [])) + + +def guide_path(options, colour, onward): + """The guide's recommended answers toward `colour` (the same walk as the page's encounter panel).""" + out, opts = [], options + while opts: + live = [o for o in opts if not o.get("roll")] + pick = next((o for o in live if o.get("best") and leads_to(o, colour, onward)), None) \ + or next((o for o in live if leads_to(o, colour, onward)), None) + if not pick: + break + out.append(id(pick)) + if "end" in pick: + break + opts = pick.get("then", []) + return out + + +def walk(options, enc, on_path, out): + """Every answer of an encounter, with its colours (where it happens) and on_path (whose recommended path).""" + for o in options: + if o.get("roll"): + continue + entry = {"encounter": enc, "colours": ENC_COLOURS.get(enc, []), "end": o.get("end", "continues")} + if o.get("pct"): + entry["pct"] = o["pct"] + if o.get("best"): + entry["best"] = True + if o.get("unconfirmed"): + entry["unconfirmed"] = True + cols = sorted(c for c, ids in on_path.items() if id(o) in ids) + if cols: + entry["on_path"] = cols + for text in [s.strip() for s in o["say"].split(", or ")]: # "Jump on its back, or jump to land…" + out.setdefault(normalize(text), {"text": text, "guide": []})["guide"].append(entry) + walk(o.get("then", []), enc, on_path, out) + + +def build(): + g = json.loads(GUIDE.read_text(encoding="utf-8")) + out = {} + for enc, E in g["encounters"].items(): + on_path = {c: set(guide_path(E["options"], c, ONWARD.get((enc, c)))) for c in ENC_COLOURS.get(enc, [])} + walk(E["options"], enc, on_path, out) + t = json.loads(TREE.read_text(encoding="utf-8")) if TREE.exists() else {"screens": {}} + for sc in t["screens"].values(): + for o in sc["options"].values(): + if not o.get("n"): + continue + k = normalize(o["text"]) + e = out.setdefault(k, {"text": o["text"], "guide": []}) + b = e.setdefault("bot", {"n": 0, "died": 0, "bonded": {}}) + b["n"] += o["n"] + for dest, d in o.get("to", {}).items(): + if dest == "DIED": + b["died"] += d["n"] + elif dest.startswith("BONDED:"): + c = dest.split(":", 1)[1] + b["bonded"][c] = b["bonded"].get(c, 0) + d["n"] + for e in out.values(): + if not e["guide"]: + del e["guide"] + src = g["source"] + return {"schema": 1, "guide": {"title": src["title"], "version": src["version"], "link": src["link"]}, + "bot": {"runs": (t.get("builtFrom") or {}).get("runs")}, "answers": dict(sorted(out.items()))} + + +def main(argv=None): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--check", action="store_true") + a = ap.parse_args(argv) + text = json.dumps(build(), ensure_ascii=False, indent=1) + "\n" + if a.check: + if not OUT.exists() or OUT.read_text(encoding="utf-8") != text: + print(f"{OUT.relative_to(ROOT)} is out of date (run python analysis/known/build_known.py)", file=sys.stderr) + return 1 + return 0 + OUT.write_text(text, encoding="utf-8") + print(f"wrote {OUT.relative_to(ROOT)}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/collection/etl/handoff.py b/collection/etl/handoff.py index 3219f17..03fa941 100644 --- a/collection/etl/handoff.py +++ b/collection/etl/handoff.py @@ -87,6 +87,7 @@ def rebuild(): _step("experiment plan", [py, "planner/build_experiments.py"]) _step("what the runs show about the Black", [py, "analysis/black/evidence.py"]) _step("screen tree", [py, "analysis/tree/build_tree.py"]) + _step("known answers for the bot (guide + screen tree)", [py, "analysis/known/build_known.py"]) try: import scipy # noqa: F401 _step("statistics", [py, "analysis/stats/site_stats.py"]) diff --git a/core/solver.js b/core/solver.js index 8ac5f34..40f7136 100644 --- a/core/solver.js +++ b/core/solver.js @@ -15,6 +15,9 @@ * shadow odds), `fix` (hold some decisions to given options: an experiment arm) and sampling "uniform" (mapping); * assign(plan, { accountSeq, attempt }) reads the experiment plan (experiments.json) and says what an attempt is for; * screenPick(tree, sceneId, offered, { mode }) picks from the screen tree (tree.json): least-tried, or Thompson. + * knownAnswer(known, offered, { target, sceneColour }) looks a screen's choices up in known_answers.json (the guide's + * encounter answers and the bot's own results) for screens nothing else covers: a pick when the evidence is clear, + * and the evidence for every choice either way, to hand to Clef (issue #35). * UMD: window.ThreshSolver in the browser, module.exports in Node. No dependencies. */ (function (root, factory) { @@ -446,8 +449,68 @@ reason: mode === "thompson" ? `survived ${pick.survived} of ${pick.n} so far` : `played ${pick.n} times, the fewest on this screen` }; } + /* ---------- known answers (analysis/known/build_known.py -> data/public/known_answers.json) ---------- */ + const STOP = new Set("a an the to and or of your you its it is for at in on with this that be".split(" ")); + const words = (t) => norm(t).split(" ").filter((w) => w && !STOP.has(w)); + /** The guide labels a game text carries: the guide paraphrases ("Touch its talon"), the game says it in full ("Reach a + * hand slowly to touch its talon"), so a label matches when every word of it that matters is in the text. Labels of + * fewer than two such words ("Is your dragon") only match a text that is exactly the label. */ + function guideMatches(known, text) { + const n = norm(text), have = new Set(words(text)), out = []; + for (const [k, e] of Object.entries(known.answers || {})) { + if (!e.guide) continue; + const w = words(e.text); + const exact = k === n; + if (exact || (w.length >= 2 && w.every((x) => have.has(x)))) e.guide.forEach((g) => out.push({ ...g, label: e.text, exact })); + } + return out; + } + + /** + * A screen nothing else covers: what the Atlas knows about each choice, and a pick when it is clear. + * known data/public/known_answers.json + * offered the choice texts on screen, in order + * target the colour the account is after ("Blue"); sceneColour: the colour of this scene's dragon, if the + * bot knows it (only the guide's answers for that dragon's encounters are used then) + * Returns { pick, confidence, reason, choices }: pick is the index to take (null if nothing is clear), confidence + * "strong" (exactly one choice is on the guide's recommended path toward the target, and the bot's own runs don't + * contradict it) or "weak" (several fit, or only the bot's own record speaks for it). choices[i].verdict is "good", + * "bad" (the guide ends it in incineration, or the bot died on it at least 3 times in 4) or "unknown", with the + * evidence behind it. Anything weak or unknown goes to Clef with this evidence; a pick never skips the bot's guard. + */ + function knownAnswer(known, offered, { target, sceneColour = null } = {}) { + const T = target ? target[0].toUpperCase() + target.slice(1).toLowerCase() : null; + const choices = offered.map((text, index) => { + const e = (known.answers || {})[norm(text)] || {}; + const bot = e.bot || null; + const guide = guideMatches(known, text).filter((g) => !sceneColour || (g.colours || []).includes(sceneColour)); + const onPath = guide.filter((g) => T && (g.on_path || []).includes(T)); + const botBad = bot && bot.n >= 2 && bot.died / bot.n >= 0.75; + const botGood = bot && bot.n >= 3 && bot.died === 0; + const guideBad = guide.length > 0 && guide.every((g) => /^Incinerated/.test(g.end)); + const verdict = onPath.length && !botBad ? "good" : guideBad || botBad ? "bad" : "unknown"; + return { index, text, verdict, guide, bot, onPath: onPath.length > 0, botGood: !!botGood }; + }); + const good = choices.filter((c) => c.verdict === "good"); + let pick = null, confidence = null, reason = "nothing the Atlas knows covers these choices"; + if (good.length === 1) { + pick = good[0].index; confidence = "strong"; + reason = `on the guide's recommended path to the ${T} ("${good[0].onPath && good[0].guide.find((g) => (g.on_path || []).includes(T)).label}")`; + } else if (good.length > 1) { + const best = good.find((c) => c.botGood) || good[0]; + pick = best.index; confidence = "weak"; reason = `${good.length} choices are on the guide's paths; the bot's record favours none clearly`; + } else { + const safe = choices.filter((c) => c.botGood && c.verdict !== "bad"); + if (safe.length) { + const b = safe.reduce((x, y) => (y.bot.n > x.bot.n ? y : x)); + pick = b.index; confidence = "weak"; reason = `the bot got through it ${b.bot.n} of ${b.bot.n} times`; + } + } + return { pick, confidence, reason, choices }; + } + return Object.assign(api, { - advisor, recommendOption, solverHistory, norm, assign, armFor, givenFor, screenPick, + advisor, recommendOption, solverHistory, norm, assign, armFor, givenFor, screenPick, knownAnswer, makeParams: (T, { alphas, game } = {}) => makeParams(T, { alphas, game: game || api.game }), /** remember the game of a policy sample (sets ENCOUNTERS) without solving anything */ useGame(sample) { api.game = sample.model.game; api.ENCOUNTERS = api.game.by_colour; return api.game; }, diff --git a/data/public/known_answers.json b/data/public/known_answers.json new file mode 100644 index 0000000..8233e95 --- /dev/null +++ b/data/public/known_answers.json @@ -0,0 +1,2307 @@ +{ + "schema": 1, + "guide": { + "title": "Threshing Options (community route PDF)", + "version": "2026-11-16", + "link": "https://drive.google.com/file/d/17o72ehHsSPW4UdsKF-sXTxMLEuinWeEg/view" + }, + "bot": { + "runs": 878 + }, + "answers": { + "a green sounds good": { + "text": "A green sounds good", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Not tested", + "unconfirmed": true + } + ] + }, + "absolutely blue dragon": { + "text": "Absolutely, Blue Dragon", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "90%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "absolutely my whole life hinges on this moment": { + "text": "Absolutely. My whole life hinges on this moment", + "bot": { + "n": 28, + "died": 5, + "bonded": {} + } + }, + "absolutely sure orange": { + "text": "Absolutely sure, Orange", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "continues", + "pct": "90%", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "aid the cadet": { + "text": "Aid the cadet", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Not tested", + "unconfirmed": true + } + ] + }, + "allow your squadmate to exact their own revenge": { + "text": "Allow your squadmate to exact their own revenge", + "bot": { + "n": 375, + "died": 0, + "bonded": {} + } + }, + "apologise immediately": { + "text": "Apologise immediately", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated", + "pct": "50%" + } + ] + }, + "approach the blue": { + "text": "Approach the Blue", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues" + } + ] + }, + "approach the blue dragon": { + "text": "Approach the blue dragon", + "bot": { + "n": 26, + "died": 0, + "bonded": {} + } + }, + "approach the brown dragon": { + "text": "Approach the brown dragon", + "bot": { + "n": 2, + "died": 0, + "bonded": {} + } + }, + "approach the orange dragon": { + "text": "Approach the orange dragon", + "bot": { + "n": 274, + "died": 0, + "bonded": {} + } + }, + "attempt to mount": { + "text": "Attempt to mount", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Bonded", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "await judgement": { + "text": "Await judgement", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "await judgment": { + "text": "Await judgment", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "pct": "90%" + } + ] + }, + "bring down an empire": { + "text": "Bring down an empire", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "80%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "change to brown": { + "text": "Change to Brown", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Not tested", + "pct": "?", + "unconfirmed": true + } + ] + }, + "change to orange": { + "text": "Change to Orange", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Not tested", + "pct": "?", + "unconfirmed": true + } + ] + }, + "clean their uniform": { + "text": "Clean their uniform", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "climb down slowly to pursue the green": { + "text": "Climb down slowly to pursue the green", + "bot": { + "n": 540, + "died": 0, + "bonded": {} + } + }, + "climb with strength": { + "text": "Climb with strength", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Bonded" + } + ] + }, + "continue approach": { + "text": "Continue approach", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "continues", + "best": true, + "on_path": [ + "Red" + ] + } + ] + }, + "continue toward the center of the valley": { + "text": "Continue toward the center of the valley", + "bot": { + "n": 310, + "died": 0, + "bonded": {} + } + }, + "continue your approach you're certain this is your path": { + "text": "Continue your approach. You’re certain this is your path", + "bot": { + "n": 8, + "died": 0, + "bonded": {} + } + }, + "crawl to the seat": { + "text": "Crawl to the seat", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "Bonded", + "pct": "2%", + "on_path": [ + "Red" + ] + } + ] + }, + "curiosity sated retreat": { + "text": "Curiosity sated, retreat", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues" + } + ] + }, + "daggers or not your squadmate is in danger so you charge the bigger cadet": { + "text": "Daggers or not, your squadmate is in danger, so you charge the bigger cadet", + "bot": { + "n": 166, + "died": 0, + "bonded": {} + } + }, + "decapitation isn't scary": { + "text": "Decapitation isn't scary", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown", + "Green" + ] + } + ] + }, + "defend the helpless": { + "text": "Defend the helpless", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Not tested", + "pct": "?", + "unconfirmed": true + } + ] + }, + "defend the kingdom": { + "text": "Defend the kingdom", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Death 50/50" + } + ] + }, + "defend the powerless": { + "text": "Defend the powerless", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Bonded" + } + ] + }, + "descend quickly in preparation for whatever's coming your way": { + "text": "Descend quickly in preparation for whatever’s coming your way", + "bot": { + "n": 4, + "died": 0, + "bonded": {} + } + }, + "do nothing": { + "text": "Do nothing", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "83%", + "best": true, + "on_path": [ + "Blue" + ] + }, + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "?" + } + ], + "bot": { + "n": 19, + "died": 5, + "bonded": {} + } + }, + "don't move a muscle": { + "text": "Don't move a muscle", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown", + "Green" + ] + }, + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Orange" + ] + } + ], + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "don't move a muscle holding your ground is imperative": { + "text": "Don’t move a muscle. Holding your ground is imperative", + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "drop to your stomach": { + "text": "Drop to your stomach", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "continues", + "on_path": [ + "Red" + ] + } + ] + }, + "ehh on second thought maybe it won't see if you change direction": { + "text": "Ehh. On second thought, maybe it won’t see if you change direction", + "bot": { + "n": 1, + "died": 1, + "bonded": {} + } + }, + "end the lives of the bullies yourself": { + "text": "End the lives of the bullies yourself", + "bot": { + "n": 404, + "died": 0, + "bonded": {} + } + }, + "engage the smaller cadet": { + "text": "Engage the smaller cadet", + "bot": { + "n": 621, + "died": 0, + "bonded": {} + } + }, + "enter the valley alone": { + "text": "Enter the valley alone", + "bot": { + "n": 650, + "died": 0, + "bonded": {} + } + }, + "enter the valley with one of your squadmates": { + "text": "Enter the valley with one of your squadmates", + "bot": { + "n": 103, + "died": 0, + "bonded": {} + } + }, + "enter the valley with two of your squadmates": { + "text": "Enter the valley with two of your squadmates", + "bot": { + "n": 100, + "died": 0, + "bonded": {} + } + }, + "exit gracefully": { + "text": "Exit gracefully", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "That was close (on to the meadow)" + } + ] + }, + "find a better dragon": { + "text": "Find a better dragon", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Not recorded" + } + ] + }, + "find that green": { + "text": "Find that Green", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "On to the two Greens" + } + ] + }, + "find the tallest tree and climb for a better view": { + "text": "Find the tallest tree and climb for a better view", + "bot": { + "n": 544, + "died": 0, + "bonded": {} + } + }, + "flee": { + "text": "Flee", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "freeze and lower your eyes": { + "text": "Freeze and lower your eyes", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "glance to the left dragon": { + "text": "Glance to the left dragon", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "glance to the right dragon": { + "text": "Glance to the right dragon", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "go towards the valley": { + "text": "Go towards the valley", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Not tested", + "unconfirmed": true + } + ] + }, + "greens have the best magic": { + "text": "Greens have the best magic", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Bonded (Left Green)", + "best": true + } + ] + }, + "hang tight": { + "text": "Hang tight", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "Incinerated" + } + ] + }, + "head deeper into the forest": { + "text": "Head deeper into the forest", + "bot": { + "n": 854, + "died": 0, + "bonded": {} + } + }, + "head east toward the roar": { + "text": "Head east toward the roar", + "bot": { + "n": 28, + "died": 0, + "bonded": {} + } + }, + "head south and hope": { + "text": "Head south and hope", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "On to the Black", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "head toward the center of the forest": { + "text": "Head toward the center of the forest", + "bot": { + "n": 507, + "died": 0, + "bonded": {} + } + }, + "head west toward the scent": { + "text": "Head west toward the scent", + "bot": { + "n": 319, + "died": 0, + "bonded": {} + } + }, + "help the cadet": { + "text": "Help the cadet", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "0%" + }, + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "help your squadmate": { + "text": "Help your squadmate", + "bot": { + "n": 787, + "died": 0, + "bonded": {} + } + }, + "hit the ground": { + "text": "Hit the ground", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "continues", + "best": true + } + ] + }, + "hold glare and advance": { + "text": "Hold glare and advance", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "80%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "hold glare and watch": { + "text": "Hold glare and watch", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "80%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "hold its gaze": { + "text": "Hold its gaze", + "guide": [ + { + "encounter": "black", + "colours": [ + "Black" + ], + "end": "Bonded", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "hold position": { + "text": "Hold position", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "hold steady": { + "text": "Hold steady", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "0%", + "unconfirmed": true + } + ] + }, + "hold still": { + "text": "Hold still", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "50%" + }, + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "hold the blue's glare and advance": { + "text": "Hold the blue’s glare and advance", + "bot": { + "n": 23, + "died": 4, + "bonded": {} + } + }, + "hold the dragon's glare and watch as it crushes the cadet to death": { + "text": "Hold the dragon’s glare and watch as it crushes the cadet to death", + "bot": { + "n": 14, + "died": 6, + "bonded": {} + } + }, + "hold the red's gaze": { + "text": "Hold the Red's gaze", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "continues", + "on_path": [ + "Red" + ] + } + ] + }, + "hold tight for balance": { + "text": "Hold tight for balance", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "hold your ground": { + "text": "Hold your ground", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "hope for a clean death": { + "text": "Hope for a clean death", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + } + ] + }, + "i want revenge": { + "text": "I want revenge", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Not tested", + "pct": "?", + "unconfirmed": true + } + ] + }, + "i want to bring down an empire": { + "text": "I want to bring down an empire", + "bot": { + "n": 5, + "died": 0, + "bonded": {} + } + }, + "ignore it keep walking": { + "text": "Ignore it, keep walking", + "guide": [ + { + "encounter": "black", + "colours": [ + "Black" + ], + "end": "Incinerated" + } + ] + }, + "immediately throw your body weight onto the tail and hold on for dear life": { + "text": "Immediately throw your body weight onto the tail and hold on for dear life", + "bot": { + "n": 66, + "died": 6, + "bonded": {} + } + }, + "indecisively chase it": { + "text": "Indecisively chase it", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + } + ] + }, + "intellect match": { + "text": "Intellect match", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "A Brown saves you: Bonded (Brown)", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + }, + "intervene and help": { + "text": "Intervene and help", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "?" + } + ] + }, + "investigate the scream": { + "text": "Investigate the scream", + "bot": { + "n": 809, + "died": 0, + "bonded": {} + } + }, + "is not your dragon leave": { + "text": "Is not your dragon, leave", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "That was close (on to the meadow)" + } + ] + }, + "is your dragon": { + "text": "Is your dragon", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "continues", + "best": true, + "on_path": [ + "Red" + ] + } + ] + }, + "it's already talking to you": { + "text": "It's already talking to you", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Bonded" + } + ] + }, + "jump in a few seconds and you'll land closer to its tail farther from the teeth": { + "text": "Jump in a few seconds and you’ll land closer to its tail, farther from the teeth", + "bot": { + "n": 1, + "died": 1, + "bonded": {} + } + }, + "jump now and you can land on its back": { + "text": "Jump now, and you can land on its back", + "bot": { + "n": 1, + "died": 1, + "bonded": {} + } + }, + "jump off and hope": { + "text": "Jump off and hope", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "Incinerated" + } + ] + }, + "jump on its back": { + "text": "Jump on its back", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "continues", + "on_path": [ + "Red" + ] + } + ] + }, + "jump to land by its tail": { + "text": "jump to land by its tail", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "continues", + "on_path": [ + "Red" + ] + } + ] + }, + "keep walking the cadets are just as dangerous as the dragons today": { + "text": "Keep walking. The cadets are just as dangerous as the dragons today", + "bot": { + "n": 45, + "died": 0, + "bonded": {} + } + }, + "last chance to escape": { + "text": "Last chance to escape", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "launch yourself right": { + "text": "Launch yourself right", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "85%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "launch yourself to the right taking cover behind a boulder": { + "text": "Launch yourself to the right, taking cover behind a boulder", + "bot": { + "n": 7, + "died": 2, + "bonded": {} + } + }, + "leave the bullies alive the dragons will sort them out": { + "text": "Leave the bullies alive. The dragons will sort them out", + "bot": { + "n": 8, + "died": 0, + "bonded": {} + } + }, + "leave to find your dragon": { + "text": "Leave to find your dragon", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "leave while it's distracted": { + "text": "Leave while it's distracted", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "leave your squadmate": { + "text": "Leave your squadmate", + "bot": { + "n": 103, + "died": 0, + "bonded": {} + } + }, + "leave your squadmates": { + "text": "Leave your squadmates", + "bot": { + "n": 100, + "died": 0, + "bonded": {} + } + }, + "look it in the eye": { + "text": "Look it in the eye", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "continues" + } + ] + }, + "lower gaze advance": { + "text": "Lower gaze, advance", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "0%" + } + ] + }, + "lower gaze halt advance": { + "text": "Lower gaze, halt advance", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "0%" + } + ] + }, + "lower your eyes": { + "text": "Lower your eyes", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "Incinerated" + }, + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "?", + "unconfirmed": true + }, + { + "encounter": "black", + "colours": [ + "Black" + ], + "end": "Incinerated" + } + ] + }, + "lower your eyes and hold still": { + "text": "Lower your eyes and hold still", + "bot": { + "n": 326, + "died": 0, + "bonded": {} + } + }, + "lower your eyes and hold your ground": { + "text": "Lower your eyes and hold your ground", + "bot": { + "n": 155, + "died": 0, + "bonded": {} + } + }, + "lower your eyes and turn to face it": { + "text": "Lower your eyes and turn to face it", + "bot": { + "n": 92, + "died": 0, + "bonded": {} + } + }, + "lower your eyes and turn your body toward the left": { + "text": "Lower your eyes and turn your body toward the left", + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "lower your eyes but keep your body neutral letting them decide": { + "text": "Lower your eyes but keep your body neutral, letting them decide", + "bot": { + "n": 541, + "died": 541, + "bonded": {} + } + }, + "lower your eyes in respect": { + "text": "Lower your eyes in respect", + "bot": { + "n": 263, + "died": 0, + "bonded": {} + } + }, + "lower your eyes in respect and retreat": { + "text": "Lower your eyes in respect and retreat", + "bot": { + "n": 18, + "died": 0, + "bonded": {} + } + }, + "maintain eye contact": { + "text": "Maintain eye contact", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "mount the brown's tail": { + "text": "Mount the Brown's tail", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + }, + "move forward slowly waiting for an invitation": { + "text": "Move forward slowly, waiting for an invitation", + "bot": { + "n": 5, + "died": 0, + "bonded": { + "Blue": 5 + } + } + }, + "move slowly forward": { + "text": "Move slowly forward", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Bonded", + "pct": "80%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "mud fight": { + "text": "Mud fight!", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues" + } + ] + }, + "on second thought": { + "text": "On second thought…", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "That was close (on to the meadow)" + }, + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Incinerated", + "pct": "10%" + }, + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + }, + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Not tested", + "unconfirmed": true + } + ] + }, + "on second thought a nice brown sounds great": { + "text": "On second thought, a nice brown sounds great", + "bot": { + "n": 274, + "died": 135, + "bonded": {} + } + }, + "on second thought let's get out of here": { + "text": "On second thought, let’s get out of here", + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "pause to assess the situation even though it may risk your squadmate's life": { + "text": "Pause to assess the situation even though it may risk your squadmate’s life", + "bot": { + "n": 787, + "died": 0, + "bonded": {} + } + }, + "play it safe and leave them to their own defense so you can find your dragon": { + "text": "Play it safe and leave them to their own defense so you can find your dragon", + "bot": { + "n": 22, + "died": 0, + "bonded": {} + } + }, + "pray": { + "text": "pray", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "pct": "90%" + } + ] + }, + "reach a hand slowly to touch its talon": { + "text": "Reach a hand slowly to touch its talon", + "bot": { + "n": 8, + "died": 0, + "bonded": { + "Red": 8 + } + } + }, + "reds are too hot tempered you'd rather take your chance with that green": { + "text": "Reds are too hot-tempered. You’d rather take your chance with that green", + "bot": { + "n": 2, + "died": 0, + "bonded": {} + } + }, + "roar right back at it": { + "text": "Roar right back at it", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "continues", + "pct": "69%", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "run after the brown": { + "text": "Run after the Brown", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + }, + "run after the brown dragon": { + "text": "Run after the brown dragon", + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "run at the claw": { + "text": "Run at the claw", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "continues" + } + ] + }, + "run this was a mistake": { + "text": "Run, this was a mistake", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "run to mount": { + "text": "Run to mount", + "guide": [ + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Bonded" + } + ] + }, + "run to mount its foreleg": { + "text": "Run to mount its foreleg", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "Bonded" + }, + { + "encounter": "meadow-Orange", + "colours": [ + "Orange" + ], + "end": "Bonded", + "best": true + } + ] + }, + "run towards the other cadet": { + "text": "Run towards the other cadet", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Not tested", + "unconfirmed": true + } + ] + }, + "seek revenge": { + "text": "Seek revenge", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + } + ] + }, + "seize the chance to mount": { + "text": "Seize the chance to mount", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "50%" + } + ] + }, + "shout at it to stop": { + "text": "Shout at it to stop", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "pct": "50%" + } + ] + }, + "sidestep out of its mouth": { + "text": "Sidestep out of its mouth", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + }, + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "speak first": { + "text": "Speak first", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Incinerated", + "pct": "20%" + } + ] + }, + "stay neutral": { + "text": "Stay neutral", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "stay still": { + "text": "Stay still", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown", + "Green" + ] + } + ] + }, + "stay the course": { + "text": "Stay the course", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "step back": { + "text": "Step back", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "straighten your spine": { + "text": "Straighten your spine", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "continues", + "pct": "82%", + "best": true, + "on_path": [ + "Blue" + ] + } + ] + }, + "straighten your spine and wait for it to speak": { + "text": "Straighten your spine and wait for it to speak", + "bot": { + "n": 8, + "died": 1, + "bonded": {} + } + }, + "take a chance and try a tail mount": { + "text": "Take a chance and try a tail-mount", + "bot": { + "n": 139, + "died": 0, + "bonded": {} + } + }, + "take them to cold water": { + "text": "Take them to cold water", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "that growl changes everything and it's time to exit gracefully": { + "text": "That growl changes everything, and it’s time to exit gracefully", + "bot": { + "n": 1, + "died": 0, + "bonded": {} + } + }, + "the dragon speaks": { + "text": "The dragon speaks", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues" + } + ] + }, + "there's no way this is your dragon and you need to get out of here": { + "text": "There’s no way this is your dragon and you need to get out of here", + "bot": { + "n": 300, + "died": 0, + "bonded": {} + } + }, + "this is your dragon and it's time to start bonding": { + "text": "This is your dragon and it’s time to start bonding", + "bot": { + "n": 10, + "died": 0, + "bonded": {} + } + }, + "throw mud at the dragon": { + "text": "Throw mud at the dragon", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Bonded", + "pct": "60%" + } + ] + }, + "throw your weight": { + "text": "Throw your weight", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + }, + "too big you're out": { + "text": "Too big, you're out", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + "touch its talon": { + "text": "Touch its talon", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "Bonded", + "pct": "93%", + "best": true, + "on_path": [ + "Red" + ] + } + ] + }, + "try your luck with the remaining orange": { + "text": "Try your luck with the remaining orange", + "bot": { + "n": 1, + "died": 1, + "bonded": {} + } + }, + "turn to face the threat": { + "text": "Turn to face the threat", + "guide": [ + { + "encounter": "black", + "colours": [ + "Black" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "turn to the left dragon": { + "text": "Turn to the left dragon", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "turn to the orange": { + "text": "Turn to the Orange", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + } + ] + }, + "turn to the right dragon": { + "text": "Turn to the right dragon", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown", + "Green" + ] + } + ] + }, + "use the cadet's own belt as a tourniquet to staunch the blood flow and wait for a wingleader to come along": { + "text": "Use the cadet’s own belt as a tourniquet to staunch the blood flow and wait for a wingleader to come along", + "bot": { + "n": 45, + "died": 0, + "bonded": {} + } + }, + "use your dagger": { + "text": "Use your dagger", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "wait and pursue the green": { + "text": "Wait and pursue the Green", + "guide": [ + { + "encounter": "tree-Red", + "colours": [ + "Red" + ], + "end": "On to the two Greens" + } + ] + }, + "wait for a better angle": { + "text": "Wait for a better angle", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Incinerated" + } + ] + }, + "wait for the tail to return for a more advantageous angle": { + "text": "Wait for the tail to return for a more advantageous angle", + "bot": { + "n": 73, + "died": 73, + "bonded": {} + } + }, + "walk farther into the forest": { + "text": "Walk farther into the forest", + "bot": { + "n": 479, + "died": 0, + "bonded": {} + } + }, + "walk toward the east": { + "text": "Walk toward the east", + "bot": { + "n": 7, + "died": 0, + "bonded": {} + } + }, + "walk toward the west": { + "text": "Walk toward the west", + "bot": { + "n": 301, + "died": 0, + "bonded": {} + } + }, + "warn the cadet": { + "text": "Warn the cadet", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Incinerated" + } + ] + }, + "well this is intriguing": { + "text": "Well this is intriguing", + "guide": [ + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "continues", + "best": true, + "on_path": [ + "Black" + ] + } + ] + }, + "wipe off the mud": { + "text": "Wipe off the mud", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "pct": "90%" + } + ] + }, + "you already know": { + "text": "You already know", + "guide": [ + { + "encounter": "meadow-Blue", + "colours": [ + "Blue" + ], + "end": "Not tested", + "pct": "?", + "unconfirmed": true + } + ] + }, + "you always overextend": { + "text": "You always overextend", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Bonded (Right Green)", + "best": true + } + ] + }, + "you don't know": { + "text": "You don't know", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "you lack flaws": { + "text": "You lack flaws", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Incinerated" + } + ] + }, + "you overextend yourself constantly": { + "text": "You overextend yourself constantly", + "bot": { + "n": 1, + "died": 0, + "bonded": { + "Green": 1 + } + } + }, + "you respect their nature": { + "text": "You respect their nature", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Bonded (Right Green)", + "best": true, + "on_path": [ + "Green" + ] + } + ] + }, + "you struggle with temper": { + "text": "You struggle with temper", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "Bonded (Left Green)", + "best": true + } + ] + }, + "you'll charm it": { + "text": "You'll charm it", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "Bonded", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + }, + "you'll respect its decision and hope for a clean death": { + "text": "You’ll respect its decision and hope for a clean death", + "bot": { + "n": 60, + "died": 60, + "bonded": {} + } + }, + "you're absolutely sure": { + "text": "You’re absolutely sure", + "bot": { + "n": 9, + "died": 0, + "bonded": {} + } + }, + "you're always right": { + "text": "You're always right", + "guide": [ + { + "encounter": "tree-Greens", + "colours": [ + "Green", + "Brown", + "Orange" + ], + "end": "An Orange saves you: Bonded (Orange)", + "best": true, + "on_path": [ + "Orange" + ] + } + ] + }, + "you're sure": { + "text": "You're sure", + "guide": [ + { + "encounter": "valley-Red", + "colours": [ + "Red" + ], + "end": "continues", + "best": true, + "on_path": [ + "Red" + ] + }, + { + "encounter": "shadow", + "colours": [ + "Black", + "Blue" + ], + "end": "Incinerated?", + "unconfirmed": true + } + ] + }, + "your heart is sure": { + "text": "Your heart is sure", + "guide": [ + { + "encounter": "meadow-Brown", + "colours": [ + "Brown" + ], + "end": "continues", + "best": true, + "on_path": [ + "Brown" + ] + } + ] + } + } +} diff --git a/package.json b/package.json index 33f217d..cb58e9d 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "scripts": { "build": "node site/build.js", "dev": "node site/build.js && python3 -m http.server 8000 -d dist", - "test:py": "python3 -m collection build --check && python3 planner/build_experiments.py --check && python3 analysis/black/evidence.py --check && python3 analysis/tree/build_tree.py --check && PYTHONPATH=core python3 -m unittest discover -s tests/core -p 'test_*.py' && python3 -m unittest discover -s tests/collection -p 'test_*.py'", - "test:unit": "node --test tests/core/graph.test.js tests/core/advisor.test.js", + "test:py": "python3 -m collection build --check && python3 planner/build_experiments.py --check && python3 analysis/black/evidence.py --check && python3 analysis/tree/build_tree.py --check && python3 analysis/known/build_known.py --check && PYTHONPATH=core python3 -m unittest discover -s tests/core -p 'test_*.py' && python3 -m unittest discover -s tests/collection -p 'test_*.py'", + "test:unit": "node --test tests/core/graph.test.js tests/core/advisor.test.js tests/core/known.test.js", "test": "npm run test:py && npm run test:unit", "graph": "node analysis/network/build-graph.js", - "policy": "python3 planner/build_policy.py && python3 planner/policy_report.py && python3 planner/build_experiments.py && python3 analysis/black/evidence.py && python3 analysis/tree/build_tree.py", + "policy": "python3 planner/build_policy.py && python3 planner/policy_report.py && python3 planner/build_experiments.py && python3 analysis/black/evidence.py && python3 analysis/tree/build_tree.py && python3 analysis/known/build_known.py", "cycle": "python3 -m collection cycle", "stats": "python3 analysis/stats/site_stats.py", "collect": "python3 -m collection update", diff --git a/tests/core/known.test.js b/tests/core/known.test.js new file mode 100644 index 0000000..dd18e08 --- /dev/null +++ b/tests/core/known.test.js @@ -0,0 +1,32 @@ +// knownAnswer (core/solver.js) against the published data/public/known_answers.json: the guide's recommended answers +// are found on the game's full texts, wrong colours and deadly answers are not picked, and unknown screens stay open. +const test = require("node:test"); +const assert = require("node:assert/strict"); +const path = require("node:path"); +const S = require("../../core/solver.js"); +const known = require(path.join(__dirname, "../../data/public/known_answers.json")); + +test("the Black: 'Hold its gaze' is the strong pick, 'Lower your eyes' is bad", () => { + const r = S.knownAnswer(known, ["Lower your eyes", "Hold its gaze"], { target: "black", sceneColour: "Black" }); + assert.equal(r.pick, 1); + assert.equal(r.confidence, "strong"); + assert.equal(r.choices[0].verdict, "bad"); +}); + +test("a guide paraphrase matches the game's full text", () => { + const r = S.knownAnswer(known, ["Climb onto its foreleg", "Reach a hand slowly to touch its talon"], { target: "Red", sceneColour: "Red" }); + assert.equal(r.pick, 1); + assert.match(r.reason, /Touch its talon/); +}); + +test("the two Greens: the answer for the right Green is not the pick for a Brown target", () => { + const offered = ["You respect their nature", "You don't know", "Intellect match"]; + assert.equal(S.knownAnswer(known, offered, { target: "Green" }).pick, 0); + assert.equal(S.knownAnswer(known, offered, { target: "Brown" }).pick, 2); +}); + +test("a screen nobody has seen: no pick, every choice unknown", () => { + const r = S.knownAnswer(known, ["Whistle a tune", "Count the clouds"], { target: "Blue" }); + assert.equal(r.pick, null); + assert.deepEqual(r.choices.map((c) => c.verdict), ["unknown", "unknown"]); +});