# louisjham/bardstalevrnew architecture

> Architecture diagram of the GitHub repository louisjham/bardstalevrnew, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/louisjham/bardstalevrnew
- Repository: https://github.com/louisjham/bardstalevrnew
- Video tour (about a minute): https://gitdiagram.com/louisjham/bardstalevrnew/video

## Overview

The Bard’s Tale VR is a Three.js/WebXR role-playing game whose player journey moves from a retro-computer intro into the tavern, party outfitting, Skara Brae exploration, combat, and town services. `src/main.js` coordinates scene/state transitions and connects input, world time, and game systems. Combat, advancement, and service systems supply the RPG rules; UI and spatial interfaces expose them. The README documents several product capabilities whose internal wiring is not established by the sampled source, so those are shown as capabilities without speculative links.

Main entry points: [`src/main.js`](https://github.com/louisjham/bardstalevrnew/blob/main/src/main.js) (Game Coordinator), [`src/world/skara-brae/SkaraBraeStreetScene.js`](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/skara-brae/SkaraBraeStreetScene.js) (Skara Brae), [`src/world/FullVRTavern.js`](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/FullVRTavern.js) (Tavern), [`src/world/garths-shop/GarthsShop.js`](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/garths-shop/GarthsShop.js) (Garth’s Shop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["World Experience"]
  node_app["Game Coordinator<br/>[main.js]"]
  node_retro["Retro Intro<br/>[RetroRoom.js]"]
  node_tavern["Tavern<br/>[FullVRTavern.js]"]
  node_shop["Garth’s Shop<br/>[GarthsShop.js]"]
  node_city["Skara Brae"]
  node_grid["City Grid<br/>[SkaraBraeGrid.js]"]
  node_arena["Combat Arena<br/>[CombatArena.js]"]
  node_bard["Bard Audio<br/>[BardSinger.js]"]
end

subgraph group_gameplay["RPG Systems"]
  node_combat["Combat Rules<br/>[CombatEngine.js]"]
  node_encounters["Encounter Generation"]
  node_monsters["Monster Data<br/>[MonsterDatabase.js]"]
  node_spells["Spell Compendium<br/>[SpellDatabase.js]"]
  node_items["Shop Inventory<br/>[ItemDatabase.js]"]
  node_time["World Clock<br/>[WorldTimeEngine.js]"]
  node_review["Advancement Rules"]
end

subgraph group_interfaces["Player Interfaces"]
  node_book["Grimoire<br/>[PalmBookMenu.js]"]
  node_reviewui["Review Board UI<br/>[ReviewBoardUI.js]"]
  node_temple["Temple Services<br/>[TempleUI.js]"]
  node_roscoe["Roscoe’s Emporium<br/>[RoscoeUI.js]"]
end

subgraph group_platform["XR Platform"]
  node_xr["XR Manager<br/>[XRManager.js]"]
  node_rig["XR Rig<br/>[XRRig.js]"]
  node_locomotion["Locomotion<br/>[FreeLocomotion.js]"]
end

node_player(("Player"))

node_player -->|"plays"| node_app
node_app -->|"starts intro"| node_retro
node_app -->|"transitions to"| node_tavern
node_app -->|"opens"| node_shop
node_app -->|"enters"| node_city
node_app -->|"opens combat"| node_arena
node_app -->|"references"| node_grid
node_tavern -->|"plays performance"| node_bard
node_city -->|"uses map"| node_grid
node_city -->|"requests encounters"| node_encounters
node_encounters -->|"reads bestiary"| node_monsters
node_arena -->|"runs turns"| node_combat
node_combat -->|"looks up spells"| node_spells
node_shop -->|"uses inventory"| node_items
node_app -->|"updates clock"| node_time
node_app -->|"controls grimoire"| node_book
node_app -->|"opens board"| node_reviewui
node_reviewui -->|"queries advancement"| node_review
node_app -->|"opens services"| node_temple
node_app -->|"opens emporium"| node_roscoe
node_app -->|"initializes XR"| node_xr
node_app -->|"creates rig"| node_rig
node_app -->|"creates locomotion"| node_locomotion
node_locomotion -->|"uses XR manager"| node_xr

click node_app "https://github.com/louisjham/bardstalevrnew/blob/main/src/main.js"
click node_retro "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/retro-room/RetroRoom.js"
click node_tavern "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/FullVRTavern.js"
click node_shop "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/garths-shop/GarthsShop.js"
click node_city "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/skara-brae/SkaraBraeStreetScene.js"
click node_grid "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/skara-brae/SkaraBraeGrid.js"
click node_arena "https://github.com/louisjham/bardstalevrnew/blob/main/src/world/combat-zone/CombatArena.js"
click node_combat "https://github.com/louisjham/bardstalevrnew/blob/main/src/core/combat/CombatEngine.js"
click node_encounters "https://github.com/louisjham/bardstalevrnew/blob/main/src/core/encounter/EncounterGenerator.js"
click node_monsters "https://github.com/louisjham/bardstalevrnew/blob/main/src/data/MonsterDatabase.js"
click node_spells "https://github.com/louisjham/bardstalevrnew/blob/main/src/data/SpellDatabase.js"
click node_items "https://github.com/louisjham/bardstalevrnew/blob/main/src/data/ItemDatabase.js"
click node_time "https://github.com/louisjham/bardstalevrnew/blob/main/src/core/time/WorldTimeEngine.js"
click node_review "https://github.com/louisjham/bardstalevrnew/blob/main/src/core/review-board/ReviewBoardEngine.js"
click node_book "https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/spatial-hud/PalmBookMenu.js"
click node_reviewui "https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/ReviewBoardUI.js"
click node_temple "https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/TempleUI.js"
click node_roscoe "https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/RoscoeUI.js"
click node_xr "https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/XRManager.js"
click node_rig "https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/XRRig.js"
click node_locomotion "https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/FreeLocomotion.js"
click node_bard "https://github.com/louisjham/bardstalevrnew/blob/main/src/audio/BardSinger.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_retro,node_tavern,node_shop,node_city,node_grid,node_arena,node_bard toneBlue
class node_combat,node_encounters,node_monsters,node_spells,node_items,node_time,node_review toneAmber
class node_book,node_reviewui,node_temple,node_roscoe toneMint
class node_xr,node_rig,node_locomotion toneRose
class node_player toneIndigo
```

## Components

### World Experience

- [Game Coordinator](https://github.com/louisjham/bardstalevrnew/blob/main/src/main.js): `src/main.js`
- [Retro Intro](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/retro-room/RetroRoom.js): `src/world/retro-room/RetroRoom.js`
- [Tavern](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/FullVRTavern.js): `src/world/FullVRTavern.js`
- [Garth’s Shop](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/garths-shop/GarthsShop.js): `src/world/garths-shop/GarthsShop.js`
- [Skara Brae](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/skara-brae/SkaraBraeStreetScene.js): `src/world/skara-brae/SkaraBraeStreetScene.js`
- [City Grid](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/skara-brae/SkaraBraeGrid.js): `src/world/skara-brae/SkaraBraeGrid.js`
- [Combat Arena](https://github.com/louisjham/bardstalevrnew/blob/main/src/world/combat-zone/CombatArena.js): `src/world/combat-zone/CombatArena.js`
- [Bard Audio](https://github.com/louisjham/bardstalevrnew/blob/main/src/audio/BardSinger.js): `src/audio/BardSinger.js`

### RPG Systems

- [Combat Rules](https://github.com/louisjham/bardstalevrnew/blob/main/src/core/combat/CombatEngine.js): `src/core/combat/CombatEngine.js`
- [Encounter Generation](https://github.com/louisjham/bardstalevrnew/blob/main/src/core/encounter/EncounterGenerator.js): `src/core/encounter/EncounterGenerator.js`
- [Monster Data](https://github.com/louisjham/bardstalevrnew/blob/main/src/data/MonsterDatabase.js): `src/data/MonsterDatabase.js`
- [Spell Compendium](https://github.com/louisjham/bardstalevrnew/blob/main/src/data/SpellDatabase.js): `src/data/SpellDatabase.js`
- [Shop Inventory](https://github.com/louisjham/bardstalevrnew/blob/main/src/data/ItemDatabase.js): `src/data/ItemDatabase.js`
- [World Clock](https://github.com/louisjham/bardstalevrnew/blob/main/src/core/time/WorldTimeEngine.js): `src/core/time/WorldTimeEngine.js`
- [Advancement Rules](https://github.com/louisjham/bardstalevrnew/blob/main/src/core/review-board/ReviewBoardEngine.js): `src/core/review-board/ReviewBoardEngine.js`

### Player Interfaces

- [Grimoire](https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/spatial-hud/PalmBookMenu.js): `src/ui/spatial-hud/PalmBookMenu.js`
- [Review Board UI](https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/ReviewBoardUI.js): `src/ui/ReviewBoardUI.js`
- [Temple Services](https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/TempleUI.js): `src/ui/TempleUI.js`
- [Roscoe’s Emporium](https://github.com/louisjham/bardstalevrnew/blob/main/src/ui/RoscoeUI.js): `src/ui/RoscoeUI.js`

### XR Platform

- [XR Manager](https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/XRManager.js): `src/xr/XRManager.js`
- [XR Rig](https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/XRRig.js): `src/xr/XRRig.js`
- [Locomotion](https://github.com/louisjham/bardstalevrnew/blob/main/src/xr/FreeLocomotion.js): `src/xr/FreeLocomotion.js`

### Other components

- **Player**

## Connections

- Player → Game Coordinator: plays
- Game Coordinator → Retro Intro: starts intro
- Game Coordinator → Tavern: transitions to
- Game Coordinator → Garth’s Shop: opens
- Game Coordinator → Skara Brae: enters
- Game Coordinator → Combat Arena: opens combat
- Game Coordinator → City Grid: references
- Tavern → Bard Audio: plays performance
- Skara Brae → City Grid: uses map
- Skara Brae → Encounter Generation: requests encounters
- Encounter Generation → Monster Data: reads bestiary
- Combat Arena → Combat Rules: runs turns
- Combat Rules → Spell Compendium: looks up spells
- Garth’s Shop → Shop Inventory: uses inventory
- Game Coordinator → World Clock: updates clock
- Game Coordinator → Grimoire: controls grimoire
- Game Coordinator → Review Board UI: opens board
- Review Board UI → Advancement Rules: queries advancement
- Game Coordinator → Temple Services: opens services
- Game Coordinator → Roscoe’s Emporium: opens emporium
- Game Coordinator → XR Manager: initializes XR
- Game Coordinator → XR Rig: creates rig
- Game Coordinator → Locomotion: creates locomotion
- Locomotion → XR Manager: uses XR manager
