# ss220-space/paradise architecture

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

- Interactive diagram: https://gitdiagram.com/ss220-space/paradise
- Repository: https://github.com/ss220-space/paradise

## Overview

Paradise is a BYOND-based multiplayer game repository with a TypeScript game UI and Rust support modules. The visible user workflow is an interface selected by the UI router, where player actions use the backend bridge to communicate with BYOND. The Rust side includes map manipulation, icon processing, simulation, and utility capabilities. The supplied excerpts show only selected frontend and map-manipulation relationships; other Rust modules are grouped by their known responsibilities without inferred call chains.

Main entry points: [`tgui/packages/tgui/backend.ts`](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/backend.ts) (UI backend), [`rust/src/mapmanip/mod.rs`](https://github.com/ss220-space/paradise/blob/master220/rust/src/mapmanip/mod.rs) (Map manipulation), [`tgui/packages/tgui/interfaces/SecureStorage.tsx`](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/interfaces/SecureStorage.tsx) (Secure storage UI), [`tgui/packages/tgui/routes.tsx`](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/routes.tsx) (Interface router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Game interface"]
  node_router["Interface router<br/>[routes.tsx]"]
  node_interfaces["Game interfaces"]
  node_secure["Secure storage UI<br/>[SecureStorage.tsx]"]
  node_backend["UI backend<br/>[backend.ts]"]
  node_actions["Action dispatch<br/>[act.ts]"]
end

subgraph group_maps["Map processing"]
  node_mapmanip["Map manipulation<br/>[mod.rs]"]
  node_mapcore["Map conversion"]
  node_mapproc["Map generation"]
  node_submaps["Submap tools"]
end

subgraph group_rust["Rust capabilities"]
  node_iconforge["Icon processing<br/>[icon_operations.rs]"]
  node_iconblend["Image blending<br/>[blending.rs]"]
  node_iconcache[("Image cache<br/>[image_cache.rs]")]
  node_spritesheet["Spritesheets<br/>[spritesheet.rs]"]
  node_caves["Cave generation<br/>[layout.rs]"]
  node_millaapi["Milla API<br/>[api.rs]"]
  node_millamodel["Milla model<br/>[model.rs]"]
  node_millasim["Milla simulation<br/>[simulate.rs]"]
  node_millatick["Milla tick<br/>[tick.rs]"]
end

subgraph group_support["Game support"]
end

node_player(("Player"))
node_byond(("BYOND runtime"))

node_player -->|"opens UI"| node_router
node_router -->|"loads interface"| node_interfaces
node_secure -->|"reads state"| node_backend
node_secure -->|"sends actions"| node_backend
node_backend -->|"dispatches via"| node_actions
node_backend -->|"sends messages"| node_byond
node_mapmanip -->|"invokes generation"| node_mapproc
node_mapmanip -->|"uses submap tools"| node_submaps
node_mapmanip -->|"calls runtime"| node_byond

click node_router "https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/routes.tsx"
click node_interfaces "https://github.com/ss220-space/paradise/tree/master220/tgui/packages/tgui/interfaces"
click node_secure "https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/interfaces/SecureStorage.tsx"
click node_backend "https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/backend.ts"
click node_actions "https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/events/act.ts"
click node_mapmanip "https://github.com/ss220-space/paradise/blob/master220/rust/src/mapmanip/mod.rs"
click node_mapcore "https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/core"
click node_mapproc "https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/procgen"
click node_submaps "https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/tools"
click node_iconforge "https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/icon_operations.rs"
click node_iconblend "https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/blending.rs"
click node_iconcache "https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/image_cache.rs"
click node_spritesheet "https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/spritesheet.rs"
click node_caves "https://github.com/ss220-space/paradise/blob/master220/rust/src/cave_system_generator/layout.rs"
click node_millaapi "https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/api.rs"
click node_millamodel "https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/model.rs"
click node_millasim "https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/simulate.rs"
click node_millatick "https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/tick.rs"

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_router,node_interfaces,node_secure,node_backend,node_actions toneBlue
class node_mapmanip,node_mapcore,node_mapproc,node_submaps toneAmber
class node_iconforge,node_iconblend,node_iconcache,node_spritesheet,node_caves,node_millaapi,node_millamodel,node_millasim,node_millatick toneMint
class node_player,node_byond toneIndigo
```

## Components

### Game interface

- [Interface router](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/routes.tsx): `tgui/packages/tgui/routes.tsx`
- [Game interfaces](https://github.com/ss220-space/paradise/tree/master220/tgui/packages/tgui/interfaces): `tgui/packages/tgui/interfaces`
- [Secure storage UI](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/interfaces/SecureStorage.tsx): `tgui/packages/tgui/interfaces/SecureStorage.tsx`
- [UI backend](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/backend.ts): `tgui/packages/tgui/backend.ts`
- [Action dispatch](https://github.com/ss220-space/paradise/blob/master220/tgui/packages/tgui/events/act.ts): `tgui/packages/tgui/events/act.ts`

### Map processing

- [Map manipulation](https://github.com/ss220-space/paradise/blob/master220/rust/src/mapmanip/mod.rs): `rust/src/mapmanip/mod.rs`
- [Map conversion](https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/core): `rust/src/mapmanip/core`
- [Map generation](https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/procgen): `rust/src/mapmanip/procgen`
- [Submap tools](https://github.com/ss220-space/paradise/tree/master220/rust/src/mapmanip/tools): `rust/src/mapmanip/tools`

### Rust capabilities

- [Icon processing](https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/icon_operations.rs): `rust/src/iconforge/icon_operations.rs`
- [Image blending](https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/blending.rs): `rust/src/iconforge/blending.rs`
- [Image cache](https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/image_cache.rs): `rust/src/iconforge/image_cache.rs`
- [Spritesheets](https://github.com/ss220-space/paradise/blob/master220/rust/src/iconforge/spritesheet.rs): `rust/src/iconforge/spritesheet.rs`
- [Cave generation](https://github.com/ss220-space/paradise/blob/master220/rust/src/cave_system_generator/layout.rs): `rust/src/cave_system_generator/layout.rs`
- [Milla API](https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/api.rs): `rust/src/milla/api.rs`
- [Milla model](https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/model.rs): `rust/src/milla/model.rs`
- [Milla simulation](https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/simulate.rs): `rust/src/milla/simulate.rs`
- [Milla tick](https://github.com/ss220-space/paradise/blob/master220/rust/src/milla/tick.rs): `rust/src/milla/tick.rs`

### Other components

- **Player**
- **BYOND runtime**

## Connections

- Player → Interface router: opens UI (evidence: `tgui/packages/tgui/routes.tsx`)
- Interface router → Game interfaces: loads interface (evidence: `tgui/packages/tgui/routes.tsx`)
- Secure storage UI → UI backend: reads state (evidence: `tgui/packages/tgui/interfaces/SecureStorage.tsx`)
- Secure storage UI → UI backend: sends actions (evidence: `tgui/packages/tgui/interfaces/SecureStorage.tsx`)
- UI backend → Action dispatch: dispatches via (evidence: `tgui/packages/tgui/backend.ts`)
- UI backend → BYOND runtime: sends messages (evidence: `tgui/packages/tgui/backend.ts`)
- Map manipulation → Map generation: invokes generation (evidence: `rust/src/mapmanip/mod.rs`)
- Map manipulation → Submap tools: uses submap tools (evidence: `rust/src/mapmanip/mod.rs`)
- Map manipulation → BYOND runtime: calls runtime (evidence: `rust/src/mapmanip/mod.rs`)
