# wcsbrintel/ayla architecture

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

- Interactive diagram: https://gitdiagram.com/wcsbrintel/ayla
- Repository: https://github.com/wcsbrintel/ayla

## Overview

AYLA is a browser-based wildlife-crime investigation experience: the player enters a 3D operations center, works through five staged case investigations, and saves progress locally. It also includes a separately saved arcade game and an access-controlled Observatory. The graph preserves the documented character, ambient-conversation, audio, and investigation features. Some integration code was not sampled, so uncertain links are omitted; README-documented integrations are cited to the README.

Main entry points: [`game.js`](https://github.com/wcsbrintel/ayla/blob/main/game.js) (Investigation runtime), [`crowd-v9.js`](https://github.com/wcsbrintel/ayla/blob/main/crowd-v9.js) (Ambient conversations), [`index.html`](https://github.com/wcsbrintel/ayla/blob/main/index.html) (Game interface), [`room-v8.js`](https://github.com/wcsbrintel/ayla/blob/main/room-v8.js) (Operations room)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Investigation experience"]
  node_entry["Game interface<br/>[index.html]"]
  node_runtime["Investigation runtime<br/>[game.js]"]
  node_progress[("Mission progress<br/>[missions-v2.js]")]
end

subgraph group_cases["Case investigations"]
  node_mission3["Mission 3<br/>[mission3.js]"]
  node_mission4["Mission 4<br/>[mission4.js]"]
  node_mission5["Mission 5<br/>[mission5.js]"]
  node_missionlibrary["Mission library<br/>[missions-v2.js]"]
end

subgraph group_world["3D operations center"]
  node_room["Operations room<br/>[room-v8.js]"]
  node_furniture["Room furniture<br/>[furniture-v10.js]"]
  node_characters["Procedural characters<br/>[characters-v4.js]"]
  node_realistic["Realistic avatars"]
  node_crowd["Ambient conversations<br/>[crowd-v9.js]"]
  node_dialogues["Dialogue content"]
  node_navigation["Character navigation<br/>[navigation-v8.js]"]
  node_audio["Soundtrack<br/>[audio-v9.js]"]
end

subgraph group_extras["Arcade and Observatory"]
  node_pecman["PEC MAN<br/>[pec-man.js]"]
  node_restricted["Restricted Observatory"]
end

node_player(("Player"))
node_firebase[("Firebase Auth and Firestore")]

node_player -->|"opens"| node_entry
node_entry -.->|"starts"| node_runtime
node_runtime -->|"checks unlocks"| node_progress
node_runtime -->|"opens arcade"| node_pecman
node_runtime -->|"opens restricted area"| node_restricted
node_restricted -->|"authenticates and queries"| node_firebase
node_missionlibrary -->|"persists state"| node_progress
node_runtime -.->|"presents case"| node_mission3
node_runtime -.->|"presents case"| node_mission4
node_runtime -.->|"presents case"| node_mission5
node_runtime -.->|"runs in"| node_room
node_runtime -.->|"uses characters"| node_characters
node_runtime -.->|"loads avatars"| node_realistic
node_crowd -.->|"selects dialogue"| node_dialogues
node_crowd -.->|"moves actors"| node_navigation
node_runtime -.->|"controls soundtrack"| node_audio
node_room -.->|"includes furnishings"| node_furniture

click node_entry "https://github.com/wcsbrintel/ayla/blob/main/index.html"
click node_runtime "https://github.com/wcsbrintel/ayla/blob/main/game.js"
click node_progress "https://github.com/wcsbrintel/ayla/blob/main/missions-v2.js"
click node_mission3 "https://github.com/wcsbrintel/ayla/blob/main/mission3.js"
click node_mission4 "https://github.com/wcsbrintel/ayla/blob/main/mission4.js"
click node_mission5 "https://github.com/wcsbrintel/ayla/blob/main/mission5.js"
click node_missionlibrary "https://github.com/wcsbrintel/ayla/blob/main/missions-v2.js"
click node_room "https://github.com/wcsbrintel/ayla/blob/main/room-v8.js"
click node_furniture "https://github.com/wcsbrintel/ayla/blob/main/furniture-v10.js"
click node_characters "https://github.com/wcsbrintel/ayla/blob/main/characters-v4.js"
click node_realistic "https://github.com/wcsbrintel/ayla/blob/main/realistic-actors-v7.js"
click node_crowd "https://github.com/wcsbrintel/ayla/blob/main/crowd-v9.js"
click node_dialogues "https://github.com/wcsbrintel/ayla/blob/main/clara-theo-dialogues.js"
click node_navigation "https://github.com/wcsbrintel/ayla/blob/main/navigation-v8.js"
click node_audio "https://github.com/wcsbrintel/ayla/blob/main/audio-v9.js"
click node_pecman "https://github.com/wcsbrintel/ayla/blob/main/pec-man.js"
click node_restricted "https://github.com/wcsbrintel/ayla/blob/main/restricted-terminal.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_entry,node_runtime,node_progress toneBlue
class node_mission3,node_mission4,node_mission5,node_missionlibrary,node_firebase toneAmber
class node_room,node_furniture,node_characters,node_realistic,node_crowd,node_dialogues,node_navigation,node_audio toneMint
class node_pecman,node_restricted toneRose
class node_player toneIndigo
```

## Components

### Investigation experience

- [Game interface](https://github.com/wcsbrintel/ayla/blob/main/index.html): `index.html`
- [Investigation runtime](https://github.com/wcsbrintel/ayla/blob/main/game.js): `game.js`
- [Mission progress](https://github.com/wcsbrintel/ayla/blob/main/missions-v2.js): `missions-v2.js`

### Case investigations

- [Mission 3](https://github.com/wcsbrintel/ayla/blob/main/mission3.js): `mission3.js`
- [Mission 4](https://github.com/wcsbrintel/ayla/blob/main/mission4.js): `mission4.js`
- [Mission 5](https://github.com/wcsbrintel/ayla/blob/main/mission5.js): `mission5.js`
- [Mission library](https://github.com/wcsbrintel/ayla/blob/main/missions-v2.js): `missions-v2.js`

### 3D operations center

- [Operations room](https://github.com/wcsbrintel/ayla/blob/main/room-v8.js): `room-v8.js`
- [Room furniture](https://github.com/wcsbrintel/ayla/blob/main/furniture-v10.js): `furniture-v10.js`
- [Procedural characters](https://github.com/wcsbrintel/ayla/blob/main/characters-v4.js): `characters-v4.js`
- [Realistic avatars](https://github.com/wcsbrintel/ayla/blob/main/realistic-actors-v7.js): `realistic-actors-v7.js`
- [Ambient conversations](https://github.com/wcsbrintel/ayla/blob/main/crowd-v9.js): `crowd-v9.js`
- [Dialogue content](https://github.com/wcsbrintel/ayla/blob/main/clara-theo-dialogues.js): `clara-theo-dialogues.js`
- [Character navigation](https://github.com/wcsbrintel/ayla/blob/main/navigation-v8.js): `navigation-v8.js`
- [Soundtrack](https://github.com/wcsbrintel/ayla/blob/main/audio-v9.js): `audio-v9.js`

### Arcade and Observatory

- [PEC MAN](https://github.com/wcsbrintel/ayla/blob/main/pec-man.js): `pec-man.js`
- [Restricted Observatory](https://github.com/wcsbrintel/ayla/blob/main/restricted-terminal.js): `restricted-terminal.js`

### Other components

- **Player**
- **Firebase Auth and Firestore**

## Connections

- Player → Game interface: opens (evidence: `README.md`)
- Game interface → Investigation runtime: starts
- Investigation runtime → Mission progress: checks unlocks (evidence: `game.js`)
- Investigation runtime → PEC MAN: opens arcade (evidence: `README.md`)
- Investigation runtime → Restricted Observatory: opens restricted area (evidence: `README.md`)
- Restricted Observatory → Firebase Auth and Firestore: authenticates and queries (evidence: `restricted-terminal.js`)
- Mission library → Mission progress: persists state (evidence: `missions-v2.js`)
- Investigation runtime → Mission 3: presents case
- Investigation runtime → Mission 4: presents case
- Investigation runtime → Mission 5: presents case
- Investigation runtime → Operations room: runs in
- Investigation runtime → Procedural characters: uses characters
- Investigation runtime → Realistic avatars: loads avatars
- Ambient conversations → Dialogue content: selects dialogue
- Ambient conversations → Character navigation: moves actors
- Investigation runtime → Soundtrack: controls soundtrack
- Operations room → Room furniture: includes furnishings
