# anuken/mindustry architecture

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

- Interactive diagram: https://gitdiagram.com/anuken/mindustry
- Repository: https://github.com/anuken/mindustry

## Overview

Mindustry is a Java automation tower-defense RTS. Players interact through desktop or mobile clients, build and command units and structures in a tile-based world, and can play campaign content or multiplayer; the repository also includes map editing, programmable logic, saves, and mod support. The graph groups these product capabilities and runtime layers. Relationships are limited to README statements and SOURCE INDEX references; unsampled implementations are represented at supported directory paths, without asserting unverified call sequences.

Main entry points: [`core/src/mindustry/ClientLauncher.java`](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/ClientLauncher.java) (Client runtime), [`server/src/mindustry/server/ServerControl.java`](https://github.com/anuken/mindustry/blob/master/server/src/mindustry/server/ServerControl.java) (Server control), [`core/src/mindustry/world/Tile.java`](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/world/Tile.java) (World and tiles), [`core/src/mindustry/mod/Mods.java`](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/mod/Mods.java) (Mods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients and servers"]
  node_desktop["Desktop launcher"]
  node_client["Client runtime"]
  node_input["Player controls<br/>[InputHandler.java]"]
  node_server["Server control<br/>[ServerControl.java]"]
  node_network["Network transport<br/>[Net.java]"]
  node_netclient["Client networking<br/>[NetClient.java]"]
end

subgraph group_world["World and gameplay"]
  node_vars["Runtime registry<br/>[Vars.java]"]
  node_worldstate["World and tiles<br/>[Tile.java]"]
  node_blocks["Structures<br/>[Block.java]"]
  node_units["Units and AI<br/>[AIController.java]"]
  node_rules["Game rules<br/>[Rules.java]"]
end

subgraph group_content["Content and customization"]
  node_content["Game content<br/>[Blocks.java]"]
  node_planets["Planets and sectors<br/>[Planet.java]"]
  node_mods["Mods<br/>[Mods.java]"]
  node_logic["Programmable logic"]
  node_editor["Map editor"]
  node_maps["Maps and generation"]
end

subgraph group_services["Game services"]
  node_saves["Save system<br/>[Saves.java]"]
  node_services["Achievements and stats<br/>[GameService.java]"]
  node_events["Game events<br/>[EventType.java]"]
  node_effects["Effects and rendering<br/>[Effect.java]"]
end

node_player(("Player"))

node_player -.->|"launches"| node_desktop
node_desktop -->|"starts"| node_client
node_player -.->|"controls"| node_input
node_input -->|"edits"| node_worldstate
node_server -->|"loads"| node_maps
node_server -->|"uses"| node_saves
node_server -->|"loads"| node_mods
node_server -->|"uses"| node_network
node_netclient -->|"uses"| node_network
node_client -->|"uses"| node_network
node_client -->|"loads"| node_mods
node_client -->|"loads"| node_maps
node_client -->|"uses"| node_saves
node_vars -->|"registers"| node_mods
node_content -.->|"defines"| node_worldstate
node_worldstate -->|"hosts"| node_blocks
node_units -->|"queries"| node_worldstate
node_units -.->|"uses"| node_rules
node_planets -.->|"generates"| node_maps
node_editor -.->|"edits"| node_maps
node_mods -.->|"adds"| node_content
node_services -->|"listens"| node_events
node_events -.->|"triggers"| node_effects

click node_desktop "https://github.com/anuken/mindustry/blob/master/desktop/src/mindustry/desktop/DesktopLauncher.java"
click node_client "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/ClientLauncher.java"
click node_input "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/input/InputHandler.java"
click node_server "https://github.com/anuken/mindustry/blob/master/server/src/mindustry/server/ServerControl.java"
click node_network "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/net/Net.java"
click node_netclient "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/core/NetClient.java"
click node_vars "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/Vars.java"
click node_worldstate "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/world/Tile.java"
click node_blocks "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/world/Block.java"
click node_units "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/entities/units/AIController.java"
click node_rules "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/Rules.java"
click node_content "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/content/Blocks.java"
click node_planets "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/type/Planet.java"
click node_mods "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/mod/Mods.java"
click node_logic "https://github.com/anuken/mindustry/tree/master/core/src/mindustry/logic"
click node_editor "https://github.com/anuken/mindustry/tree/master/core/src/mindustry/editor"
click node_maps "https://github.com/anuken/mindustry/tree/master/core/src/mindustry/maps"
click node_saves "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/Saves.java"
click node_services "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/service/GameService.java"
click node_events "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/EventType.java"
click node_effects "https://github.com/anuken/mindustry/blob/master/core/src/mindustry/entities/Effect.java"

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_desktop,node_client,node_input,node_server,node_network,node_netclient toneBlue
class node_vars,node_worldstate,node_blocks,node_units,node_rules toneAmber
class node_content,node_planets,node_mods,node_logic,node_editor,node_maps toneMint
class node_saves,node_services,node_events,node_effects toneRose
class node_player toneIndigo
```

## Components

### Clients and servers

- [Desktop launcher](https://github.com/anuken/mindustry/blob/master/desktop/src/mindustry/desktop/DesktopLauncher.java): `desktop/src/mindustry/desktop/DesktopLauncher.java`
- [Client runtime](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/ClientLauncher.java): `core/src/mindustry/ClientLauncher.java`
- [Player controls](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/input/InputHandler.java): `core/src/mindustry/input/InputHandler.java`
- [Server control](https://github.com/anuken/mindustry/blob/master/server/src/mindustry/server/ServerControl.java): `server/src/mindustry/server/ServerControl.java`
- [Network transport](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/net/Net.java): `core/src/mindustry/net/Net.java`
- [Client networking](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/core/NetClient.java): `core/src/mindustry/core/NetClient.java`

### World and gameplay

- [Runtime registry](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/Vars.java): `core/src/mindustry/Vars.java`
- [World and tiles](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/world/Tile.java): `core/src/mindustry/world/Tile.java`
- [Structures](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/world/Block.java): `core/src/mindustry/world/Block.java`
- [Units and AI](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/entities/units/AIController.java): `core/src/mindustry/entities/units/AIController.java`
- [Game rules](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/Rules.java): `core/src/mindustry/game/Rules.java`

### Content and customization

- [Game content](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/content/Blocks.java): `core/src/mindustry/content/Blocks.java`
- [Planets and sectors](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/type/Planet.java): `core/src/mindustry/type/Planet.java`
- [Mods](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/mod/Mods.java): `core/src/mindustry/mod/Mods.java`
- [Programmable logic](https://github.com/anuken/mindustry/tree/master/core/src/mindustry/logic): `core/src/mindustry/logic`
- [Map editor](https://github.com/anuken/mindustry/tree/master/core/src/mindustry/editor): `core/src/mindustry/editor`
- [Maps and generation](https://github.com/anuken/mindustry/tree/master/core/src/mindustry/maps): `core/src/mindustry/maps`

### Game services

- [Save system](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/Saves.java): `core/src/mindustry/game/Saves.java`
- [Achievements and stats](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/service/GameService.java): `core/src/mindustry/service/GameService.java`
- [Game events](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/game/EventType.java): `core/src/mindustry/game/EventType.java`
- [Effects and rendering](https://github.com/anuken/mindustry/blob/master/core/src/mindustry/entities/Effect.java): `core/src/mindustry/entities/Effect.java`

### Other components

- **Player**

## Connections

- Player → Desktop launcher: launches (evidence: `README.md`)
- Desktop launcher → Client runtime: starts (evidence: `desktop/src/mindustry/desktop/DesktopLauncher.java`)
- Player → Player controls: controls (evidence: `README.md`)
- Player controls → World and tiles: edits (evidence: `core/src/mindustry/input/InputHandler.java`)
- Server control → Maps and generation: loads (evidence: `server/src/mindustry/server/ServerControl.java`)
- Server control → Save system: uses (evidence: `server/src/mindustry/server/ServerControl.java`)
- Server control → Mods: loads (evidence: `server/src/mindustry/server/ServerControl.java`)
- Server control → Network transport: uses (evidence: `server/src/mindustry/server/ServerControl.java`)
- Client networking → Network transport: uses (evidence: `core/src/mindustry/core/NetClient.java`)
- Client runtime → Network transport: uses (evidence: `core/src/mindustry/ClientLauncher.java`)
- Client runtime → Mods: loads (evidence: `core/src/mindustry/ClientLauncher.java`)
- Client runtime → Maps and generation: loads (evidence: `core/src/mindustry/ClientLauncher.java`)
- Client runtime → Save system: uses (evidence: `core/src/mindustry/ClientLauncher.java`)
- Runtime registry → Mods: registers (evidence: `core/src/mindustry/Vars.java`)
- Game content → World and tiles: defines (evidence: `core/src/mindustry/world/Tile.java`)
- World and tiles → Structures: hosts (evidence: `core/src/mindustry/world/Tile.java`)
- Units and AI → World and tiles: queries (evidence: `core/src/mindustry/entities/units/AIController.java`)
- Units and AI → Game rules: uses
- Planets and sectors → Maps and generation: generates
- Map editor → Maps and generation: edits
- Mods → Game content: adds
- Achievements and stats → Game events: listens (evidence: `core/src/mindustry/service/GameService.java`)
- Game events → Effects and rendering: triggers
