# luki-1/arkweb architecture

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

- Interactive diagram: https://gitdiagram.com/luki-1/arkweb
- Repository: https://github.com/luki-1/arkweb

## Overview

ArkWeb lets Spider-Man Remastered provide the playable movement while Arkham Knight supplies Gotham, its collision sources, and the displayed scene. The main runtime loop streams scanned and exported Gotham geometry into Spider-Man, then links the hero’s state to a hidden Batman puppet and composites Spider-Man’s captured frame into Arkham’s view. The graph also preserves the documented grapple, combat, and reverse-engineering capabilities. Edges rely on README statements or indexed source references; unsampled implementation details are not inferred.

Main entry points: [`src/ak_host/main.cpp`](https://github.com/luki-1/arkweb/blob/main/src/ak_host/main.cpp) (Host Runtime), [`src/sm_guest/main.cpp`](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/main.cpp) (Guest Runtime), [`tools/gotham_stream.py`](https://github.com/luki-1/arkweb/blob/main/tools/gotham_stream.py) (Gotham Streamer), [`src/common/link.h`](https://github.com/luki-1/arkweb/blob/main/src/common/link.h) (Shared Memory Link)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_guest["Guest Runtime<br/>[main.cpp]"]
  node_collision["Gotham Collision<br/>[gotham.h]"]
  node_capture["Frame Capture<br/>[capture.h]"]
  node_host["Host Runtime<br/>[main.cpp]"]
  node_overlay["View Overlay<br/>[overlay.h]"]
end

subgraph group_link["Shared Link"]
  node_protocol["Link Protocol<br/>[arkweb_protocol.h]"]
  node_sharedlink["Shared Memory Link<br/>[link.h]"]
  node_coordinates["Coordinate Mapping<br/>[coords.h]"]
end

subgraph group_stream["Gotham Streaming"]
  node_streamer["Gotham Streamer<br/>[gotham_stream.py]"]
  node_tilebuilder["Collision Tile Builder"]
  node_hintbuilder["Swing Hint Builder"]
end

subgraph group_features["Movement Features"]
  node_grapple["Grapple Targets<br/>[grapple.h]"]
  node_zip["Zip And Perch<br/>[zip.h]"]
  node_combat["Combat Mirroring<br/>[combat.h]"]
  node_mirror["Pose Transfer<br/>[mirror.h]"]
end

subgraph group_research["Research Tools"]
  node_analysis["Executable Analysis<br/>[pe_tools.py]"]
end

node_player(("Player"))
node_spiderman["Spider-Man Game"]
node_arkham["Arkham Knight"]

node_player -->|"plays"| node_spiderman
node_player -->|"views"| node_arkham
node_guest -->|"drives movement"| node_spiderman
node_host -->|"drives puppet"| node_arkham
node_host -->|"reads hero state"| node_guest
node_guest -->|"sends captured frame"| node_host
node_host -->|"draws frame"| node_overlay
node_guest -->|"loads geometry"| node_collision
node_guest -->|"exchanges state"| node_sharedlink
node_host -->|"exchanges state"| node_sharedlink
node_sharedlink -->|"uses layout"| node_protocol
node_host -->|"converts positions"| node_coordinates
node_streamer -->|"requests scans and exports"| node_host
node_host -->|"provides scan data"| node_streamer
node_streamer -->|"builds collision tiles"| node_tilebuilder
node_streamer -->|"builds swing hints"| node_hintbuilder
node_streamer -->|"sends tiles and hints"| node_guest
node_host -->|"exports grapple points"| node_grapple
node_zip -->|"targets ledges"| node_grapple
node_player -->|"triggers zip"| node_zip
node_host -->|"reports combat state"| node_combat
node_combat -->|"transfers pose"| node_mirror
node_analysis -.->|"supports reverse engineering"| node_player

click node_guest "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/main.cpp"
click node_collision "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/gotham.h"
click node_capture "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/capture.h"
click node_host "https://github.com/luki-1/arkweb/blob/main/src/ak_host/main.cpp"
click node_overlay "https://github.com/luki-1/arkweb/blob/main/src/ak_host/overlay.h"
click node_protocol "https://github.com/luki-1/arkweb/blob/main/protocol/arkweb_protocol.h"
click node_sharedlink "https://github.com/luki-1/arkweb/blob/main/src/common/link.h"
click node_coordinates "https://github.com/luki-1/arkweb/blob/main/src/common/coords.h"
click node_streamer "https://github.com/luki-1/arkweb/blob/main/tools/gotham_stream.py"
click node_tilebuilder "https://github.com/luki-1/arkweb/blob/main/tools/build_gotham_tiles.py"
click node_hintbuilder "https://github.com/luki-1/arkweb/blob/main/tools/build_gotham_hints.py"
click node_grapple "https://github.com/luki-1/arkweb/blob/main/src/ak_host/grapple.h"
click node_zip "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/zip.h"
click node_combat "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/combat.h"
click node_mirror "https://github.com/luki-1/arkweb/blob/main/src/sm_guest/mirror.h"
click node_analysis "https://github.com/luki-1/arkweb/blob/main/tools/pe_tools.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_guest,node_collision,node_capture,node_host,node_overlay toneBlue
class node_protocol,node_sharedlink,node_coordinates toneAmber
class node_streamer,node_tilebuilder,node_hintbuilder toneMint
class node_grapple,node_zip,node_combat,node_mirror toneRose
class node_analysis,node_player,node_spiderman,node_arkham toneIndigo
```

## Components

### Game Runtime

- [Guest Runtime](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/main.cpp): `src/sm_guest/main.cpp`
- [Gotham Collision](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/gotham.h): `src/sm_guest/gotham.h`
- [Frame Capture](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/capture.h): `src/sm_guest/capture.h`
- [Host Runtime](https://github.com/luki-1/arkweb/blob/main/src/ak_host/main.cpp): `src/ak_host/main.cpp`
- [View Overlay](https://github.com/luki-1/arkweb/blob/main/src/ak_host/overlay.h): `src/ak_host/overlay.h`

### Shared Link

- [Link Protocol](https://github.com/luki-1/arkweb/blob/main/protocol/arkweb_protocol.h): `protocol/arkweb_protocol.h`
- [Shared Memory Link](https://github.com/luki-1/arkweb/blob/main/src/common/link.h): `src/common/link.h`
- [Coordinate Mapping](https://github.com/luki-1/arkweb/blob/main/src/common/coords.h): `src/common/coords.h`

### Gotham Streaming

- [Gotham Streamer](https://github.com/luki-1/arkweb/blob/main/tools/gotham_stream.py): `tools/gotham_stream.py`
- [Collision Tile Builder](https://github.com/luki-1/arkweb/blob/main/tools/build_gotham_tiles.py): `tools/build_gotham_tiles.py`
- [Swing Hint Builder](https://github.com/luki-1/arkweb/blob/main/tools/build_gotham_hints.py): `tools/build_gotham_hints.py`

### Movement Features

- [Grapple Targets](https://github.com/luki-1/arkweb/blob/main/src/ak_host/grapple.h): `src/ak_host/grapple.h`
- [Zip And Perch](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/zip.h): `src/sm_guest/zip.h`
- [Combat Mirroring](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/combat.h): `src/sm_guest/combat.h`
- [Pose Transfer](https://github.com/luki-1/arkweb/blob/main/src/sm_guest/mirror.h): `src/sm_guest/mirror.h`

### Research Tools

- [Executable Analysis](https://github.com/luki-1/arkweb/blob/main/tools/pe_tools.py): `tools/pe_tools.py`

### Other components

- **Player**
- **Spider-Man Game**
- **Arkham Knight**

## Connections

- Player → Spider-Man Game: plays (evidence: `README.md`)
- Player → Arkham Knight: views (evidence: `README.md`)
- Guest Runtime → Spider-Man Game: drives movement (evidence: `README.md`)
- Host Runtime → Arkham Knight: drives puppet (evidence: `README.md`)
- Host Runtime → Guest Runtime: reads hero state (evidence: `README.md`)
- Guest Runtime → Host Runtime: sends captured frame (evidence: `README.md`)
- Host Runtime → View Overlay: draws frame (evidence: `README.md`)
- Guest Runtime → Gotham Collision: loads geometry (evidence: `README.md`)
- Guest Runtime → Shared Memory Link: exchanges state (evidence: `README.md`)
- Host Runtime → Shared Memory Link: exchanges state (evidence: `README.md`)
- Shared Memory Link → Link Protocol: uses layout (evidence: `src/common/link.h`)
- Host Runtime → Coordinate Mapping: converts positions (evidence: `src/ak_host/main.cpp`)
- Gotham Streamer → Host Runtime: requests scans and exports (evidence: `README.md`)
- Host Runtime → Gotham Streamer: provides scan data (evidence: `README.md`)
- Gotham Streamer → Collision Tile Builder: builds collision tiles (evidence: `tools/gotham_stream.py`)
- Gotham Streamer → Swing Hint Builder: builds swing hints (evidence: `tools/gotham_stream.py`)
- Gotham Streamer → Guest Runtime: sends tiles and hints (evidence: `README.md`)
- Host Runtime → Grapple Targets: exports grapple points (evidence: `README.md`)
- Zip And Perch → Grapple Targets: targets ledges (evidence: `src/sm_guest/zip.h`)
- Player → Zip And Perch: triggers zip (evidence: `README.md`)
- Host Runtime → Combat Mirroring: reports combat state (evidence: `README.md`)
- Combat Mirroring → Pose Transfer: transfers pose (evidence: `README.md`)
- Executable Analysis → Player: supports reverse engineering (evidence: `README.md`)
