diff --git a/data/public/pdf_encounters.json b/data/public/pdf_encounters.json new file mode 100644 index 0000000..2ab7e13 --- /dev/null +++ b/data/public/pdf_encounters.json @@ -0,0 +1,737 @@ +{ + "_about": "The answers inside each bonding encounter, transcribed by hand from the community route PDF (see source). Data, not the flowchart: each option's answer (say), the guide's printed rate (pct), whether it is on the guide's recommended dark-tile path (best), whether the guide marks it untested or unconfirmed (unconfirmed), and what follows (then) or how it ends (end); roll marks a step the guide calls an unknown chance or decision. route_encounters: which encounters each bonding encounter of the route model shows. Edit this file when the PDF changes (the daily check opens a pull request on the bot's repo when it does).", + "version": 1, + "source": { + "title": "Threshing Options (community route PDF)", + "authors": [ + "u/ClumsyBadger", + "u/Old_Regular3018", + "u/Smart_Trifle_2099" + ], + "version": "2026-11-16", + "link": "https://drive.google.com/file/d/17o72ehHsSPW4UdsKF-sXTxMLEuinWeEg/view", + "note": "Percentages are the guide's, from documented runs; options off the recommended path often rest on fewer than three records." + }, + "encounters": { + "valley-Red": { + "title": "The valley Red", + "scene": "You're moved by an instinctual feeling that this...", + "options": [ + { + "say": "Is your dragon", + "best": true, + "then": [ + { + "say": "You're sure", + "best": true, + "then": [ + { + "say": "Continue approach", + "best": true, + "then": [ + { + "say": "Touch its talon", + "best": true, + "pct": "93%", + "end": "Bonded" + }, + { + "say": "Run to mount its foreleg", + "end": "Bonded" + } + ] + }, + { + "say": "Exit gracefully", + "end": "That was close (on to the meadow)" + } + ] + }, + { + "say": "On second thought…", + "end": "That was close (on to the meadow)" + } + ] + }, + { + "say": "Is not your dragon, leave", + "end": "That was close (on to the meadow)" + } + ] + }, + "tree-Red": { + "title": "The Red below the tree", + "scene": "A red dragon prowls ten feet beneath you.", + "warning": "The guide gives a 98% chance of dying if you engage this dragon.", + "options": [ + { + "say": "Jump on its back, or jump to land by its tail", + "then": [ + { + "roll": "Some unknown chance or decision roll" + }, + { + "say": "Hold the Red's gaze", + "then": [ + { + "say": "Jump off and hope", + "end": "Incinerated" + }, + { + "say": "Drop to your stomach", + "then": [ + { + "say": "Hang tight", + "end": "Incinerated" + }, + { + "say": "Crawl to the seat", + "pct": "2%", + "end": "Bonded" + } + ] + } + ] + }, + { + "say": "Lower your eyes", + "end": "Incinerated" + } + ] + }, + { + "say": "Wait and pursue the Green", + "end": "On to the two Greens" + } + ] + }, + "tree-Greens": { + "title": "The two Greens", + "scene": "You enter a clearing with two Green dragons.", + "options": [ + { + "say": "Turn to the right dragon", + "best": true, + "then": [ + { + "say": "Glance to the left dragon", + "end": "Incinerated" + }, + { + "say": "Don't move a muscle", + "best": true, + "then": [ + { + "say": "Stay still", + "best": true, + "then": [ + { + "say": "Decapitation isn't scary", + "best": true, + "then": [ + { + "say": "You respect their nature", + "best": true, + "end": "Bonded (Right Green)" + }, + { + "say": "You don't know", + "end": "Incinerated" + }, + { + "say": "Greens have the best magic", + "best": true, + "end": "Bonded (Left Green)" + }, + { + "say": "Intellect match", + "best": true, + "end": "A Brown saves you: Bonded (Brown)" + } + ] + }, + { + "say": "Sidestep out of its mouth", + "end": "Incinerated" + } + ] + }, + { + "say": "Sidestep out of its mouth", + "end": "Incinerated" + } + ] + } + ] + }, + { + "say": "Turn to the left dragon", + "best": true, + "then": [ + { + "say": "Glance to the right dragon", + "end": "Incinerated" + }, + { + "say": "Don't move a muscle", + "best": true, + "then": [ + { + "say": "Hold your ground", + "best": true, + "then": [ + { + "say": "You always overextend", + "best": true, + "end": "Bonded (Right Green)" + }, + { + "say": "You lack flaws", + "end": "Incinerated" + }, + { + "say": "You struggle with temper", + "best": true, + "end": "Bonded (Left Green)" + }, + { + "say": "You're always right", + "best": true, + "end": "An Orange saves you: Bonded (Orange)" + } + ] + }, + { + "say": "Step back", + "end": "Incinerated" + } + ] + } + ] + }, + { + "say": "Stay neutral", + "end": "Incinerated" + } + ] + }, + "meadow-Orange": { + "title": "The meadow Orange", + "scene": "You approach the Orange dragon.", + "options": [ + { + "say": "Absolutely sure, Orange", + "best": true, + "pct": "90%", + "then": [ + { + "say": "Roar right back at it", + "best": true, + "pct": "69%", + "then": [ + { + "say": "Flee", + "end": "Incinerated" + }, + { + "say": "Attempt to mount", + "best": true, + "end": "Bonded" + }, + { + "roll": "Possibly an unknown decision or chance mechanic (20%)" + }, + { + "say": "Hit the ground", + "best": true, + "then": [ + { + "say": "Run to mount its foreleg", + "best": true, + "end": "Bonded" + }, + { + "say": "Look it in the eye", + "then": [ + { + "say": "Run to mount", + "end": "Bonded" + }, + { + "say": "Maintain eye contact", + "end": "Incinerated" + } + ] + } + ] + }, + { + "say": "Run at the claw", + "then": [ + { + "say": "Hold tight for balance", + "end": "Incinerated" + }, + { + "say": "Climb with strength", + "end": "Bonded" + } + ] + } + ] + }, + { + "say": "Run, this was a mistake", + "end": "Incinerated" + } + ] + }, + { + "say": "On second thought…", + "pct": "10%", + "end": "Incinerated" + } + ] + }, + "meadow-Brown": { + "title": "The meadow Brown", + "scene": "You approach the Brown dragon.", + "options": [ + { + "say": "Run after the Brown", + "best": true, + "then": [ + { + "say": "On second thought…", + "end": "Incinerated" + }, + { + "say": "Your heart is sure", + "best": true, + "then": [ + { + "say": "Shout at it to stop", + "pct": "50%", + "then": [ + { + "say": "Apologise immediately", + "pct": "50%", + "end": "Incinerated" + }, + { + "say": "Await judgment, or pray", + "pct": "90%", + "then": [ + { + "say": "Mud fight!", + "then": [ + { + "say": "Wipe off the mud", + "pct": "90%", + "then": [ + { + "say": "The dragon speaks", + "then": [ + { + "say": "Defend the kingdom", + "end": "Death 50/50" + }, + { + "say": "Defend the powerless", + "end": "Bonded" + }, + { + "say": "Seek revenge", + "end": "Incinerated" + } + ] + } + ] + }, + { + "say": "Throw mud at the dragon", + "pct": "60%", + "end": "Bonded" + }, + { + "say": "Find a better dragon", + "end": "Not recorded" + } + ] + } + ] + } + ] + }, + { + "say": "Indecisively chase it", + "end": "Incinerated" + }, + { + "say": "Mount the Brown's tail", + "best": true, + "then": [ + { + "say": "Throw your weight", + "best": true, + "then": [ + { + "say": "You'll charm it", + "best": true, + "end": "Bonded" + }, + { + "say": "Hope for a clean death", + "end": "Incinerated" + }, + { + "say": "It's already talking to you", + "end": "Bonded" + } + ] + }, + { + "say": "Wait for a better angle", + "end": "Incinerated" + } + ] + } + ] + } + ] + }, + { + "say": "Turn to the Orange", + "end": "Incinerated" + } + ] + }, + "meadow-Blue": { + "title": "The meadow Blue", + "scene": "You approach the Blue dragon.", + "options": [ + { + "say": "Change to Orange", + "pct": "?", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Change to Brown", + "pct": "?", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Absolutely, Blue Dragon", + "best": true, + "pct": "90%", + "then": [ + { + "say": "Hold glare and advance", + "best": true, + "pct": "80%", + "then": [ + { + "say": "Do nothing", + "best": true, + "pct": "83%", + "then": [ + { + "say": "Lower your eyes", + "pct": "?", + "unconfirmed": true, + "end": "Incinerated" + }, + { + "say": "Help the cadet", + "pct": "0%", + "end": "Incinerated" + }, + { + "say": "Hold glare and watch", + "best": true, + "pct": "80%", + "then": [ + { + "say": "Straighten your spine", + "best": true, + "pct": "82%", + "then": [ + { + "say": "Hold steady", + "pct": "0%", + "unconfirmed": true, + "end": "Incinerated" + }, + { + "say": "Launch yourself right", + "best": true, + "pct": "85%", + "then": [ + { + "say": "You already know", + "pct": "?", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Bring down an empire", + "best": true, + "pct": "80%", + "then": [ + { + "say": "Seize the chance to mount", + "pct": "50%", + "end": "Incinerated" + }, + { + "say": "Move slowly forward", + "best": true, + "pct": "80%", + "end": "Bonded" + }, + { + "say": "Hold still", + "pct": "50%", + "end": "Incinerated" + } + ] + }, + { + "say": "I want revenge", + "pct": "?", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Defend the helpless", + "pct": "?", + "unconfirmed": true, + "end": "Not tested" + } + ] + } + ] + }, + { + "say": "Speak first", + "pct": "20%", + "end": "Incinerated" + }, + { + "say": "Do nothing", + "pct": "?", + "end": "Incinerated" + } + ] + } + ] + }, + { + "say": "Intervene and help", + "pct": "?", + "end": "Incinerated" + } + ] + }, + { + "say": "Lower gaze, halt advance", + "pct": "0%", + "end": "Incinerated" + }, + { + "say": "Lower gaze, advance", + "pct": "0%", + "end": "Incinerated" + } + ] + } + ] + }, + "shadow": { + "title": "The shadow", + "scene": "You've seen a shadow, where will it lead...", + "options": [ + { + "say": "A green sounds good", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Stay the course", + "best": true, + "then": [ + { + "say": "Well this is intriguing", + "best": true, + "then": [ + { + "say": "Curiosity sated, retreat", + "then": [ + { + "say": "Find that Green", + "end": "On to the two Greens" + }, + { + "say": "Go towards the valley", + "unconfirmed": true, + "end": "Not tested" + } + ] + }, + { + "say": "Freeze and lower your eyes", + "best": true, + "then": [ + { + "say": "Warn the cadet", + "end": "Incinerated" + }, + { + "say": "Hold still", + "best": true, + "then": [ + { + "say": "Aid the cadet", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "Hold position", + "best": true, + "then": [ + { + "say": "Approach the Blue", + "then": [ + { + "say": "On second thought…", + "unconfirmed": true, + "end": "Not tested" + }, + { + "say": "You're sure", + "unconfirmed": true, + "end": "Incinerated?" + } + ] + }, + { + "say": "Await judgement", + "best": true, + "then": [ + { + "say": "Help the cadet", + "best": true, + "then": [ + { + "say": "Use your dagger", + "best": true, + "then": [ + { + "say": "Head south and hope", + "best": true, + "end": "On to the Black" + } + ] + }, + { + "say": "Take them to cold water", + "end": "Head back for the Greens, or explore other dragons" + }, + { + "say": "Clean their uniform", + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + { + "say": "Leave to find your dragon", + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + { + "say": "Run towards the other cadet", + "unconfirmed": true, + "end": "Not tested" + } + ] + }, + { + "say": "Last chance to escape", + "end": "Head back for the Greens, or explore other dragons" + } + ] + }, + { + "say": "Leave while it's distracted", + "end": "Head back for the Greens, or explore other dragons" + } + ] + } + ] + }, + { + "say": "Too big, you're out", + "end": "Head back for the Greens, or explore other dragons" + } + ] + } + ] + }, + "black": { + "title": "The Black", + "scene": "A branch snaps behind you...", + "note": "Lowering your eyes has frequently ended in incineration; what follows it is unconfirmed.", + "options": [ + { + "say": "Ignore it, keep walking", + "end": "Incinerated" + }, + { + "say": "Turn to face the threat", + "best": true, + "then": [ + { + "say": "Lower your eyes", + "end": "Incinerated" + }, + { + "say": "Hold its gaze", + "best": true, + "end": "Bonded" + } + ] + } + ] + } + }, + "route_encounters": { + "valley-Red": [ + "valley-Red" + ], + "tree-Red": [ + "tree-Red" + ], + "tree-Greens": [ + "tree-Greens" + ], + "meadow-Orange": [ + "meadow-Orange" + ], + "meadow-Brown": [ + "meadow-Brown" + ], + "meadow-Blue": [ + "meadow-Blue" + ], + "shadow-Blue": [ + "shadow" + ], + "shadow-Black": [ + "shadow", + "black" + ] + } +} diff --git a/site/atlas/explorer.js b/site/atlas/explorer.js index e6a4502..2938c7a 100644 --- a/site/atlas/explorer.js +++ b/site/atlas/explorer.js @@ -753,6 +753,92 @@ ${trafficToggle()}`; } + /** Inside the bonding encounter: the answers the bot gave, screen by screen, on its best logged way to bond this + * colour (data/tree.json, analysis/tree/build_tree.py), with what every other answer did. Only shown when the bot's + * way goes through the same encounter as the route; the community form does not record these answers. */ + const TREE_SIDE = (enc) => (/^(valley|meadow)-/.test(enc) ? "valley" : "tree"); + /** The community route PDF's answers for an encounter (data/pdf_encounters.json): its recommended (dark-tile) answers + * as numbered steps toward this dragon, then the whole tree. */ + // the goal inside one encounter: a bond with this colour, or (an encounter that leads on, like the shadow before + // the Black) the way on to the next one + const isGoal = (end, colour, onward) => onward ? new RegExp(`^On to the ${onward}`).test(end || "") + : /^Bonded|Bonded \(/.test(end || "") && (!/\(/.test(end) || new RegExp(colour).test(end)); + function leadsTo(o, colour, onward) { + if (o.end) return isGoal(o.end, colour, onward); + return (o.then || []).some((c) => !c.roll && leadsTo(c, colour, onward)); + } + function guidePath(options, colour, onward) { + const steps = []; + let opts = options; + while (opts && opts.length) { + const live = opts.filter((o) => !o.roll); + const pick = live.find((o) => o.best && leadsTo(o, colour, onward)) || live.find((o) => leadsTo(o, colour, onward)); + if (!pick) break; + const roll = opts.find((o) => o.roll); + steps.push({ pick, others: live.filter((o) => o !== pick), roll: roll ? roll.roll : null }); + if (pick.end) break; + opts = pick.then; + } + return steps; + } + const endOf = (o) => (o.end ? o.end : "continues"); + function treeList(options) { + return `
${esc(E.title)}: ${esc(E.scene)}${E.warning ? ` ${esc(E.warning)}` : ""}
+ ${rows ? `The guide shows no way to bond a ${st.colour} here.
`} + ${E.note ? `${esc(E.note)}
` : ""} +From the community route PDF by ${esc((src.authors || []).join(", "))} (${esc(src.version || "")} version), transcribed as data. ${esc(src.note || "")}
Loading the answers inside the encounter…
'; + const best = (t.best || {})[st.colour]; + const picks = best && best.picks && best.picks.length ? best.picks : null; + const hourAt = picks ? picks.findIndex((p) => (t.screens[p.screen] || {}).stage === "THORN_WALK") : -1; + const side = hourAt >= 0 && /valley/i.test(picks[hourAt].text) ? "valley" : "tree"; + const viaShadow = picks && picks.some((p) => /shadow/i.test(p.text) && !/descend/i.test(p.text)); + const fits = picks && hourAt >= 0 && side === TREE_SIDE(enc) && (enc.startsWith("shadow-") ? viaShadow : !viaShadow || side === "valley"); + if (!fits) return `The DragonKind bot hasn't bonded a ${st.colour} through ${esc(ENC_NAME[enc] || enc)} yet, so it can't confirm these answers. (The community form records only how the encounter ended, not the answers given.)
`; + const died = (o) => (o.to && o.to.DIED ? o.to.DIED.n : 0); + const rows = picks.slice(hourAt + 1).map((p, i) => { + const sc = t.screens[p.screen] || { options: {} }; + const me = sc.options[p.option] || { n: p.n, to: {} }; + const lived = me.n - died(me); + const others = Object.entries(sc.options).filter(([k]) => k !== p.option).map(([, o]) => + `${end ? `Bonded a ${end.split(":")[1]}. ` : ""}From the bot's own runs (it logs every screen it sees), so the counts are small; untested answers may also work.