# electronicarts/cnc_remastered_collection architecture

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

- Interactive diagram: https://gitdiagram.com/electronicarts/cnc_remastered_collection
- Repository: https://github.com/electronicarts/cnc_remastered_collection

## Overview

CnC Remastered Map Editor is a desktop application for creating and editing Tiberian Dawn and Red Alert maps. The principal workflow is to open or create a map, edit its terrain and placed objects with tools, configure scenario settings, and view the result in the map panel. Game-specific plugins supply type data; asset managers load rendering resources. The README also identifies Steam Workshop support. Some subsystem links are based on source-tree names and documented capabilities; only startup, selected asset loading, and Steamworks API excerpts were sampled.

Main entry points: [`CnCTDRAMapEditor/MainForm.cs`](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/MainForm.cs) (Main window), [`CnCTDRAMapEditor/Program.cs`](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Program.cs) (Application startup), [`CnCTDRAMapEditor/Model/Map.cs`](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Map.cs) (Map state), [`CnCTDRAMapEditor/Utility/TilesetManager.cs`](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/TilesetManager.cs) (Tileset manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Editor interface"]
  node_program["Application startup<br/>[Program.cs]"]
  node_main["Main window<br/>[MainForm.cs]"]
  node_panels["Editor controls<br/>[MapPanel.cs]"]
  node_settings["Map and scenario settings"]
end

subgraph group_domain["Map editing"]
  node_tools["Map editing tools<br/>[BuildingTool.cs]"]
  node_map["Map state<br/>[Map.cs]"]
  node_cells["Cell grid<br/>[CellGrid.cs]"]
  node_objects["Map entities<br/>[Building.cs]"]
  node_triggers["Triggers and teams<br/>[Trigger.cs]"]
  node_history["Undo and redo<br/>[UndoRedoList.cs]"]
  node_mapfiles["Map file encoding<br/>[INI.cs]"]
end

subgraph group_assets["Game data and rendering"]
  node_renderer["Map renderer<br/>[MapRenderer.cs]"]
  node_plugins["Game plugins<br/>[IGamePlugin.cs]"]
  node_ra["Red Alert data<br/>[GamePlugin.cs]"]
  node_td["Tiberian Dawn data<br/>[GamePlugin.cs]"]
  node_megafiles["Game asset archives<br/>[MegafileManager.cs]"]
  node_textures["Texture manager<br/>[TextureManager.cs]"]
  node_tilesets["Tileset manager<br/>[TilesetManager.cs]"]
end

subgraph group_integration["External integration"]
  node_ugc["Steam Workshop integration<br/>[SteamworksUGC.cs]"]
end

node_user(("Map editor user"))
node_steam(("Steam services"))

node_user -->|"uses"| node_main
node_program -->|"loads archives"| node_megafiles
node_program -->|"initializes"| node_textures
node_program -->|"initializes"| node_tilesets
node_program -->|"launches"| node_main
node_main -->|"presents"| node_panels
node_main -->|"dispatches editing"| node_tools
node_main -->|"opens settings"| node_settings
node_main -->|"loads and saves"| node_mapfiles
node_tools -->|"edits"| node_map
node_tools -->|"records changes"| node_history
node_map -->|"uses grid"| node_cells
node_map -->|"contains entities"| node_objects
node_map -->|"contains scenario data"| node_triggers
node_panels -->|"requests rendering"| node_renderer
node_renderer -->|"gets tile data"| node_tilesets
node_tilesets -->|"uses textures"| node_textures
node_tilesets -->|"loads definitions"| node_megafiles
node_plugins -->|"implemented by"| node_ra
node_plugins -->|"implemented by"| node_td
node_program -.->|"initializes optionally"| node_ugc
node_ugc -.->|"uses Workshop API"| node_steam

click node_program "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Program.cs"
click node_main "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/MainForm.cs"
click node_panels "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Controls/MapPanel.cs"
click node_settings "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Dialogs/MapSettingsDialog.cs"
click node_tools "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Tools/BuildingTool.cs"
click node_map "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Map.cs"
click node_cells "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/CellGrid.cs"
click node_objects "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Building.cs"
click node_triggers "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Trigger.cs"
click node_history "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/UndoRedoList.cs"
click node_mapfiles "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/INI.cs"
click node_renderer "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Render/MapRenderer.cs"
click node_plugins "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Interface/IGamePlugin.cs"
click node_ra "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/RedAlert/GamePlugin.cs"
click node_td "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/TiberianDawn/GamePlugin.cs"
click node_megafiles "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/MegafileManager.cs"
click node_textures "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/TextureManager.cs"
click node_tilesets "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/TilesetManager.cs"
click node_ugc "https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/SteamworksUGC.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_program,node_main,node_panels,node_settings,node_user toneBlue
class node_tools,node_map,node_cells,node_objects,node_triggers,node_history,node_mapfiles toneAmber
class node_renderer,node_plugins,node_ra,node_td,node_megafiles,node_textures,node_tilesets toneMint
class node_ugc toneRose
class node_steam toneIndigo
```

## Components

### Editor interface

- [Application startup](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Program.cs): `CnCTDRAMapEditor/Program.cs`
- [Main window](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/MainForm.cs): `CnCTDRAMapEditor/MainForm.cs`
- [Editor controls](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Controls/MapPanel.cs): `CnCTDRAMapEditor/Controls/MapPanel.cs`
- [Map and scenario settings](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Dialogs/MapSettingsDialog.cs): `CnCTDRAMapEditor/Dialogs/MapSettingsDialog.cs`

### Map editing

- [Map editing tools](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Tools/BuildingTool.cs): `CnCTDRAMapEditor/Tools/BuildingTool.cs`
- [Map state](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Map.cs): `CnCTDRAMapEditor/Model/Map.cs`
- [Cell grid](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/CellGrid.cs): `CnCTDRAMapEditor/Model/CellGrid.cs`
- [Map entities](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Building.cs): `CnCTDRAMapEditor/Model/Building.cs`
- [Triggers and teams](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Model/Trigger.cs): `CnCTDRAMapEditor/Model/Trigger.cs`
- [Undo and redo](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/UndoRedoList.cs): `CnCTDRAMapEditor/Utility/UndoRedoList.cs`
- [Map file encoding](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/INI.cs): `CnCTDRAMapEditor/Utility/INI.cs`

### Game data and rendering

- [Map renderer](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Render/MapRenderer.cs): `CnCTDRAMapEditor/Render/MapRenderer.cs`
- [Game plugins](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Interface/IGamePlugin.cs): `CnCTDRAMapEditor/Interface/IGamePlugin.cs`
- [Red Alert data](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/RedAlert/GamePlugin.cs): `CnCTDRAMapEditor/RedAlert/GamePlugin.cs`
- [Tiberian Dawn data](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/TiberianDawn/GamePlugin.cs): `CnCTDRAMapEditor/TiberianDawn/GamePlugin.cs`
- [Game asset archives](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/MegafileManager.cs): `CnCTDRAMapEditor/Utility/MegafileManager.cs`
- [Texture manager](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/TextureManager.cs): `CnCTDRAMapEditor/Utility/TextureManager.cs`
- [Tileset manager](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/TilesetManager.cs): `CnCTDRAMapEditor/Utility/TilesetManager.cs`

### External integration

- [Steam Workshop integration](https://github.com/electronicarts/cnc_remastered_collection/blob/master/CnCTDRAMapEditor/Utility/SteamworksUGC.cs): `CnCTDRAMapEditor/Utility/SteamworksUGC.cs`

### Other components

- **Map editor user**
- **Steam services**

## Connections

- Map editor user → Main window: uses
- Application startup → Game asset archives: loads archives
- Application startup → Texture manager: initializes
- Application startup → Tileset manager: initializes
- Application startup → Main window: launches
- Main window → Editor controls: presents
- Main window → Map editing tools: dispatches editing
- Main window → Map and scenario settings: opens settings
- Main window → Map file encoding: loads and saves
- Map editing tools → Map state: edits
- Map editing tools → Undo and redo: records changes
- Map state → Cell grid: uses grid
- Map state → Map entities: contains entities
- Map state → Triggers and teams: contains scenario data
- Editor controls → Map renderer: requests rendering
- Map renderer → Tileset manager: gets tile data
- Tileset manager → Texture manager: uses textures
- Tileset manager → Game asset archives: loads definitions
- Game plugins → Red Alert data: implemented by
- Game plugins → Tiberian Dawn data: implemented by
- Application startup → Steam Workshop integration: initializes optionally
- Steam Workshop integration → Steam services: uses Workshop API
