Cadet encounter in the game's real order
The solver treated the cadet encounter as one seven-way choice made at the first dragon, so the map put a diamond there with no matching choices. It is now a sequence, as in the game: at the scream, investigate or keep walking; in the clearing, help your squadmate or walk away; then the bullies' fate (after surviving the fight) or what to do for the wounded cadet. Each choice point sits at its own place on the map and opens only its own options; an option that stays in the same place (helping, in the clearing) appears as a clickable label there. Bot histories that only know the final resolution still resolve correctly; the bot advisor maps each step onto the screen text. Policy rebuilt; tests added. 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
99f60282ed
commit
e8c177fc15
+19
-6
@@ -142,11 +142,11 @@
|
||||
case "company": push("comp:" + v); break;
|
||||
case "direction": push("dir:" + v); break;
|
||||
case "fs": push(`see:${h.direction}:${v}`); break;
|
||||
case "cadet":
|
||||
push("scream");
|
||||
if (v === "Left them to it") push("away");
|
||||
else { push(["Tourniquet", "Left injured cadet", "Took their weapons"].includes(v) ? "wounded" : "bully"); push("res:" + v); }
|
||||
break;
|
||||
// the cadet encounter, step by step: you hear the scream, then either investigate (the clearing with your
|
||||
// squadmate and the bullies) or keep walking (the wounded cadet)
|
||||
case "scream": push("scream"); marks[marks.length - 1].at = last(); push(v === "Keep walking" ? "wounded" : "bully"); break;
|
||||
case "clearing": if (v === "Walk away") push("away"); break;
|
||||
case "fate": case "wounded": push("res:" + v); break;
|
||||
case "post": push("fork:" + v); break;
|
||||
case "hour": push("hour"); marks[marks.length - 1].at = last(); push(v === "Tree" ? "tree" : "valley"); break;
|
||||
case "shadow": if (v === "yes") push("stream"); break;
|
||||
@@ -164,7 +164,9 @@
|
||||
// where each option of a decision leads on the map (for expanded choice points)
|
||||
const optionPlace = (s, v) => ({
|
||||
company: "comp:" + v, direction: "dir:" + v, post: "fork:" + v,
|
||||
cadet: v === "Left them to it" ? "away" : "res:" + v,
|
||||
scream: v === "Keep walking" ? "wounded" : "bully",
|
||||
clearing: v === "Walk away" ? "away" : "bully",
|
||||
fate: "res:" + v, wounded: "res:" + v,
|
||||
hour: v === "Tree" ? "tree" : "valley", descend: v.startsWith("Quickly") ? "treeRed" : "greens",
|
||||
valley: v === "Face the Red" ? "valleyRed" : "meadow",
|
||||
}[s.var]);
|
||||
@@ -347,6 +349,17 @@
|
||||
Object.entries(m.s.options).forEach(([v, val]) => {
|
||||
const pid = optionPlace(m.s, v);
|
||||
if (!pid || !L[pid] || v === m.s.taken) return;
|
||||
if (L[pid] === P) {
|
||||
// this option stays where you are (e.g. help your squadmate, right here in the clearing)
|
||||
pill(gLab, P.x, P.y - 30, `${v} ${pct(val.pX)}`, { edge: tc });
|
||||
const hit = pills[pills.length - 1].g;
|
||||
hit.setAttribute("class", "ex-alt"); hit.setAttribute("tabindex", 0); hit.setAttribute("role", "button");
|
||||
hit.setAttribute("aria-label", `${v}: ${pct(val.pX)}. Take this instead.`);
|
||||
const go = () => choose(m.s.var, v);
|
||||
hit.addEventListener("click", go);
|
||||
hit.addEventListener("keydown", (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); go(); } });
|
||||
return;
|
||||
}
|
||||
const B = L[pid], rel2 = val.pX / best2;
|
||||
const p = el("path", { d: curve(P, B, 0.1), fill: "none", stroke: tc, "stroke-width": 2 + 4 * rel2, "stroke-opacity": 0.35 + 0.5 * rel2, "stroke-dasharray": "6 6", "stroke-linecap": "round", class: "ex-alt", tabindex: 0, role: "button", "aria-label": `${v}: ${pct(val.pX)}. Take this instead.` }, gLab);
|
||||
// the option's own place is labelled on the map, so its chance sits just under that place
|
||||
|
||||
@@ -659,7 +659,7 @@ adjusted OR = exp(βⱼ), 95% CI = exp(βⱼ ± 1.96·SEⱼ)</div>
|
||||
</div>
|
||||
<div class="mpanel method" role="tabpanel" id="mt-5-panel" aria-labelledby="mt-5" hidden>
|
||||
<h3>6. Best routes, the valley map and The Odds</h3>
|
||||
<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, 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>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>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user