# archipelagomw/archipelago architecture

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

- Interactive diagram: https://gitdiagram.com/archipelagomw/archipelago
- Repository: https://github.com/archipelagomw/archipelago

## Overview

Archipelago is a multi-game randomizer and multiworld framework: users configure a game world, generate a randomized world and its output, then connect game clients to a shared server to exchange checks and items. The graph separates generation, shared runtime, game integrations, and the web host. The README documents the broad game and WebHost capabilities; many individual game-world and web modules were not sampled, so their internal wiring is intentionally left unspecified.

Main entry points: [`Main.py`](https://github.com/archipelagomw/archipelago/blob/main/Main.py) (Generator Entry), [`WebHost.py`](https://github.com/archipelagomw/archipelago/blob/main/WebHost.py) (Web Host), [`CommonClient.py`](https://github.com/archipelagomw/archipelago/blob/main/CommonClient.py) (Client Core), [`SNIClient.py`](https://github.com/archipelagomw/archipelago/blob/main/SNIClient.py) (SNES Integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["World Generation"]
  node_main["Generator Entry<br/>[Main.py]"]
  node_world_model["World Model<br/>[BaseClasses.py]"]
  node_fill["Item Placement<br/>[Fill.py]"]
  node_options["Game Options<br/>[Options.py]"]
  node_world_registry["Game Registry<br/>[AutoWorld.py]"]
end

subgraph group_runtime["Shared Runtime"]
  node_server["MultiServer<br/>[MultiServer.py]"]
  node_protocol["Network Protocol<br/>[NetUtils.py]"]
  node_client_core["Client Core<br/>[CommonClient.py]"]
end

subgraph group_clients["Game Clients"]
  node_sni["SNES Integration<br/>[SNIClient.py]"]
  node_sni_registry["SNES Game Dispatch<br/>[AutoSNIClient.py]"]
  node_alttp_client["ALttP Client<br/>[Client.py]"]
  node_bizhawk_context["BizHawk Context<br/>[context.py]"]
end

subgraph group_web["Web Host"]
  node_webhost["Web Host<br/>[WebHost.py]"]
  node_web_generation["Web Generation API<br/>[generate.py]"]
  node_web_room["Room API<br/>[room.py]"]
  node_web_tracker["Tracker API<br/>[tracker.py]"]
end

node_user(("Player"))

node_user -.->|"configures"| node_main
node_main -->|"builds"| node_world_model
node_main -->|"places items"| node_fill
node_main -->|"loads options"| node_options
node_main -->|"uses registry"| node_world_registry
node_client_core -->|"connects to"| node_server
node_client_core -->|"uses protocol"| node_protocol
node_server -->|"uses protocol"| node_protocol
node_sni -->|"extends client"| node_client_core
node_sni -->|"dispatches games"| node_sni_registry
node_sni_registry -->|"registers clients"| node_sni
node_alttp_client -->|"reads game memory"| node_sni
node_bizhawk_context -->|"extends client"| node_client_core
node_user -.->|"uses"| node_webhost
node_webhost -.-> node_web_generation
node_webhost -.-> node_web_room
node_webhost -.-> node_web_tracker

click node_main "https://github.com/archipelagomw/archipelago/blob/main/Main.py"
click node_world_model "https://github.com/archipelagomw/archipelago/blob/main/BaseClasses.py"
click node_fill "https://github.com/archipelagomw/archipelago/blob/main/Fill.py"
click node_options "https://github.com/archipelagomw/archipelago/blob/main/Options.py"
click node_world_registry "https://github.com/archipelagomw/archipelago/blob/main/worlds/AutoWorld.py"
click node_server "https://github.com/archipelagomw/archipelago/blob/main/MultiServer.py"
click node_protocol "https://github.com/archipelagomw/archipelago/blob/main/NetUtils.py"
click node_client_core "https://github.com/archipelagomw/archipelago/blob/main/CommonClient.py"
click node_sni "https://github.com/archipelagomw/archipelago/blob/main/SNIClient.py"
click node_sni_registry "https://github.com/archipelagomw/archipelago/blob/main/worlds/AutoSNIClient.py"
click node_alttp_client "https://github.com/archipelagomw/archipelago/blob/main/worlds/alttp/Client.py"
click node_bizhawk_context "https://github.com/archipelagomw/archipelago/blob/main/worlds/_bizhawk/context.py"
click node_webhost "https://github.com/archipelagomw/archipelago/blob/main/WebHost.py"
click node_web_generation "https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/generate.py"
click node_web_room "https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/room.py"
click node_web_tracker "https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/tracker.py"

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_main,node_world_model,node_fill,node_options,node_world_registry toneBlue
class node_server,node_protocol,node_client_core toneAmber
class node_sni,node_sni_registry,node_alttp_client,node_bizhawk_context toneMint
class node_webhost,node_web_generation,node_web_room,node_web_tracker toneRose
class node_user toneIndigo
```

## Components

### World Generation

- [Generator Entry](https://github.com/archipelagomw/archipelago/blob/main/Main.py): `Main.py`
- [World Model](https://github.com/archipelagomw/archipelago/blob/main/BaseClasses.py): `BaseClasses.py`
- [Item Placement](https://github.com/archipelagomw/archipelago/blob/main/Fill.py): `Fill.py`
- [Game Options](https://github.com/archipelagomw/archipelago/blob/main/Options.py): `Options.py`
- [Game Registry](https://github.com/archipelagomw/archipelago/blob/main/worlds/AutoWorld.py): `worlds/AutoWorld.py`

### Shared Runtime

- [MultiServer](https://github.com/archipelagomw/archipelago/blob/main/MultiServer.py): `MultiServer.py`
- [Network Protocol](https://github.com/archipelagomw/archipelago/blob/main/NetUtils.py): `NetUtils.py`
- [Client Core](https://github.com/archipelagomw/archipelago/blob/main/CommonClient.py): `CommonClient.py`

### Game Clients

- [SNES Integration](https://github.com/archipelagomw/archipelago/blob/main/SNIClient.py): `SNIClient.py`
- [SNES Game Dispatch](https://github.com/archipelagomw/archipelago/blob/main/worlds/AutoSNIClient.py): `worlds/AutoSNIClient.py`
- [ALttP Client](https://github.com/archipelagomw/archipelago/blob/main/worlds/alttp/Client.py): `worlds/alttp/Client.py`
- [BizHawk Context](https://github.com/archipelagomw/archipelago/blob/main/worlds/_bizhawk/context.py): `worlds/_bizhawk/context.py`

### Web Host

- [Web Host](https://github.com/archipelagomw/archipelago/blob/main/WebHost.py): `WebHost.py`
- [Web Generation API](https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/generate.py): `WebHostLib/api/generate.py`
- [Room API](https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/room.py): `WebHostLib/api/room.py`
- [Tracker API](https://github.com/archipelagomw/archipelago/blob/main/WebHostLib/api/tracker.py): `WebHostLib/api/tracker.py`

### Other components

- **Player**

## Connections

- Player → Generator Entry: configures (evidence: `README.md`)
- Generator Entry → World Model: builds (evidence: `Main.py`)
- Generator Entry → Item Placement: places items (evidence: `Main.py`)
- Generator Entry → Game Options: loads options (evidence: `Main.py`)
- Generator Entry → Game Registry: uses registry (evidence: `Main.py`)
- Client Core → MultiServer: connects to (evidence: `CommonClient.py`)
- Client Core → Network Protocol: uses protocol (evidence: `CommonClient.py`)
- MultiServer → Network Protocol: uses protocol (evidence: `MultiServer.py`)
- SNES Integration → Client Core: extends client (evidence: `SNIClient.py`)
- SNES Integration → SNES Game Dispatch: dispatches games (evidence: `SNIClient.py`)
- SNES Game Dispatch → SNES Integration: registers clients (evidence: `worlds/AutoSNIClient.py`)
- ALttP Client → SNES Integration: reads game memory (evidence: `worlds/alttp/Client.py`)
- BizHawk Context → Client Core: extends client (evidence: `worlds/_bizhawk/context.py`)
- Player → Web Host: uses (evidence: `README.md`)
- Web Host → Web Generation API
- Web Host → Room API
- Web Host → Tracker API
