Valley map: start from any place and see every dragon's best route from there
Click a place name before choosing a dragon to see your chance of each dragon from that point on, one coloured route per dragon, with a panel that ranks them and links into each route kept through that place. Deep link: #valley/at/<place>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e8c177fc15
commit
68587a55f0
+173
-9
@@ -59,13 +59,14 @@
|
||||
|
||||
/* ---------- state ---------- */
|
||||
const st = {
|
||||
point: null, // a place picked before any dragon: show the best way from there to every dragon
|
||||
policy: null, runs: null, counts: {}, colour: null, focus: null, expanded: null, over: {},
|
||||
objective: "eventually", sample: "all", traffic: false, cache: new Map(), pendingHash: null, info: null,
|
||||
};
|
||||
const model = () => st.policy.samples[st.sample];
|
||||
function advisorFor(enc) {
|
||||
const k = `${st.sample}|${st.colour}|${st.objective}|${enc}`;
|
||||
if (!st.cache.has(k)) st.cache.set(k, S.advisor(model(), st.colour, st.objective, { only: [enc] }));
|
||||
function advisorFor(enc, colour = st.colour) {
|
||||
const k = `${st.sample}|${colour}|${st.objective}|${enc}`;
|
||||
if (!st.cache.has(k)) st.cache.set(k, S.advisor(model(), colour, st.objective, { only: [enc] }));
|
||||
return st.cache.get(k);
|
||||
}
|
||||
let encParams = null;
|
||||
@@ -74,6 +75,95 @@
|
||||
return encParams.p.encounter(enc);
|
||||
};
|
||||
|
||||
/* ---------- starting from a place ---------- */
|
||||
// What being at a place means: the choices (and, for the shadow, the roll) that put you there, and the step you
|
||||
// face next ("at"). Choices before it that are not listed stay free, and the best play is assumed for them.
|
||||
const INV = "Investigate the scream", HELPC = "Help your squadmate";
|
||||
const POINTS = {
|
||||
"comp:Alone": { force: { company: "Alone" }, at: "direction" },
|
||||
"comp:1 Squadmate": { force: { company: "1 Squadmate" }, at: "direction" },
|
||||
"comp:2 Squadmates": { force: { company: "2 Squadmates" }, at: "direction" },
|
||||
"dir:West": { force: { direction: "West" }, at: "fs" },
|
||||
"dir:Center": { force: { direction: "Center" }, at: "fs" },
|
||||
"dir:East": { force: { direction: "East" }, at: "fs" },
|
||||
scream: { force: {}, at: "scream" },
|
||||
bully: { force: { scream: INV }, at: "clearing" },
|
||||
wounded: { force: { scream: "Keep walking" }, at: "wounded" },
|
||||
away: { force: { scream: INV, clearing: "Walk away" }, at: "hour" },
|
||||
"res:Killed the bullies yourself": { force: { scream: INV, clearing: HELPC, fate: "Killed the bullies yourself" }, at: "post" },
|
||||
"res:Squadmate's revenge": { force: { scream: INV, clearing: HELPC, fate: "Squadmate's revenge" }, at: "post" },
|
||||
"res:Left bullies to the dragons": { force: { scream: INV, clearing: HELPC, fate: "Left bullies to the dragons" }, at: "post" },
|
||||
"res:Tourniquet": { force: { scream: "Keep walking", wounded: "Tourniquet" }, at: "hour" },
|
||||
"res:Left injured cadet": { force: { scream: "Keep walking", wounded: "Left injured cadet" }, at: "hour" },
|
||||
"res:Took their weapons": { force: { scream: "Keep walking", wounded: "Took their weapons" }, at: "hour" },
|
||||
"fork:West": { force: { scream: INV, clearing: HELPC, post: "West" }, at: "hour" },
|
||||
"fork:Forest": { force: { scream: INV, clearing: HELPC, post: "Forest" }, at: "hour" },
|
||||
"fork:East": { force: { scream: INV, clearing: HELPC, post: "East" }, at: "hour" },
|
||||
hour: { force: {}, at: "hour" },
|
||||
tree: { force: { hour: "Tree" }, at: "shadow" },
|
||||
valley: { force: { hour: "Valley" }, at: "valley" },
|
||||
stream: { force: { hour: "Tree", shadow: "yes" }, at: "shadowColour" },
|
||||
meadow: { force: { hour: "Valley", valley: "Pass the Red (meadow)" }, at: "meadow" },
|
||||
};
|
||||
|
||||
/**
|
||||
* Chance of bonding the advisor's colour once you are at a place: everything before it that the place implies is
|
||||
* fixed, earlier rolls are averaged over the ways of getting there, and from there on the best play is used.
|
||||
* Returns null when the place cannot lead to that dragon.
|
||||
*/
|
||||
function valueFrom(adv, pt) {
|
||||
const rec = (h, reached) => {
|
||||
const s = adv.step(h);
|
||||
if (s.kind === "end") return { x: 0, w: reached ? 1 : 0 };
|
||||
const live = reached && s.risk ? 1 - s.risk.p : 1;
|
||||
const atPoint = !reached && s.var === pt.at && Object.keys(pt.force).every((k) => h[k] != null || k === pt.at);
|
||||
if (reached || atPoint) {
|
||||
if (s.kind === "decision") return { x: live * Math.max(...Object.values(s.options).map((v) => v.pX)), w: 1 };
|
||||
let x = 0;
|
||||
for (const [b, p] of Object.entries(s.probs)) if (p) x += p * rec({ ...h, [s.var]: b }, true).x;
|
||||
return { x: live * x, w: 1 };
|
||||
}
|
||||
const forced = pt.force[s.var];
|
||||
if (s.kind === "decision") {
|
||||
const o = forced != null ? forced : s.choice;
|
||||
if (!s.options[o]) return { x: 0, w: 0 };
|
||||
const r = rec({ ...h, [s.var]: o }, false);
|
||||
return { x: r.x, w: r.w * (s.risk ? 1 - s.risk.p : 1) };
|
||||
}
|
||||
// a roll before the place: only branches that can still get there count
|
||||
let xw = 0, w = 0;
|
||||
for (const [b, p] of Object.entries(s.probs)) {
|
||||
if (!p || (forced != null && b !== forced)) continue;
|
||||
const r = rec({ ...h, [s.var]: b }, false);
|
||||
xw += p * r.w * r.x; w += p * r.w;
|
||||
}
|
||||
return { x: w ? xw / w : 0, w: w * (s.risk ? 1 - s.risk.p : 1) };
|
||||
};
|
||||
const r = rec({}, false);
|
||||
return r.w > 1e-9 ? r.x : null;
|
||||
}
|
||||
|
||||
/** For a picked place: per colour, the encounter with the best chance from there, and its route. */
|
||||
function routesFrom(id) {
|
||||
const pt = POINTS[id];
|
||||
return COLOURS.map((c) => {
|
||||
let best = null;
|
||||
// the Greens rescue only counts for Orange/Brown when their own meadow is out of reach from here
|
||||
const encs = S.ENCOUNTERS[c].filter((e) => RESCUE[c] !== e || c === "Green");
|
||||
for (const pass of [encs, S.ENCOUNTERS[c].filter((e) => !encs.includes(e))]) {
|
||||
for (const enc of pass) {
|
||||
const v = valueFrom(advisorFor(enc, c), pt);
|
||||
if (v != null && v > 0 && (!best || v > best.v)) best = { enc, v };
|
||||
}
|
||||
if (best) break;
|
||||
}
|
||||
if (!best) return { colour: c, v: null };
|
||||
const r = walk(best.enc, c, pt.force);
|
||||
r.geo = routePoints(r);
|
||||
return { colour: c, enc: best.enc, v: best.v, route: r };
|
||||
}).sort((a, b) => (b.v || 0) - (a.v || 0));
|
||||
}
|
||||
|
||||
/* ---------- walking one route ---------- */
|
||||
const encColour = (enc) => (enc === "tree-Greens" ? "Green" : enc.split("-")[1]);
|
||||
function defaultOutcome(s, enc) {
|
||||
@@ -82,8 +172,8 @@
|
||||
if (s.var === "shadowColour" || s.var === "meadow") { const c = encColour(enc); if (s.probs[c] != null) return c; }
|
||||
return ent[0][0];
|
||||
}
|
||||
function walk(enc) {
|
||||
const adv = advisorFor(enc), over = st.over[enc] || {}, steps = [], h = {};
|
||||
function walk(enc, colour = st.colour, over = st.over[enc] || {}) {
|
||||
const adv = advisorFor(enc, colour), steps = [], h = {};
|
||||
for (let i = 0; i < 20; i++) {
|
||||
const s = adv.step(h);
|
||||
s.before = { ...h };
|
||||
@@ -282,6 +372,17 @@
|
||||
const t = el("text", { x: P.x + (pos === "right" ? 10 : pos === "left" ? -10 : 0), y: P.y + (pos === "above" ? -10 : 4), "text-anchor": pos === "right" ? "start" : pos === "left" ? "end" : "middle", "font-family": "var(--font-display)", "font-size": strong ? 14 : 13,
|
||||
fill: PAPER.ink, "fill-opacity": strong ? 1 : 0.8, "paint-order": "stroke", stroke: PAPER.halo, "stroke-width": 3.5, "stroke-linejoin": "round" }, g);
|
||||
t.textContent = LANDMARK_NAME[id] || P.name;
|
||||
// before a dragon is chosen, any place can be a starting point: "from here, how do I reach each dragon?"
|
||||
if (!st.colour && POINTS[id] && st.policy) {
|
||||
if (st.point === id) el("circle", { cx: P.x, cy: P.y, r: 11, fill: "none", stroke: PAPER.ink, "stroke-width": 2.5 }, g);
|
||||
const hit = el("g", { class: "ex-place", tabindex: 0, role: "button", "aria-label": `${t.textContent}: show the best way from here to every dragon` }, g);
|
||||
el("circle", { cx: P.x, cy: P.y, r: 14, fill: "transparent" }, hit);
|
||||
hit.appendChild(t);
|
||||
el("title", {}, hit).textContent = `${t.textContent}: from here to every dragon`;
|
||||
const go = () => { st.point = st.point === id ? null : id; st.info = null; writeHash(); render(); };
|
||||
hit.addEventListener("click", go);
|
||||
hit.addEventListener("keydown", (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); go(); } });
|
||||
}
|
||||
});
|
||||
el("text", { x: GATE.x, y: GATE.y + 14, "text-anchor": "middle", "font-size": 11, "letter-spacing": "0.16em", fill: PAPER.ink, "font-family": "var(--font-label)", "paint-order": "stroke", stroke: PAPER.halo, "stroke-width": 3 }, g).textContent = "ENTER THE VALLEY";
|
||||
}
|
||||
@@ -395,6 +496,34 @@
|
||||
pills.forEach((p) => { if (p.dy) p.g.setAttribute("transform", `translate(0 ${p.dy.toFixed(1)})`); });
|
||||
}
|
||||
|
||||
/** All six dragons from one place: the way there in ink, then one line per dragon in its colour. */
|
||||
function drawFrom(gRoute, gLab, list) {
|
||||
const onRoute = new Set([st.point]);
|
||||
const ok = list.filter((x) => x.route);
|
||||
if (!ok.length) return onRoute;
|
||||
const best = Math.max(1e-12, ...ok.map((x) => x.v));
|
||||
// the way to the place (from the most likely dragon's route)
|
||||
const lead = ok[0].route.geo.pts;
|
||||
const at = lead.findIndex((p) => p.id === st.point);
|
||||
for (let i = 1; i <= at; i++) {
|
||||
el("path", { d: curve(lead[i - 1].P, lead[i].P, 0.08), fill: "none", stroke: PAPER.ink, "stroke-width": 4, "stroke-opacity": 0.55, "stroke-dasharray": "2 8", "stroke-linecap": "round" }, gRoute);
|
||||
onRoute.add(lead[i].id);
|
||||
}
|
||||
[...ok].reverse().forEach((x, k) => {
|
||||
const pts = x.route.geo.pts, i0 = pts.findIndex((p) => p.id === st.point);
|
||||
if (i0 < 0) return;
|
||||
const f0 = pts[i0].flow || 1, rel = x.v / best, off = (COLOURS.indexOf(x.colour) - 2.5) * 5;
|
||||
for (let i = i0 + 1; i < pts.length; i++) {
|
||||
const w = 2.5 + 12 * Math.min(1, pts[i].flow / f0);
|
||||
el("path", { d: curve(pts[i - 1].P, pts[i].P, 0.08, off), fill: "none", stroke: INK[x.colour], "stroke-width": w, "stroke-opacity": 0.45 + 0.45 * rel, "stroke-linecap": "round" }, gRoute);
|
||||
onRoute.add(pts[i].id);
|
||||
}
|
||||
const end = pts[pts.length - 1];
|
||||
pill(gLab, end.P.x, end.P.y + 30, `${x.colour} ${pct(x.v)}`, { edge: INK[x.colour], strong: rel === 1 });
|
||||
});
|
||||
return onRoute;
|
||||
}
|
||||
|
||||
/* ---------- tooltip ---------- */
|
||||
function showTip(e, html) { const t = $("#ex-tip"); t.innerHTML = html; t.hidden = false; moveTip(e); }
|
||||
function moveTip(e) {
|
||||
@@ -422,12 +551,28 @@
|
||||
}
|
||||
return `<span class="eyebrow">Unofficial atlas · built from ${st.runs ? st.runs.length.toLocaleString() : "thousands of"} logged runs</span>
|
||||
<h2 id="h-valley">The valley</h2>
|
||||
<p class="small muted">Every dragon is drawn where riders meet it. The fainter it is, the fewer riders reach it. Choose one to see every way to it, and how likely each is.</p>
|
||||
<p class="small muted">Every dragon is drawn where riders meet it. The fainter it is, the fewer riders reach it. Choose one to see every way to it, and how likely each is. Or click a place name on the map to see your best chance at each dragon from there.</p>
|
||||
${chooser()}${info}
|
||||
${trafficToggle()}
|
||||
<p class="small muted">Prefer the numbers? <a href="#odds">The Odds</a> has the statistics behind the map.</p>`;
|
||||
}
|
||||
|
||||
function panelFrom(list) {
|
||||
const name = LANDMARK_NAME[st.point] || (L[st.point] && L[st.point].name) || st.point;
|
||||
const top = Math.max(1e-12, ...list.map((x) => x.v || 0));
|
||||
const rows = list.map((x) => x.v == null
|
||||
? `<div class="ex-from-row off" style="--c: var(${DV[x.colour]})">${mini(x.colour, POSE_OF[x.colour])}<span class="nm">${x.colour}</span><small>not reachable from here</small></div>`
|
||||
: `<button type="button" class="ex-from-row" data-c="${x.colour}" data-enc="${x.enc}" style="--c: var(${DV[x.colour]}); --w: ${(100 * x.v / top).toFixed(1)}%">${mini(x.colour, POSE_OF[x.colour])}
|
||||
<span class="nm">${x.colour}<small>${esc(ENC_NAME[x.enc])}${RESCUE[x.colour] === x.enc && x.colour !== "Green" ? " (rescue)" : ""}</small></span><b>${pct(x.v)}</b><i></i></button>`).join("");
|
||||
return `<div class="ex-head"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="5" fill="var(--accent)"/><circle cx="12" cy="12" r="10" fill="none" stroke="var(--accent)" stroke-width="2"/></svg>
|
||||
<div><span class="eyebrow">Starting from</span><h2 id="h-valley">${esc(name)}</h2></div>
|
||||
<button type="button" class="ex-close" id="ex-clear-point" aria-label="Back to the whole valley">×</button></div>
|
||||
<p class="small muted">If you are here, this is your best chance of bonding each dragon from here on, playing the best route after this point. Earlier rolls are averaged over the ways of getting here. Pick a dragon to follow its route step by step.</p>
|
||||
<div class="ex-from">${rows}</div>
|
||||
<div class="seg" role="group" aria-label="Goal"><button type="button" data-o="eventually" aria-pressed="${st.objective === "eventually"}">Only this dragon</button><button type="button" data-o="thisAttempt" aria-pressed="${st.objective === "thisAttempt"}">Best odds this run</button></div>
|
||||
${trafficToggle()}`;
|
||||
}
|
||||
|
||||
function panelRoutes(routes) {
|
||||
const best = Math.max(1e-12, ...routes.map((r) => r.value.x));
|
||||
const T = model().targets[st.colour], b = T[st.objective];
|
||||
@@ -479,12 +624,20 @@
|
||||
$$("[data-s]", p).forEach((b) => b.addEventListener("click", () => { st.sample = b.dataset.s; render(); }));
|
||||
const tr = $("#ex-traffic", p); if (tr) tr.addEventListener("change", () => { st.traffic = tr.checked; render(); });
|
||||
const cl = $("#ex-clear", p); if (cl) cl.addEventListener("click", () => select(null));
|
||||
const cp = $("#ex-clear-point", p); if (cp) cp.addEventListener("click", () => { st.point = null; writeHash(); render(); });
|
||||
$$(".ex-from-row[data-c]", p).forEach((b) => b.addEventListener("click", () => {
|
||||
// follow that dragon's route, keeping this place on it
|
||||
const enc = b.dataset.enc;
|
||||
st.over[enc] = { ...POINTS[st.point].force };
|
||||
select(b.dataset.c, enc);
|
||||
}));
|
||||
const rr = $("#ex-reset-route", p); if (rr) rr.addEventListener("click", () => { delete st.over[st.focus]; st.expanded = null; render(); });
|
||||
}
|
||||
|
||||
/* ---------- actions ---------- */
|
||||
function select(colour, enc) {
|
||||
st.colour = colour; st.info = null; st.expanded = null;
|
||||
if (colour) st.point = null;
|
||||
st.focus = colour ? enc || null : null;
|
||||
writeHash();
|
||||
render();
|
||||
@@ -502,12 +655,18 @@
|
||||
}
|
||||
function writeHash() {
|
||||
if (!$("#panel-valley") || $("#panel-valley").hidden) return;
|
||||
const h = "#valley" + (st.colour ? "/" + st.colour.toLowerCase() + (st.focus ? "/" + st.focus : "") : "");
|
||||
const h = "#valley" + (st.colour ? "/" + st.colour.toLowerCase() + (st.focus ? "/" + st.focus : "")
|
||||
: st.point ? "/at/" + encodeURIComponent(st.point) : "");
|
||||
try { history.replaceState(null, "", h); } catch (e) { /* ignore */ }
|
||||
}
|
||||
function fromHash() {
|
||||
const parts = (location.hash || "").replace(/^#/, "").split("/");
|
||||
if (parts[0] !== "valley") return;
|
||||
if (parts[1] === "at") {
|
||||
const id = decodeURIComponent(parts.slice(2).join("/"));
|
||||
if (POINTS[id]) { st.colour = null; st.focus = null; st.point = id; if (st.policy) render(); }
|
||||
return;
|
||||
}
|
||||
const c = parts[1] ? COLOURS.find((x) => x.toLowerCase() === parts[1].toLowerCase()) : null;
|
||||
const enc = parts[2] && c && S.ENCOUNTERS[c].includes(parts[2]) ? parts[2] : null;
|
||||
// plain "#valley" (e.g. the tab itself) keeps whatever the reader was looking at
|
||||
@@ -541,6 +700,11 @@
|
||||
pills = [];
|
||||
onRoute = drawRoutes(gRoute, gLab, routes);
|
||||
spreadPills();
|
||||
} else if (st.point && st.policy && POINTS[st.point]) {
|
||||
pills = [];
|
||||
st.fromList = routesFrom(st.point);
|
||||
onRoute = drawFrom(gRoute, gLab, st.fromList);
|
||||
spreadPills();
|
||||
}
|
||||
drawLandmarks(gLand, onRoute);
|
||||
drawScenery(gScene, onRoute);
|
||||
@@ -549,10 +713,10 @@
|
||||
const fin = document.createElementNS(NS, "svg");
|
||||
V.finish(fin);
|
||||
svg.insertAdjacentHTML("beforeend", fin.innerHTML.replace(/vm-/g, "ex-"));
|
||||
$("#ex-hint").hidden = !!st.colour || !st.policy;
|
||||
$("#ex-hint").hidden = !!st.colour || !!st.point || !st.policy;
|
||||
$("#ex-shell").style.setProperty("--vt", st.colour ? `var(${DV[st.colour]})` : "var(--accent)");
|
||||
// the panel scrolls inside the map's height on wide screens (see .ex-scroll)
|
||||
$("#ex-panel").innerHTML = `<div class="ex-scroll">${st.colour && st.policy ? panelRoutes(routes) : panelIdle()}</div>`;
|
||||
$("#ex-panel").innerHTML = `<div class="ex-scroll">${st.colour && st.policy ? panelRoutes(routes) : st.point && st.fromList ? panelFrom(st.fromList) : panelIdle()}</div>`;
|
||||
bindPanel();
|
||||
writeHash();
|
||||
// on narrow screens the map scrolls sideways: start centred rather than at the far west
|
||||
|
||||
+15
-1
@@ -340,6 +340,19 @@ footer { border-top-color: var(--line); }
|
||||
.ex-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
|
||||
.ex-head svg { width: 64px; height: 52px; }
|
||||
.ex-head h2 { color: var(--c); }
|
||||
.ex-place { cursor: pointer; }
|
||||
.ex-place:hover text, .ex-place:focus-visible text { text-decoration: underline; fill-opacity: 1; }
|
||||
.ex-place:focus { outline: none; }
|
||||
.ex-from { display: grid; gap: 6px; margin: 12px 0; }
|
||||
.ex-from-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 12px 10px 6px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--raised) 85%, #000); color: var(--ink); text-align: left; overflow: hidden; }
|
||||
.ex-from-row svg { width: 44px; height: 36px; }
|
||||
.ex-from-row .nm { display: grid; font-weight: 700; color: var(--c); min-width: 0; }
|
||||
.ex-from-row .nm small { font-weight: 400; color: var(--muted); }
|
||||
.ex-from-row b { font-size: 1.1rem; }
|
||||
.ex-from-row i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--c); }
|
||||
.ex-from-row.off { opacity: .55; }
|
||||
.ex-from-row.off small { grid-column: 3; color: var(--muted); }
|
||||
button.ex-from-row:hover { border-color: var(--c); }
|
||||
.ex-close { width: 32px; height: 32px; border-radius: 50%; padding: 0; font-size: 1.1rem; line-height: 1; }
|
||||
.ex-routes { display: grid; gap: 8px; }
|
||||
.ex-route-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-family: var(--font-body); text-transform: none; letter-spacing: normal; font-size: var(--step--1); }
|
||||
@@ -428,7 +441,7 @@ a { color: var(--accent); text-underline-offset: 2px; }
|
||||
<section id="valley-sec" aria-labelledby="h-valley" class="explorer">
|
||||
<div class="ex-shell deco" id="ex-shell">
|
||||
<div class="ex-map-wrap"><svg id="ex-map" viewBox="0 0 1000 790" role="application" aria-label="Map of the threshing valley. Choose a dragon to see the routes to it."></svg>
|
||||
<div class="ex-hint" id="ex-hint">Choose a dragon to see the way to it</div>
|
||||
<div class="ex-hint" id="ex-hint">Choose a dragon, or click a place to start from there</div>
|
||||
<div class="ex-tip" id="ex-tip" hidden></div>
|
||||
</div>
|
||||
<aside class="ex-panel" id="ex-panel" aria-live="polite"></aside>
|
||||
@@ -662,6 +675,7 @@ adjusted OR = exp(βⱼ), 95% CI = exp(βⱼ ± 1.96·SEⱼ)</div>
|
||||
<p>The valley map and The Odds come from a solver (<code>solver.js</code>) that treats a run as a decision tree. Your choices are decisions (company, direction, the cadet encounter in the game's order — investigate the scream or keep walking, help your squadmate or walk away, then the bullies' fate or what to do for the wounded cadet — the fork, tree or valley, how to climb down, whether to face the valley Red, and at every bonding encounter whether to attempt the bond or die on purpose). The game's rolls are chance events: which dragon appears first, whether you die at the sighting, in the fight or before the hour, whether the shadow appears and which dragon it is, which dragon waits in the meadow, and how the bonding encounter ends.</p>
|
||||
<p>Each roll's probability may depend on the choices before it. It is estimated with <b>hierarchical <a href="https://en.wikipedia.org/wiki/Dirichlet-multinomial_distribution" target="_blank" rel="noopener">Dirichlet</a> back-off</b>: the estimate for a full history is pulled toward the estimate for a shorter history, which is pulled toward the overall rate. How strongly is chosen from the data for each roll (<a href="https://en.wikipedia.org/wiki/Empirical_Bayes_method" target="_blank" rel="noopener">empirical Bayes</a>), so the solver does not chase noise in small groups. The best route is then found by <b><a href="https://en.wikipedia.org/wiki/Backward_induction" target="_blank" rel="noopener">backward induction</a></b>, for two goals: the chance of bonding the dragon on this attempt, and, for riders who die on purpose whenever a run goes wrong, the chance that the account eventually ends on that dragon rather than another (maximised by <a href="https://en.wikipedia.org/wiki/Fractional_programming" target="_blank" rel="noopener">Dinkelbach iteration</a>). Ranges come from 200 posterior draws; "stays best in N%" is how often the recommended choice is still best across those draws.</p>
|
||||
<p>Encounter outcomes use only <b>genuine attempts</b>: runs where the rider wanted that colour, any dragon, or said they would not seek Malek. The two summary cards on The Odds use the same rule in reverse: runs where the rider died on purpose at an encounter they did not want are left out, so they describe cadets who went into the valley and either bonded or died. The "low-bias" numbers use only bulk logs and form runs from riders who were not chasing a rare dragon.</p>
|
||||
<p><b>Starting from a place.</b> Clicking a place on the map before choosing a dragon shows your chance of each dragon <i>from there on</i>. Choices before that place are the ones that lead to it (or the solver's best, where several do); rolls before it are averaged over the outcomes that can still reach it, weighted by how often they happen and by survival. From the place onward the solver plays the best route for each dragon. A dragon is "not reachable from here" when no logged run went from that place to it. For Orange and Brown, the Greens rescue is used only when their own meadow is out of reach.</p>
|
||||
</div>
|
||||
<div class="mpanel method" role="tabpanel" id="mt-6-panel" aria-labelledby="mt-6" hidden>
|
||||
<h3>Missing answers</h3>
|
||||
|
||||
Reference in New Issue
Block a user