# krayoristine/ozzyproject architecture

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

- Interactive diagram: https://gitdiagram.com/krayoristine/ozzyproject
- Repository: https://github.com/krayoristine/ozzyproject

## Overview

This repository is the TypeScript source for a Warcraft III custom map, compiled to Lua, with gameplay modules and an embedded compiler/tooling codebase. The principal workflow is map startup through the game entry point into runtime modules; supporting branches include gameplay utilities, persistence, compiler transforms, Lua parsing/minification, and model viewing. Several relationships are documented only by README or SOURCE INDEX references; uncertain wiring is omitted rather than inferred.

Main entry points: [`compiler/mdx-m3/viewer/viewer.ts`](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/viewer.ts) (Model viewer), [`src/game.ts`](https://github.com/krayoristine/ozzyproject/blob/main/src/game.ts) (Game entry), [`compiler/mdx-m3/viewer/handlers/mdx/handler.ts`](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/handlers/mdx/handler.ts) (MDX handler), [`compiler/luamin/luamin.ts`](https://github.com/krayoristine/ozzyproject/blob/main/compiler/luamin/luamin.ts) (Lua minifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Map runtime"]
  node_game["Game entry<br/>[game.ts]"]
  node_core["Core runtime<br/>[core.ts]"]
  node_modules["Module registry<br/>[index.ts]"]
  node_shared["Shared utilities<br/>[util.ts]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_asyncmouse["Async mouse<br/>[asyncMouse.ts]"]
  node_tooltip["Live tooltip<br/>[livetooltip.ts]"]
  node_periodic["Periodic tasks<br/>[periodic.ts]"]
  node_save["Save/load<br/>[save.ts]"]
  node_encoder["Save encoder<br/>[encoder.ts]"]
  node_decoder["Save decoder<br/>[decoder.ts]"]
  node_math["Gameplay math<br/>[math.ts]"]
  node_random["Random helpers<br/>[random.ts]"]
end

subgraph group_compiler["Lua compiler"]
  node_transform["Lua transforms<br/>[transformer.ts]"]
  node_objectdata["Warcraft object data<br/>[objectData.ts]"]
  node_parser["Lua parser<br/>[luaparse.ts]"]
  node_ast["Lua AST<br/>[ast.ts]"]
  node_minifier["Lua minifier<br/>[luamin.ts]"]
end

subgraph group_viewer["Model viewer"]
  node_viewer["Model viewer<br/>[viewer.ts]"]
  node_mdxhandler["MDX handler<br/>[handler.ts]"]
  node_mdxmodel["MDX model resource<br/>[model.ts]"]
  node_mdlxparser["MDLX parser<br/>[model.ts]"]
  node_resource["Viewer resources<br/>[resource.ts]"]
  node_webgl["WebGL layer<br/>[gl.ts]"]
end

node_player(("Map player"))

node_player -.->|"starts map"| node_game
node_game -->|"imports"| node_modules
node_game -->|"uses"| node_shared
node_tooltip -->|"uses"| node_periodic
node_math -->|"uses"| node_random
node_transform -->|"imports"| node_objectdata
node_minifier -.->|"parses Lua"| node_parser
node_minifier -->|"uses AST"| node_ast
node_parser -->|"builds AST"| node_ast
node_viewer -->|"creates context"| node_webgl
node_viewer -->|"loads resources"| node_resource
node_viewer -.->|"dispatches format"| node_mdxhandler
node_mdxhandler -->|"parses models"| node_mdlxparser
node_mdxhandler -->|"creates resource"| node_mdxmodel

click node_game "https://github.com/krayoristine/ozzyproject/blob/main/src/game.ts"
click node_core "https://github.com/krayoristine/ozzyproject/blob/main/src/core.ts"
click node_modules "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/index.ts"
click node_shared "https://github.com/krayoristine/ozzyproject/blob/main/src/shared/util.ts"
click node_asyncmouse "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/asyncMouse.ts"
click node_tooltip "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/livetooltip.ts"
click node_periodic "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/periodic.ts"
click node_save "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/save.ts"
click node_encoder "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/encoder.ts"
click node_decoder "https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/decoder.ts"
click node_math "https://github.com/krayoristine/ozzyproject/blob/main/src/shared/math.ts"
click node_random "https://github.com/krayoristine/ozzyproject/blob/main/src/shared/random.ts"
click node_transform "https://github.com/krayoristine/ozzyproject/blob/main/compiler/transformer.ts"
click node_objectdata "https://github.com/krayoristine/ozzyproject/blob/main/compiler/objectData.ts"
click node_parser "https://github.com/krayoristine/ozzyproject/blob/main/compiler/luaparse/luaparse.ts"
click node_ast "https://github.com/krayoristine/ozzyproject/blob/main/compiler/luaparse/ast.ts"
click node_minifier "https://github.com/krayoristine/ozzyproject/blob/main/compiler/luamin/luamin.ts"
click node_viewer "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/viewer.ts"
click node_mdxhandler "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/handlers/mdx/handler.ts"
click node_mdxmodel "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/handlers/mdx/model.ts"
click node_mdlxparser "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/parsers/mdlx/model.ts"
click node_resource "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/resource.ts"
click node_webgl "https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/gl/gl.ts"

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_game,node_core,node_modules,node_shared toneBlue
class node_asyncmouse,node_tooltip,node_periodic,node_save,node_encoder,node_decoder,node_math,node_random toneAmber
class node_transform,node_objectdata,node_parser,node_ast,node_minifier toneMint
class node_viewer,node_mdxhandler,node_mdxmodel,node_mdlxparser,node_resource,node_webgl toneRose
class node_player toneIndigo
```

## Components

### Map runtime

- [Game entry](https://github.com/krayoristine/ozzyproject/blob/main/src/game.ts): `src/game.ts`
- [Core runtime](https://github.com/krayoristine/ozzyproject/blob/main/src/core.ts): `src/core.ts`
- [Module registry](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/index.ts): `src/modules/index.ts`
- [Shared utilities](https://github.com/krayoristine/ozzyproject/blob/main/src/shared/util.ts): `src/shared/util.ts`

### Gameplay systems

- [Async mouse](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/asyncMouse.ts): `src/modules/asyncMouse.ts`
- [Live tooltip](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/livetooltip.ts): `src/modules/livetooltip.ts`
- [Periodic tasks](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/periodic.ts): `src/modules/periodic.ts`
- [Save/load](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/save.ts): `src/modules/saveload/save.ts`
- [Save encoder](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/encoder.ts): `src/modules/saveload/encoder.ts`
- [Save decoder](https://github.com/krayoristine/ozzyproject/blob/main/src/modules/saveload/decoder.ts): `src/modules/saveload/decoder.ts`
- [Gameplay math](https://github.com/krayoristine/ozzyproject/blob/main/src/shared/math.ts): `src/shared/math.ts`
- [Random helpers](https://github.com/krayoristine/ozzyproject/blob/main/src/shared/random.ts): `src/shared/random.ts`

### Lua compiler

- [Lua transforms](https://github.com/krayoristine/ozzyproject/blob/main/compiler/transformer.ts): `compiler/transformer.ts`
- [Warcraft object data](https://github.com/krayoristine/ozzyproject/blob/main/compiler/objectData.ts): `compiler/objectData.ts`
- [Lua parser](https://github.com/krayoristine/ozzyproject/blob/main/compiler/luaparse/luaparse.ts): `compiler/luaparse/luaparse.ts`
- [Lua AST](https://github.com/krayoristine/ozzyproject/blob/main/compiler/luaparse/ast.ts): `compiler/luaparse/ast.ts`
- [Lua minifier](https://github.com/krayoristine/ozzyproject/blob/main/compiler/luamin/luamin.ts): `compiler/luamin/luamin.ts`

### Model viewer

- [Model viewer](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/viewer.ts): `compiler/mdx-m3/viewer/viewer.ts`
- [MDX handler](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/handlers/mdx/handler.ts): `compiler/mdx-m3/viewer/handlers/mdx/handler.ts`
- [MDX model resource](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/handlers/mdx/model.ts): `compiler/mdx-m3/viewer/handlers/mdx/model.ts`
- [MDLX parser](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/parsers/mdlx/model.ts): `compiler/mdx-m3/parsers/mdlx/model.ts`
- [Viewer resources](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/resource.ts): `compiler/mdx-m3/viewer/resource.ts`
- [WebGL layer](https://github.com/krayoristine/ozzyproject/blob/main/compiler/mdx-m3/viewer/gl/gl.ts): `compiler/mdx-m3/viewer/gl/gl.ts`

### Other components

- **Map player**

## Connections

- Map player → Game entry: starts map
- Game entry → Module registry: imports (evidence: `src/game.ts`)
- Game entry → Shared utilities: uses (evidence: `src/game.ts`)
- Live tooltip → Periodic tasks: uses (evidence: `src/modules/livetooltip.ts`)
- Gameplay math → Random helpers: uses (evidence: `src/shared/math.ts`)
- Lua transforms → Warcraft object data: imports (evidence: `compiler/transformer.ts`)
- Lua minifier → Lua parser: parses Lua (evidence: `compiler/luamin/luamin.ts`)
- Lua minifier → Lua AST: uses AST (evidence: `compiler/luamin/luamin.ts`)
- Lua parser → Lua AST: builds AST (evidence: `compiler/luaparse/luaparse.ts`)
- Model viewer → WebGL layer: creates context (evidence: `compiler/mdx-m3/viewer/viewer.ts`)
- Model viewer → Viewer resources: loads resources (evidence: `compiler/mdx-m3/viewer/viewer.ts`)
- Model viewer → MDX handler: dispatches format (evidence: `compiler/mdx-m3/viewer/handlers/mdx/handler.ts`)
- MDX handler → MDLX parser: parses models (evidence: `compiler/mdx-m3/viewer/handlers/mdx/handler.ts`)
- MDX handler → MDX model resource: creates resource (evidence: `compiler/mdx-m3/viewer/handlers/mdx/handler.ts`)
