# sandern/lambdawars architecture

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

- Interactive diagram: https://gitdiagram.com/sandern/lambdawars
- Repository: https://github.com/sandern/lambdawars

## Overview

Lambda Wars is a Source-engine real-time strategy game. Its documented unit workflow runs event-driven AI behaviors and actions, uses the unit navigator to manage routes and avoidance, and relies on Recast meshes for pathfinding; units then act in the game world. Python extends game entities and modes, while CEF supports much of the main menu and some in-game UI. The tree exposes only a few game files, not these core implementations, so several documented subsystems use their observed enclosing directories and their internal wiring is left unspecified.

Main entry points: [`src/game/server`](https://github.com/sandern/lambdawars/tree/develop/src/game/server) (Unit navigator), [`src/game`](https://github.com/sandern/lambdawars/tree/develop/src/game) (Python bindings), [`src`](https://github.com/sandern/lambdawars/tree/develop/src) (CEF interface), [`src/materialsystem/stdshaders/Engine_Post_dx9.cpp`](https://github.com/sandern/lambdawars/blob/develop/src/materialsystem/stdshaders/Engine_Post_dx9.cpp) (Custom shaders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game runtime"]
  node_units["Game units"]
  node_unit_ai["Unit AI"]
  node_behaviors["Behaviors and actions"]
  node_ragdoll_manager["Ragdoll management"]
  node_client_ragdoll["Client ragdoll manager"]
  node_game_interfaces["Engine interfaces<br/>[IRunGameEngine.h]"]
end

subgraph group_navigation["Unit navigation"]
  node_unit_navigator["Unit navigator"]
  node_recast["Recast navigation"]
  node_obstacles["Navigation obstacles"]
end

subgraph group_extensions["Game extensions"]
  node_python_game["Python game code"]
  node_python_bindings["Python bindings"]
end

subgraph group_presentation["Player experience"]
  node_cef_ui["CEF interface"]
  node_custom_shaders["Custom shaders"]
end

node_player(("Player"))
node_engine["Source engine"]

node_player -->|"uses menu"| node_cef_ui
node_cef_ui -.->|"requests game actions"| node_python_game
node_python_game -->|"extends through"| node_python_bindings
node_python_bindings -->|"binds engine code"| node_engine
node_engine -->|"runs game"| node_units
node_units -->|"uses AI"| node_unit_ai
node_unit_ai -->|"selects actions"| node_behaviors
node_unit_navigator -->|"queries paths"| node_recast
node_unit_navigator -->|"accounts for"| node_obstacles
node_engine -->|"dispatches movement"| node_unit_navigator
node_engine -->|"updates ragdolls"| node_ragdoll_manager
node_engine -->|"updates client ragdolls"| node_client_ragdoll
node_engine -->|"uses interfaces"| node_game_interfaces
node_custom_shaders -->|"renders effects"| node_engine

click node_units "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_unit_ai "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_behaviors "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_unit_navigator "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_recast "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_obstacles "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_python_game "https://github.com/sandern/lambdawars/tree/develop/src/game/server"
click node_python_bindings "https://github.com/sandern/lambdawars/tree/develop/src/game"
click node_cef_ui "https://github.com/sandern/lambdawars/tree/develop/src"
click node_custom_shaders "https://github.com/sandern/lambdawars/blob/develop/src/materialsystem/stdshaders/Engine_Post_dx9.cpp"
click node_ragdoll_manager "https://github.com/sandern/lambdawars/blob/develop/src/game/server/ragdoll_manager.cpp"
click node_client_ragdoll "https://github.com/sandern/lambdawars/blob/develop/src/game/client/c_ragdoll_manager.cpp"
click node_game_interfaces "https://github.com/sandern/lambdawars/blob/develop/src/common/IRunGameEngine.h"

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_units,node_unit_ai,node_behaviors,node_ragdoll_manager,node_client_ragdoll,node_game_interfaces toneBlue
class node_unit_navigator,node_recast,node_obstacles toneAmber
class node_python_game,node_python_bindings toneMint
class node_cef_ui,node_custom_shaders toneRose
class node_player,node_engine toneIndigo
```

## Components

### Game runtime

- [Game units](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Unit AI](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Behaviors and actions](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Ragdoll management](https://github.com/sandern/lambdawars/blob/develop/src/game/server/ragdoll_manager.cpp): `src/game/server/ragdoll_manager.cpp`
- [Client ragdoll manager](https://github.com/sandern/lambdawars/blob/develop/src/game/client/c_ragdoll_manager.cpp): `src/game/client/c_ragdoll_manager.cpp`
- [Engine interfaces](https://github.com/sandern/lambdawars/blob/develop/src/common/IRunGameEngine.h): `src/common/IRunGameEngine.h`

### Unit navigation

- [Unit navigator](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Recast navigation](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Navigation obstacles](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`

### Game extensions

- [Python game code](https://github.com/sandern/lambdawars/tree/develop/src/game/server): `src/game/server`
- [Python bindings](https://github.com/sandern/lambdawars/tree/develop/src/game): `src/game`

### Player experience

- [CEF interface](https://github.com/sandern/lambdawars/tree/develop/src): `src`
- [Custom shaders](https://github.com/sandern/lambdawars/blob/develop/src/materialsystem/stdshaders/Engine_Post_dx9.cpp): `src/materialsystem/stdshaders/Engine_Post_dx9.cpp`

### Other components

- **Player**
- **Source engine**

## Connections

- Player → CEF interface: uses menu
- CEF interface → Python game code: requests game actions
- Python game code → Python bindings: extends through
- Python bindings → Source engine: binds engine code
- Source engine → Game units: runs game
- Game units → Unit AI: uses AI
- Unit AI → Behaviors and actions: selects actions
- Unit navigator → Recast navigation: queries paths
- Unit navigator → Navigation obstacles: accounts for
- Source engine → Unit navigator: dispatches movement
- Source engine → Ragdoll management: updates ragdolls
- Source engine → Client ragdoll manager: updates client ragdolls
- Source engine → Engine interfaces: uses interfaces
- Custom shaders → Source engine: renders effects
