153 lines
8.2 KiB
XML
153 lines
8.2 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="2100" viewBox="0 0 1600 2100">
|
|
<defs>
|
|
<style>
|
|
.title { font: 700 34px 'Segoe UI', Tahoma, sans-serif; fill: #0f172a; }
|
|
.label { font: 600 18px 'Segoe UI', Tahoma, sans-serif; fill: #0f172a; }
|
|
.small { font: 500 16px 'Segoe UI', Tahoma, sans-serif; fill: #1f2937; }
|
|
.edge { font: 600 15px 'Segoe UI', Tahoma, sans-serif; fill: #334155; }
|
|
.node { fill: #eef4ff; stroke: #355caa; stroke-width: 2.2; rx: 12; }
|
|
.decision { fill: #fff6db; stroke: #ad7c00; stroke-width: 2.2; }
|
|
.terminal { fill: #ffe5e5; stroke: #a23434; stroke-width: 2.2; rx: 20; }
|
|
.group { fill: #f8fafc; stroke: #94a3b8; stroke-width: 1.5; rx: 14; stroke-dasharray: 8 6; }
|
|
.arrow { stroke: #334155; stroke-width: 2.2; fill: none; marker-end: url(#arrowHead); }
|
|
</style>
|
|
<marker id="arrowHead" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth">
|
|
<path d="M0,0 L0,6 L9,3 z" fill="#334155" />
|
|
</marker>
|
|
</defs>
|
|
|
|
<rect x="20" y="20" width="1560" height="2060" fill="#ffffff" stroke="#cbd5e1" stroke-width="2" rx="18" />
|
|
<text x="800" y="72" text-anchor="middle" class="title">New RPG Dialogue Runtime Flowchart</text>
|
|
<text x="800" y="103" text-anchor="middle" class="small">From interaction start to dialogue close, including choice/condition routing and reactions</text>
|
|
|
|
<rect x="90" y="140" width="1420" height="420" class="group" />
|
|
<text x="110" y="168" class="label">A) Open Dialogue and Build Runtime Graph</text>
|
|
|
|
<rect x="620" y="190" width="360" height="64" class="node" />
|
|
<text x="800" y="228" text-anchor="middle" class="label">Player presses E near NPC</text>
|
|
|
|
<rect x="620" y="286" width="360" height="64" class="node" />
|
|
<text x="800" y="324" text-anchor="middle" class="label">openNpcDialogue()</text>
|
|
|
|
<rect x="620" y="382" width="360" height="64" class="node" />
|
|
<text x="800" y="420" text-anchor="middle" class="label">updateQuestProgression()</text>
|
|
|
|
<rect x="620" y="478" width="360" height="64" class="node" />
|
|
<text x="800" y="516" text-anchor="middle" class="label">Build runtime graph from content</text>
|
|
|
|
<path d="M800 254 L800 286" class="arrow" />
|
|
<path d="M800 350 L800 382" class="arrow" />
|
|
<path d="M800 446 L800 478" class="arrow" />
|
|
|
|
<rect x="90" y="590" width="1420" height="430" class="group" />
|
|
<text x="110" y="618" class="label">B) Start Node Selection</text>
|
|
|
|
<rect x="150" y="655" width="380" height="76" class="node" />
|
|
<text x="340" y="688" text-anchor="middle" class="label">defaultDialogueNodeId exists</text>
|
|
<text x="340" y="712" text-anchor="middle" class="small">and resolves to a node?</text>
|
|
|
|
<polygon points="800,650 940,708 800,766 660,708" class="decision" />
|
|
<text x="800" y="703" text-anchor="middle" class="label">Yes</text>
|
|
<text x="800" y="724" text-anchor="middle" class="small">use default node</text>
|
|
|
|
<rect x="1070" y="655" width="360" height="76" class="node" />
|
|
<text x="1250" y="688" text-anchor="middle" class="label">Sort nodes by order, then id</text>
|
|
<text x="1250" y="712" text-anchor="middle" class="small">find candidate roots</text>
|
|
|
|
<rect x="1070" y="760" width="360" height="76" class="node" />
|
|
<text x="1250" y="793" text-anchor="middle" class="label">Filter by dialogueNodeMatchesContext</text>
|
|
<text x="1250" y="817" text-anchor="middle" class="small">pick highest priority</text>
|
|
|
|
<rect x="620" y="892" width="360" height="76" class="node" />
|
|
<text x="800" y="925" text-anchor="middle" class="label">DialogueSession.openGraph()</text>
|
|
<text x="800" y="949" text-anchor="middle" class="small">set currentNodeId</text>
|
|
|
|
<path d="M980 510 L980 708 L940 708" class="arrow" />
|
|
<path d="M530 693 L660 708" class="arrow" />
|
|
<path d="M940 708 L1070 708" class="arrow" />
|
|
<path d="M1250 731 L1250 760" class="arrow" />
|
|
<path d="M1250 836 L980 930" class="arrow" />
|
|
|
|
<polygon points="800,1015 930,1068 800,1121 670,1068" class="decision" />
|
|
<text x="800" y="1062" text-anchor="middle" class="label">Start node</text>
|
|
<text x="800" y="1083" text-anchor="middle" class="small">exists?</text>
|
|
|
|
<rect x="1090" y="1035" width="300" height="64" class="terminal" />
|
|
<text x="1240" y="1072" text-anchor="middle" class="label">Close dialogue</text>
|
|
|
|
<rect x="620" y="1155" width="360" height="64" class="node" />
|
|
<text x="800" y="1192" text-anchor="middle" class="label">applyNodeReactions(startNode)</text>
|
|
|
|
<path d="M800 968 L800 1015" class="arrow" />
|
|
<path d="M930 1068 L1090 1068" class="arrow" />
|
|
<path d="M800 1121 L800 1155" class="arrow" />
|
|
|
|
<rect x="90" y="1250" width="1420" height="780" class="group" />
|
|
<text x="110" y="1278" class="label">C) Main Dialogue Loop (Input + Routing)</text>
|
|
|
|
<polygon points="800,1310 940,1368 800,1426 660,1368" class="decision" />
|
|
<text x="800" y="1362" text-anchor="middle" class="label">Current node</text>
|
|
<text x="800" y="1383" text-anchor="middle" class="small">has choices?</text>
|
|
|
|
<polygon points="430,1460 570,1518 430,1576 290,1518" class="decision" />
|
|
<text x="430" y="1512" text-anchor="middle" class="label">Continue key</text>
|
|
<text x="430" y="1533" text-anchor="middle" class="small">pressed?</text>
|
|
|
|
<rect x="230" y="1610" width="400" height="76" class="node" />
|
|
<text x="430" y="1643" text-anchor="middle" class="label">resolveNodeConditionalNext()</text>
|
|
<text x="430" y="1667" text-anchor="middle" class="small">first passing condition wins</text>
|
|
|
|
<polygon points="430,1722 560,1775 430,1828 300,1775" class="decision" />
|
|
<text x="430" y="1769" text-anchor="middle" class="label">Next id exists?</text>
|
|
|
|
<rect x="230" y="1860" width="400" height="76" class="node" />
|
|
<text x="430" y="1893" text-anchor="middle" class="label">advanceTo(next)</text>
|
|
<text x="430" y="1917" text-anchor="middle" class="small">apply entered node reactions</text>
|
|
|
|
<polygon points="1170,1460 1310,1518 1170,1576 1030,1518" class="decision" />
|
|
<text x="1170" y="1512" text-anchor="middle" class="label">Any visible</text>
|
|
<text x="1170" y="1533" text-anchor="middle" class="small">choices?</text>
|
|
|
|
<polygon points="980,1610 1120,1668 980,1726 840,1668" class="decision" />
|
|
<text x="980" y="1662" text-anchor="middle" class="label">Continue key</text>
|
|
<text x="980" y="1683" text-anchor="middle" class="small">pressed?</text>
|
|
|
|
<polygon points="1300,1610 1440,1668 1300,1726 1160,1668" class="decision" />
|
|
<text x="1300" y="1662" text-anchor="middle" class="label">Number key</text>
|
|
<text x="1300" y="1683" text-anchor="middle" class="small">1..9 pressed?</text>
|
|
|
|
<rect x="1110" y="1760" width="380" height="76" class="node" />
|
|
<text x="1300" y="1793" text-anchor="middle" class="label">Map visible index to actual choice</text>
|
|
<text x="1300" y="1817" text-anchor="middle" class="small">apply choice reaction</text>
|
|
|
|
<rect x="1110" y="1868" width="380" height="76" class="node" />
|
|
<text x="1300" y="1901" text-anchor="middle" class="label">resolveChoiceTarget()</text>
|
|
<text x="1300" y="1925" text-anchor="middle" class="small">met: nextId, else unmetNextId</text>
|
|
|
|
<path d="M800 1219 L800 1310" class="arrow" />
|
|
<path d="M660 1368 L430 1518" class="arrow" />
|
|
<path d="M940 1368 L1170 1518" class="arrow" />
|
|
|
|
<path d="M430 1576 L430 1610" class="arrow" />
|
|
<path d="M430 1686 L430 1722" class="arrow" />
|
|
<path d="M430 1828 L430 1860" class="arrow" />
|
|
|
|
<path d="M1170 1576 L980 1668" class="arrow" />
|
|
<path d="M1170 1576 L1300 1668" class="arrow" />
|
|
|
|
<path d="M980 1726 L430 1722" class="arrow" />
|
|
<path d="M1300 1726 L1300 1760" class="arrow" />
|
|
<path d="M1300 1836 L1300 1868" class="arrow" />
|
|
<path d="M1110 1906 L630 1898" class="arrow" />
|
|
|
|
<path d="M430 1936 L430 1984 L800 1984 L800 1426" class="arrow" />
|
|
<path d="M1300 1944 L1300 1984 L800 1984" class="arrow" />
|
|
|
|
<rect x="690" y="2010" width="220" height="52" class="terminal" />
|
|
<text x="800" y="2042" text-anchor="middle" class="label">Dialogue closed</text>
|
|
|
|
<path d="M560 1775 L690 2036" class="arrow" />
|
|
<path d="M1240 1068 L1240 2036 L910 2036" class="arrow" />
|
|
|
|
<text x="96" y="2068" class="small">Note: Text rendering uses resolveNodeConditionalText() and displays the first passing condition text. Continue hint uses condition-resolved next id.</text>
|
|
</svg>
|