# rookieami/openra architecture

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

- Interactive diagram: https://gitdiagram.com/rookieami/openra
- Repository: https://github.com/rookieami/openra

## Overview

OpenRA is a real-time strategy game engine for playing and modding classic Westwood-style games. In the principal workflow, a player uses the game interface to issue orders; the order manager coordinates those orders with the network connection and applies them to the simulated world, whose state is presented through rendering, audio, and notifications. The repository also supports mod-defined rules and scripting, custom maps and editing, and dedicated servers. The README establishes these capabilities; sampled source confirms selected order, viewport, rendering, notification, and audio behavior, but not every subsystem’s wiring.

Main entry points: [`OpenRA.Game/World.cs`](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/World.cs) (World simulation), [`OpenRA.Game/Network/OrderManager.cs`](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/OrderManager.cs) (Order manager), [`OpenRA.Game/Network/Connection.cs`](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/Connection.cs) (Game connection), [`OpenRA.Game/Input/InputHandler.cs`](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Input/InputHandler.cs) (Input handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_game["Game runtime<br/>[Game.cs]"]
  node_orders["Order manager<br/>[OrderManager.cs]"]
end

subgraph group_simulation["Simulation and Mods"]
  node_world["World simulation<br/>[World.cs]"]
  node_actors_traits["Actors and traits<br/>[Actor.cs]"]
  node_map["Maps<br/>[Map.cs]"]
  node_mod_rules["Mod rules<br/>[Ruleset.cs]"]
  node_scripting["Lua scripting<br/>[ScriptContext.cs]"]
  node_editor["Map editing"]
end

subgraph group_presentation["Player Interface"]
  node_input["Input handling<br/>[InputHandler.cs]"]
  node_viewport_widget["Viewport controls"]
  node_renderer["World rendering<br/>[WorldRenderer.cs]"]
  node_cursor["Cursor rendering<br/>[CursorManager.cs]"]
  node_notifications["Text notifications"]
  node_sound["Audio output"]
end

subgraph group_network_content["Network and Content"]
  node_connection["Game connection<br/>[Connection.cs]"]
  node_server["Dedicated server<br/>[Server.cs]"]
  node_moddata["Mod data<br/>[ModData.cs]"]
  node_filesystem["Game filesystem<br/>[FileSystem.cs]"]
  node_installer["Content installer<br/>[InstallerUtils.cs]"]
end

node_player(("Player"))

node_player -->|"provides input"| node_input
node_input -->|"routes controls"| node_viewport_widget
node_viewport_widget -->|"scrolls viewport"| node_world
node_orders -->|"sends orders"| node_connection
node_connection -->|"delivers orders"| node_orders
node_orders -->|"processes orders"| node_world
node_world -->|"updates actors"| node_actors_traits
node_world -->|"uses map state"| node_map
node_mod_rules -->|"defines traits"| node_actors_traits
node_scripting -.->|"scripts gameplay"| node_world
node_editor -->|"edits maps"| node_map
node_world -->|"supplies world state"| node_renderer
node_player -->|"moves pointer"| node_cursor
node_world -->|"posts notifications"| node_notifications
node_world -->|"plays game audio"| node_sound
node_server -->|"serves sessions"| node_connection
node_moddata -->|"loads mod content"| node_filesystem
node_installer -->|"installs game content"| node_filesystem

click node_game "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Game.cs"
click node_input "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Input/InputHandler.cs"
click node_viewport_widget "https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs"
click node_orders "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/OrderManager.cs"
click node_world "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/World.cs"
click node_actors_traits "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Actor.cs"
click node_map "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Map/Map.cs"
click node_mod_rules "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/GameRules/Ruleset.cs"
click node_scripting "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Scripting/ScriptContext.cs"
click node_editor "https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs"
click node_renderer "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Graphics/WorldRenderer.cs"
click node_cursor "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Graphics/CursorManager.cs"
click node_notifications "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/TextNotificationsManager.cs"
click node_sound "https://github.com/rookieami/openra/blob/bleed/OpenRA.Platforms.Default/OpenAlSoundEngine.cs"
click node_connection "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/Connection.cs"
click node_server "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Server/Server.cs"
click node_moddata "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/ModData.cs"
click node_filesystem "https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/FileSystem/FileSystem.cs"
click node_installer "https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/Installer/InstallerUtils.cs"

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_game,node_orders toneBlue
class node_world,node_actors_traits,node_map,node_mod_rules,node_scripting,node_editor toneAmber
class node_input,node_viewport_widget,node_renderer,node_cursor,node_notifications,node_sound toneMint
class node_connection,node_server,node_moddata,node_filesystem,node_installer toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game runtime](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Game.cs): `OpenRA.Game/Game.cs`
- [Order manager](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/OrderManager.cs): `OpenRA.Game/Network/OrderManager.cs`

### Simulation and Mods

- [World simulation](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/World.cs): `OpenRA.Game/World.cs`
- [Actors and traits](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Actor.cs): `OpenRA.Game/Actor.cs`
- [Maps](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Map/Map.cs): `OpenRA.Game/Map/Map.cs`
- [Mod rules](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/GameRules/Ruleset.cs): `OpenRA.Game/GameRules/Ruleset.cs`
- [Lua scripting](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Scripting/ScriptContext.cs): `OpenRA.Game/Scripting/ScriptContext.cs`
- [Map editing](https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs): `OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs`

### Player Interface

- [Input handling](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Input/InputHandler.cs): `OpenRA.Game/Input/InputHandler.cs`
- [Viewport controls](https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs): `OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs`
- [World rendering](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Graphics/WorldRenderer.cs): `OpenRA.Game/Graphics/WorldRenderer.cs`
- [Cursor rendering](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Graphics/CursorManager.cs): `OpenRA.Game/Graphics/CursorManager.cs`
- [Text notifications](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/TextNotificationsManager.cs): `OpenRA.Game/TextNotificationsManager.cs`
- [Audio output](https://github.com/rookieami/openra/blob/bleed/OpenRA.Platforms.Default/OpenAlSoundEngine.cs): `OpenRA.Platforms.Default/OpenAlSoundEngine.cs`

### Network and Content

- [Game connection](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Network/Connection.cs): `OpenRA.Game/Network/Connection.cs`
- [Dedicated server](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/Server/Server.cs): `OpenRA.Game/Server/Server.cs`
- [Mod data](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/ModData.cs): `OpenRA.Game/ModData.cs`
- [Game filesystem](https://github.com/rookieami/openra/blob/bleed/OpenRA.Game/FileSystem/FileSystem.cs): `OpenRA.Game/FileSystem/FileSystem.cs`
- [Content installer](https://github.com/rookieami/openra/blob/bleed/OpenRA.Mods.Common/Installer/InstallerUtils.cs): `OpenRA.Mods.Common/Installer/InstallerUtils.cs`

### Other components

- **Player**

## Connections

- Player → Input handling: provides input
- Input handling → Viewport controls: routes controls
- Viewport controls → World simulation: scrolls viewport
- Order manager → Game connection: sends orders
- Game connection → Order manager: delivers orders
- Order manager → World simulation: processes orders
- World simulation → Actors and traits: updates actors
- World simulation → Maps: uses map state
- Mod rules → Actors and traits: defines traits
- Lua scripting → World simulation: scripts gameplay
- Map editing → Maps: edits maps
- World simulation → World rendering: supplies world state
- Player → Cursor rendering: moves pointer
- World simulation → Text notifications: posts notifications
- World simulation → Audio output: plays game audio
- Dedicated server → Game connection: serves sessions
- Mod data → Game filesystem: loads mod content
- Content installer → Game filesystem: installs game content
