# 747400forlife/geofs-npc-traffic architecture

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

- Interactive diagram: https://gitdiagram.com/747400forlife/geofs-npc-traffic
- Repository: https://github.com/747400forlife/geofs-npc-traffic

## Overview

GeoFS NPC Traffic is a no-UI GeoFS userscript that populates nearby airports with simulated aircraft. Its documented workflow covers airport-layout discovery, arrivals landing and taxiing to gates, and parked aircraft departing after runway-clearance checks. The sampled script also shows airport graph construction, route planning, runway coordination, movement, and interaction with GeoFS terrain/entities. The script is a monolith, so several domain-stage links are dashed where the excerpts do not show their call sites; aircraft model usage is not confirmed by the sampled source.

Main entry points: [`geofs-npc-traffic.user.js`](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js) (Traffic userscript)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_airport["Airport layout"]
  node_osm[("OpenStreetMap")]
  node_layout["Airport layout graph"]
end

subgraph group_traffic["Traffic operations"]
  node_arrival["Arrival planning"]
  node_landing["Landing and taxi"]
  node_gate["Gate parking"]
  node_departure["Pushback and departure"]
  node_runway["Runway coordination"]
  node_motion["Aircraft movement"]
end

subgraph group_runtime["GeoFS runtime"]
  node_userscript["Traffic userscript"]
  node_geofs["GeoFS simulator"]
end

subgraph group_assets["Aircraft assets"]
  node_models["Aircraft model assets<br/>[models.json]"]
end

node_pilot(("Nearby pilot"))

node_pilot -->|"flies nearby"| node_userscript
node_osm -->|"provides layout data"| node_layout
node_userscript -.->|"builds graph"| node_layout
node_layout -.->|"supports routing"| node_arrival
node_arrival -.->|"plans approach"| node_landing
node_landing -->|"taxis to gate"| node_gate
node_gate -->|"pushes back"| node_departure
node_departure -->|"waits for clearance"| node_runway
node_runway -.->|"clears takeoff"| node_motion
node_userscript -.->|"uses simulator"| node_geofs
node_motion -.->|"updates aircraft"| node_geofs

click node_userscript "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_layout "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_arrival "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_landing "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_gate "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_departure "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_runway "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_motion "https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js"
click node_models "https://github.com/747400forlife/geofs-npc-traffic/blob/main/models.json"

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_osm,node_layout toneBlue
class node_arrival,node_landing,node_gate,node_departure,node_runway,node_motion toneAmber
class node_userscript,node_geofs toneMint
class node_models toneRose
class node_pilot toneIndigo
```

## Components

### Airport layout

- **OpenStreetMap**
- [Airport layout graph](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`

### Traffic operations

- [Arrival planning](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- [Landing and taxi](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- [Gate parking](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- [Pushback and departure](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- [Runway coordination](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- [Aircraft movement](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`

### GeoFS runtime

- [Traffic userscript](https://github.com/747400forlife/geofs-npc-traffic/blob/main/geofs-npc-traffic.user.js): `geofs-npc-traffic.user.js`
- **GeoFS simulator**

### Aircraft assets

- [Aircraft model assets](https://github.com/747400forlife/geofs-npc-traffic/blob/main/models.json): `models.json`

### Other components

- **Nearby pilot**

## Connections

- Nearby pilot → Traffic userscript: flies nearby (evidence: `README.md`)
- OpenStreetMap → Airport layout graph: provides layout data (evidence: `README.md`)
- Traffic userscript → Airport layout graph: builds graph (evidence: `geofs-npc-traffic.user.js`)
- Airport layout graph → Arrival planning: supports routing (evidence: `geofs-npc-traffic.user.js`)
- Arrival planning → Landing and taxi: plans approach (evidence: `geofs-npc-traffic.user.js`)
- Landing and taxi → Gate parking: taxis to gate (evidence: `README.md`)
- Gate parking → Pushback and departure: pushes back (evidence: `README.md`)
- Pushback and departure → Runway coordination: waits for clearance (evidence: `README.md`)
- Runway coordination → Aircraft movement: clears takeoff (evidence: `geofs-npc-traffic.user.js`)
- Traffic userscript → GeoFS simulator: uses simulator
- Aircraft movement → GeoFS simulator: updates aircraft
