# electronicarts/cnc_renegade architecture

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

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

## Overview

##### Main Components
- Game Engine Core – This includes modules such as “Combat” (game logic, physical simulation, game object management, audio, etc.) and “Commando” (client UI, network handling, gameplay client logic). These are the heart of the game.
- Tools and Utilities – There are multiple subdirectories under “Code/Tools” (such as LevelEdit, MixViewer, RenegadeGR, and many others) that provide support for asset management, level editing, packaging, and updates.
- Installer and Launcher – The “Code/Installer” and “Code/Launcher” directories contain the logic for setting up the game and patching/updating. They also interact with other utility libraries.
- Scripting and Test Suites – “Code/Scripts” and “Code/Tests” hold mission scripts, gameplay event definitions, test harnesses (for collisions, physics, bit packing, etc.), and provide validation for engine components.
- Libraries – The “Code/Libs” directory and several utility directories (like “WWLib” and “WWUI”) provide lower-level functionality, abstractions, and shared code.
- External Dependencies – List the external SDK dependencies from the README (DirectX SDK, RAD Bink, RAD Miles, NvDXTLib, Lightscape, Umbra, GameSpy, GNU Regex, SafeDisk, Microsoft Cab API, RTPatch, and Java Runtime Headers) as external modules connected to the respective subsystems that rely on them.

##### Relationships and Data Flow
- The Game Engine Core interacts closely with the external SDKs – for example, DirectX for rendering, RAD Bink for video playback, RAD Miles for audio, etc.
- Tools and utilities (LevelEdit, MixViewer, etc.) rely on the same libraries that provide low-level rendering, asset management, and game data persistence. Connect these utilities to the “Core Libraries” block, showing dependency on shared code.
- The installer and launcher interact with the game engine binary by packaging and then deploying the final executable to the “Run” directory.

##### Architectural Patterns and Design Principles
- Modular Architecture: The code is separated by purpose into dedicated directories for game logic, UI, utilities, and tests.
- Separation of Concerns: The engine core (game loop, physics, rendering, network communication) is separate from the packaging/installation and editing tools.
- Legacy Integration with External SDKs: Display how external dependencies (DirectX, RAD SDKs, etc.) are integrated into the modules—indicating expected paths for each dependency.
- Legacy Build Process: The build system relies on Microsoft Visual Studio C++ 6.0 project files (and conversions for modern MSVC), which is an important consideration for understanding compile-time dependencies.

##### Detail Without Over-complicating
- That every module (Engine, Tools, Installer/Launcher, Shared Libraries, External Dependencies) is represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Game Engine Core"
        A1["Combat Engine"]:::engine
        A2["Commando (Client UI & Networking)"]:::engine
    end

    subgraph "Tools and Utilities"
        B1["LevelEdit Tool"]:::tools
        B2["Auxiliary Tools"]:::tools
    end

    subgraph "Installer & Launcher"
        C1["Installer"]:::installer
        C2["Launcher"]:::installer
    end

    subgraph "Scripting & Test Suites"
        D1["Scripting"]:::scripts
        D2["Tests"]:::scripts
    end

    subgraph "Libraries & Shared Code"
        E1["Core Libraries"]:::libs
        E2["WWAudio"]:::libs
        E3["WWMath"]:::libs
        E4["WWOnline"]:::libs
        E5["WWUI"]:::libs
    end

    F["External SDKs"]:::external

    G["Run Directory"]:::runtime

    %% Relationships between Game Engine components
    A2 -->|"networkPackets"| A1
    A1 -->|"gameData"| A2

    %% Engine integration with External SDKs
    A1 -->|"SDKcalls"| F
    A2 -->|"SDKcalls"| F

    %% Tools interaction with External SDKs and Shared Libraries
    B1 -->|"SDKcalls"| F
    B2 -->|"SDKcalls"| F
    B1 -->|"assetUpdates"| E1
    B2 -->|"assetUpdates"| E1
    B1 -->|"utilize"| E2
    B1 -->|"utilize"| E3
    B1 -->|"utilize"| E4
    B1 -->|"utilize"| E5
    B2 -->|"utilize"| E2
    B2 -->|"utilize"| E3
    B2 -->|"utilize"| E4
    B2 -->|"utilize"| E5

    %% Engine sharing functionality with Libraries
    A1 -->|"sharedFunc"| E1
    A2 -->|"sharedFunc"| E1

    %% Scripting and Tests interaction with the Engine
    A1 -->|"eventTriggers"| D1
    A2 -->|"eventTriggers"| D1
    A1 -->|"validation"| D2
    A2 -->|"validation"| D2

    %% Installer & Launcher deploy built binaries to Run Directory
    C1 -->|"buildOutput"| G
    C2 -->|"buildOutput"| G

    %% Styles
    classDef engine fill:#ffcccc,stroke:#c00,stroke-width:2px;
    classDef tools fill:#ccffcc,stroke:#080,stroke-width:2px;
    classDef installer fill:#cceeff,stroke:#008,stroke-width:2px;
    classDef scripts fill:#ffffcc,stroke:#aa0,stroke-width:2px;
    classDef libs fill:#ffebcc,stroke:#a52a2a,stroke-width:2px;
    classDef external fill:#e6e6fa,stroke:#4b0082,stroke-width:2px;
    classDef runtime fill:#dcdcdc,stroke:#696969,stroke-width:2px;

    %% Click Events for Component Mapping
    click A1 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Combat"
    click A2 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Commando"
    click B1 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Tools/LevelEdit"
    click B2 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Tools"
    click C1 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Installer"
    click C2 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Launcher"
    click D1 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Scripts"
    click D2 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Tests"
    click E1 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/Libs"
    click E2 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/WWAudio"
    click E3 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/WWMath"
    click E4 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/WWOnline"
    click E5 "https://github.com/electronicarts/cnc_renegade/tree/main/Code/WWUI"
```
