GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mudmini009/DualPath-Core-TTRPG-engine: Multi-agent TTRPG engine using Two-Path Architecture to solve AI hallucinations. Combines a deterministic Python Rules Engine with LLM-based creative judgment. Verified with 100% Routing and 98% Grounding accuracy. Senior Thesis @ KMUTT FIBO.

BranchesTags
Open more actions menu

Latest commit

 

History

124 Commits
124 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
archive
archive
 
 
data
data
 
 
diagrams
diagrams
 
 
docs
docs
 
 
evaluation
evaluation
 
 
playtest
playtest
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.metadata
.metadata
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
FEATURE_TRACKER.md
FEATURE_TRACKER.md
 
 
LITE_5E_RULES.md
LITE_5E_RULES.md
 
 
README.md
README.md
 
 
main.py
main.py
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

DUALPATH-CORE: A Multi-Agent Hybrid TTRPG Engine

Accepted at IEEE iSAI-NLP 2026 (Paper ID: 39) • FIBO Senior Thesis (2026), KMUTT

Pollapaat Suttimala, Suriya Natsupakpong, and Paisit Khanarsa*

Conference Python Ruleset LLM


DUALPATH-CORE is a neuro-symbolic, multi-agent Tabletop Role-Playing Game (TTRPG) engine designed to eliminate probabilistic LLM hallucinations, arithmetic instability, and sycophantic ("Yes-Man") exploits.

By decoupling deterministic rule execution (Path A) in pure Python from creative semantic arbitration & narration (Path B) via task-calibrated LLM sub-agents, DUALPATH-CORE ensures that Large Language Models have zero direct write access to the game state while maintaining open-ended roleplay freedom.

Across our 90-scenario automated benchmark (360 metric evaluations), DUALPATH-CORE raises overall reliability from 46.0% to 98.6%, boosts state synchronization from 9.5% to 94.4%, cuts combat payload tokens by 54.6% via the TOON protocol, and resolves deterministic turns in 214 ms on average.


Conference & Thesis Artifact Center

IEEE iSAI-NLP 2026 (Paper ID: 39) — docs/conference/

Artifact File Link Description
Conference Paper docs/conference/IEEE_Paper39_Final_Manuscript.pdf Camera-ready IEEE iSAI-NLP 2026 manuscript
Reviewer Responses docs/conference/IEEE_Paper39_Responses_to_Reviewers.pdf Point-by-point author responses to Reviewers 1–6
Presentation Slides (PDF) docs/conference/39-presentation.pdf Final 24-slide conference deck (16 main + 5 backup Q&A slides)
Presentation Slides (PPTX) docs/conference/39-presentation.pptx Editable PowerPoint conference slide deck
Stage Script & Q&A Playbook docs/conference/iSAI_NLP_2026_Speaking_Script_and_QA_Defense.md Word-for-word 10-minute presentation script, test suite refresher & 13-Q&A defense guide
Stage Q&A Booklet (PDF) docs/conference/iSAI_NLP_2026_Stage_Script_and_QA_Booklet.pdf Presenter booklet formatted in vertical layout for tablets

FIBO Senior Thesis & Technical Docs — docs/ & Root Markdown

Document File Link Description
Senior Thesis Report docs/อ.โซ่-อ.ปอ-AI DM-FinalSenior.pdf Full graduation thesis manuscript, methodology & system diagrams
Thesis Defense Slides docs/Thesis_Final.pdf Senior thesis defense presentation deck
Academic Poster docs/65340500046_Poster.pdf Project showcase poster
Implementation Report (TH) docs/รายงานการดำเนินงาน_DUALPATH_CORE.pdf Thai technical implementation report covering source modules & Paper #39
Architecture & Specs ARCHITECTURE.md • LITE_5E_RULES.md • FEATURE_TRACKER.md Class architecture, Lite 5e ruleset, and milestone history

Core Architecture

  1. Two-Path Orchestrator (src/router/ & src/logic/):
    • Path A (Symbolic Rules Engine): Standard mechanics (ATTACK, MOVE, USE_ITEM, REST, zone tactical modifiers across NEAR / MID / FAR) execute deterministically in RulesEngine and DiceRoller with zero LLM arithmetic.
    • Path B (Creative LLM Arbitration): Unscripted stunts and open-ended social/environmental actions are routed to ArbiterAgent, which returns strictly bounded Difficulty Classes (DC), target attributes (PHYS / MENT / SOC), and enum conditions before converging on Python validation.
  2. Resolver-Mutator Decoupling & Guardrails:
    • Pre-execution guardrails inspect has_acted and has_moved turn-economy locks, active status conditions (UNCONSCIOUS, STUNNED, DEAD), inventory grounding via difflib fuzzy string matching, and non-negative HP clamping (HP_new = max(0, HP_current - Damage)).
  3. 8 Task-Calibrated Runtime Sub-Agents + Session Initializers (src/agents/):
    • Combat Intent Router (T=0.1) & Exploration Semantic Router (T=0.1 after Pass-1 regex filters)
    • ArbiterAgent (T=0.3 action DCs / T=0.1 item categorization)
    • NarratorAgent (T=0.7 DM prose narration / T=0.2 post-combat summarization)
    • QuestArchitectAgent (T=0.6) & QuestCartographerAgent (T=0.4) with BFS map connectivity validation and up to 3 self-healing retries (_fallback_template.json safety fallback)
    • CharacterAgent ("Skeleton-and-Flesh" stat clamping + world lore expansion) and CampaignAgent (Prologue & Recap generation)
  4. TOON Protocol & Dual-Track O(1) Memory (src/models/toon_converter.py, src/services/data_manager.py):
    • Single-line pipe-delimited serialization (p1|name:Grok|hp:45|cond:NORMAL) cuts combat payloads by 54.6% (from 320 to 145 tokens/round).
    • Short-term turn logs reside in an $O(1)$ collections.deque(maxlen=10) buffer while completed combat queues undergo post-combat Context Collapse via Summarizer.

Benchmark & Pilot Study Results

Automated 90-Scenario Evaluation (evaluation/system_suite/)

Evaluated across 8 orthogonal functional categories (Cat A–Cat H, 360 total checks) using identical gemini-2.5-flash-lite instances under controlled token-cost parity:

Metric Monolithic Baseline DUALPATH-CORE Delta
Intent Routing Accuracy ($A_{\text{route}}$) 62.2% 100.0% (90/90) +37.8%
Parameter Grounding ($P_{\text{ground}}$) 41.1% 100.0% (90/90) +58.9%
State Synchronization ($S_{\text{sync}}$) 9.5%* 94.4% (85/90) +84.9%
Narrative Coherence ($C_{\text{narr}}$) 71.1% 100.0% (90/90) +28.9%
Average Metric Score 46.0% 98.6% (355/360) +52.6%
Avg Turn Latency (Path A / Baseline) > 4,200 ms 214 ms (Path B: 1,450–2,800 ms) ~20x faster

*Baseline $S_{\text{sync}}$ evaluated across 74 applicable gameplay scenarios (7/74); 16 internal unit-trigger tests are N/A for a standalone single prompt.

Blind A/B Human Pilot Study (N = 6, playtest/)

Conducted with 6 participants across Casual, Tactician, and Veteran personas (10–25 min blind sessions, 5-point Likert scale):

HCI Dimension Baseline DUALPATH-CORE Delta / Primary Finding
Rule Reliability 1.00 3.50 +2.50 — Blocked Veteran prompt injections ("Sysadmin Root Key", "summon 100 hounds")
World Immersion 2.00 3.75 +1.75 — Clean separation of mechanical math and narrative prose
Narrative Adaptation 2.50 4.00 +1.50 — Dynamic response to valid tactical improvisation
Player Autonomy 3.00 4.00 +1.00 — Creative freedom within deterministic rule boundaries
Linguistic Interest 3.00 4.00 +1.00 — Task-calibrated Narrator (T=0.7)
System Consistency 4.50 4.50 0.00 — Maintained parity while enforcing rules
Ease of Control 4.50 3.50 -1.00 — Minor syntax friction from strict Pass-1 regex room navigation

Quick Start

Prerequisites

  • Python 3.10+
  • A Google Gemini API key (GEMINI_API_KEY)

Installation & Run

  1. Clone the repository

    git clone https://github.com/mudmini009/DualPath-Core-TTRPG-engine.git
    cd DualPath-Core-TTRPG-engine
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment & settings

    • Create .env in the repository root (or enter the key when prompted at startup):
      GEMINI_API_KEY=your_api_key_here
    • Runtime settings live in data/config/settings.json (arbiter_model, narrator_model, temperatures, max_combat_events, max_story_events, fuzzy_match_cutoff, smart_exploration_router, debug_mode).
  4. Launch the game

    python main.py
  5. Run the unit test suite (tests/)

    pytest tests -q
  6. Run the 90-scenario evaluation suite (evaluation/system_suite/)

    python evaluation/system_suite/comprehensive_runner.py

Project Structure

DualPath-Core-TTRPG-engine/
├── main.py                         # CLI bootstrap, .env key check, startup wizard & loop launcher
├── requirements.txt                # Pinned Python dependencies
├── ARCHITECTURE.md                 # System architecture blueprint & module responsibilities
├── LITE_5E_RULES.md                # Tailored Lite 5e ruleset & tactical zone specification
├── FEATURE_TRACKER.md              # Feature roadmap & completion tracker
│
├── src/
│   ├── agents/                     # Specialized LLM agent wrappers
│   │   ├── base.py                 # BaseLLMProvider shared Gemini initialization
│   │   ├── arbiter_agent.py        # Creative action DC arbitration & item categorization
│   │   ├── campaign_agent.py       # Session prologue & campaign recap generation
│   │   ├── character_agent.py      # Bio-to-archetype profiling & world lore expansion
│   │   ├── narrator_agent.py       # Combat/outcome narration & Context Collapse summarizer
│   │   ├── quest_architect_agent.py    # Procedural quest concept generation
│   │   └── quest_cartographer_agent.py # Node-graph generation & schema checks
│   ├── engine/
│   │   ├── startup.py              # Campaign load/new-game flow, char creation & prologue setup
│   │   └── game_loop.py            # Hub, Exploration, and Turn-Based Combat loops
│   ├── logic/
│   │   ├── rules_engine.py         # Deterministic Path A attacks, checks, items, clamping
│   │   ├── combat_manager.py       # InitiativeQueue turn ordering
│   │   ├── dice_roller.py          # Dice expression parser (1d20, d8, modifiers)
│   │   ├── enemy_ai.py             # Stateless tactical enemy behavior
│   │   ├── enemy_factory.py        # Skeleton & Flesh proportional enemy scaling
│   │   ├── time_manager.py         # Short/Long Rest ability & recovery handling
│   │   └── abilities.py            # Reserved placeholder module for abilities expansion
│   ├── models/
│   │   ├── character.py            # Character, Stat, Zone, Condition, Ability dataclasses
│   │   ├── game_state.py           # GameState dataclass container
│   │   └── toon_converter.py       # Bidirectional TOON serialization / deserialization
│   ├── router/
│   │   ├── intent_router.py        # Combat Two-Pass intent classifier
│   │   ├── intents.py              # Fixed/Creative execution & difflib item matching
│   │   └── exploration_router.py   # Pass-1 Regex + Pass-2 LLM exploration router
│   ├── services/
│   │   ├── llm_service.py          # Backward-compatible facade over src/agents/*
│   │   ├── data_manager.py         # JSON campaign persistence & O(1) memory deques
│   │   ├── quest_loader.py         # Read-only point-crawl quest graph loader & BFS state helper
│   │   └── rag_service.py          # Reserved placeholder module for future RAG expansion
│   └── ui/
│       ├── menu.py                 # Interactive CLI menus & campaign selectors
│       ├── dashboard.py            # Combat HUD renderer
│       ├── exploration_ui.py       # Hub/Exploration node & exits renderer
│       └── character_sheet.py      # Character sheet & world lore terminal renderers
│
├── data/
│   ├── active/                     # Live campaign JSON, log & active world lore
│   ├── config/                     # settings.json, settings_backup.json & bestiary.json
│   ├── premade/                    # 4 premade characters & 4 lore presets
│   └── quests/                     # Point-crawl quest graphs & _fallback_template.json
│
├── docs/
│   ├── conference/                 # IEEE iSAI-NLP 2026 Paper #39 manuscript, reviews, slides & Q&A
│   ├── 65340500046_Poster.pdf      # FIBO senior project poster
│   ├── Thesis_Final.pdf            # FIBO senior defense slides
│   ├── อ.โซ่-อ.ปอ-AI DM-FinalSenior.pdf     # Senior thesis manuscript
│   └── รายงานการดำเนินงาน_DUALPATH_CORE.pdf  # Thai implementation report
│
├── diagrams/                       # Draw.io source flowcharts, module boundaries & UML class diagrams
├── evaluation/
│   ├── combat/                     # Combat evaluation runner, scenario suite & CSV runs
│   └── system_suite/               # 90-scenario master suite, comprehensive_runner & error analyzer
├── playtest/                       # 6 anonymized blind A/B human pilot playtest transcripts
├── tests/                          # 16 unit/integration test suites (pytest)
└── archive/                        # Legacy thesis proposals, references & Phase 2 demo artifacts

Citation

If you use DUALPATH-CORE or its 90-scenario evaluation benchmark in your research, please cite our IEEE iSAI-NLP 2026 paper:

@inproceedings{suttimala2026dualpath,
  author    = {Suttimala, Pollapaat and Natsupakpong, Suriya and Khanarsa, Paisit},
  title     = {{DUALPATH-CORE: A Multi-Agent Hybrid TTRPG Engine}},
  booktitle = {2026 21st International Joint Symposium on Artificial Intelligence and Natural Language Processing (iSAI-NLP)},
  year      = {2026},
  address   = {Bangkok, Thailand},
  note      = {Paper ID: 39}
}

Or cite the software repository directly:

@misc{suttimala2026dualpath_repo,
  author       = {Suttimala, Pollapaat and Natsupakpong, Suriya and Khanarsa, Paisit},
  title        = {{DualPath-Core-TTRPG-engine: Neuro-Symbolic Multi-Agent TTRPG Engine}},
  year         = {2026},
  publisher    = {GitHub},
  howpublished = {\url{https://github.com/mudmini009/DualPath-Core-TTRPG-engine}}
}

About

Multi-agent TTRPG engine using Two-Path Architecture to solve AI hallucinations. Combines a deterministic Python Rules Engine with LLM-based creative judgment. Verified with 100% Routing and 98% Grounding accuracy. Senior Thesis @ KMUTT FIBO.

Topics

artificial-intelligencedeterministic-enginedungeons-and-dragonsfibokmuttllmmulti-agent-systemspythonsenior-thesisttrpg

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.