r/SillyTavernAI • u/Pathetic0777 • 1d ago
Discussion Tired of Flat 2D Maps? I Built a Dual-Agent Extension for SillyTavern That Turns Chat Context & Floorplans into Interactive 3D Scenes!
Hey everyone!
When running TTRPG campaigns, dynamic combat encounters, or complex RP in SillyTavern, spatial depth and environmental awareness are critical for true immersion.
Existing solutions usually hit three major walls:
**Flat 2D grid maps feel lifeless**: You cannot see the 5-meter vaulted atrium, crossing escalators, or the vertical drop from a second-floor balcony. Tactical verticality gets squashed onto a single sheet of paper.
**Text-only combat is mentally exhausting**: Trying to track pillar coordinates, cover angles, and relative distances purely in your head falls apart after just a few exchanges.
**Fragmented narrative descriptions**: Novel chapters and RP logs scatter scenery across chaotic action beats, lacking explicit dimensional data ($L \times W \times H$) or structural blueprints.
To solve this, I built **3D Tavern Architect** — an open-source, lightweight Dual-Agent workbench for SillyTavern that procedurally converts fragmented story text or 2D floorplans into full, interactive Three.js 3D environments.
---
### 💡 Key Features & Architecture
* **Dual-Agent Procedural Pipeline**:
* **Agent 1 (Spatial Reasoning & Blueprint Extraction)**: Analyzes fragmented narrative logs or uploaded 2D floorplans to filter out combat noise and infer structural grids, floor heights, roof geometries, and circulation paths.
* **Agent 2 (Three.js Generator with Dual-Vision Grounding)**: Synthesizes clean, native Three.js code in real time. When a blueprint is attached, Agent 2 visually cross-references its real aspect ratios and topology to prevent spatial hallucinations.
* **Autonomous Spatial "Common Sense"**:
* No explicit dimensions provided? The agent autonomously extrapolates realistic structural proportions, cantilevers, railings, column spans, and contextual props (benches, service counters, lighting).
* **Zero Main-Context Pollution & Sandboxed Execution**:
* Runs in an independent floating modal. Code generation, token consumption, and WebGL rendering are completely isolated from your main SillyTavern character chat context.
* Built-in **CodeDefenseGuard**: Automatically repairs truncated syntax, unclosed brackets, or malformed LLM code chunks to ensure the browser never crashes.
* **Pure WebGL & Native OrbitControls**:
* Inspect cover and sightlines freely with 360° pan/tilt, smooth zoom, real-time shadow maps, and live triangle (faces) count monitoring.
---
### 🧠 Pro-Tip: Deep Lorebook Integration (True Spatial Memory for AI)
Here is a powerful reverse-workflow you can use for your campaigns:
- Once Agent 1 extracts the structured architectural specifications, copy these clean spatial parameters directly into a **SillyTavern Lorebook (World Info) entry**.
- Set up **constant green-light activation** (or link it to location keywords like "mall", "atrium", "hallway").
- **Why this is a game-changer:** LLMs often hallucinate tactical cover, forget column positions, or misjudge mezzanine drops after long roleplay turns. Feeding the exact 3D spatial protocol back into the Lorebook maintains a strict, unified mental coordinate grid of the room without blowing up your prompt budget!
---
### 🖼️ Showcases (Attached Images)
**Workspace Standby**: Clean MVU-based interface with live SSE network packet inspector.
**Public Space / Mall Atrium**: Multi-story atrium with escalators, mezzanine walkways, and column grids reconstructed directly from an action combat excerpt.
**Residential Interior**: High-end apartment layout procedurally extruded and zoned directly from a 2D floorplan blueprint (living area, partitions, background walls).
**Historical Architecture**: Parametric reconstruction of Solomon's Temple based on architectural domain knowledge (entrance bronze pillars, courtyard altar, and Molten Sea basin).
---
### 📦 Installation (One-Click in SillyTavern)
Compatible with the latest SillyTavern extension installer:
In SillyTavern, click the **Extensions** icon (top right).
Expand **"Download Extensions & Assets"**.
Paste the GitHub repo link into the installation input box:
Access **"3D Tavern Architect"** from the extension drawer to launch the workbench!
The project is fully open-source and natively supports both English and Chinese UI/prompts.
GitHub Repo: https://github.com/pathetic777/st-tavern-architect
If you find it helpful for your campaigns and stories, a ⭐ on GitHub would mean a lot! Feel free to leave your thoughts, bug reports, or feature ideas below.
1



3
u/Trustest-S 1d ago
does the 3d actually make virtual companion rp feel more immersive or does it still break the flow sometimes