Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches: [main, "claude/**"]
pull_request:
branches: [main]

jobs:
test:
name: Smoke tests — Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run tests
run: python -m pytest tests/ -v --tb=short

lint:
name: Import sanity check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check all modules import cleanly
run: |
python -c "
import sys, importlib, pathlib
sys.path.insert(0, '.')
failures = []
for f in pathlib.Path('src').rglob('*.py'):
mod = str(f).replace('/', '.').replace('.py', '')
try:
importlib.import_module(mod)
except Exception as e:
failures.append(f'{mod}: {e}')
if failures:
print('IMPORT FAILURES:')
for fail in failures:
print(' ', fail)
sys.exit(1)
print(f'All {len(list(pathlib.Path(\"src\").rglob(\"*.py\")))} modules import cleanly.')
"
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
__pycache__/
*.pyc
*.pyo
*.pyd
.pytest_cache/
dist/
build/
*.spec
output/
mission_history.json
*.miz
*.txt.bak
104 changes: 104 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# DCS Mission Manager — Claude Context

## Project Overview

DCS Mission Generator v2.0 is a Python tool that generates realistic DCS World `.miz` mission files from plain-English descriptions. Users describe a mission (e.g., "SEAD mission in the F-16 on Caucasus with SA-11s") and the tool builds a complete, playable mission with waypoints, threat placement, friendly packages, briefings, and win/loss conditions.

Comment on lines +1 to +6

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title suggests this change only adds CLAUDE.md, but the diff includes substantial functional changes (new maps, kneeboard PNG generation, validator changes, CI workflow, packaging config, etc.). Please update the PR title/description to reflect the full scope, or split into smaller PRs to make review and rollback safer.

Copilot uses AI. Check for mistakes.
**No external Python dependencies** — stdlib only, with optional Ollama (local LLM) for natural language parsing.

## Running the Project

```bash
# Console interface
python main.py

# Headless generation (no interactive prompt)
python main.py --generate "SEAD in the F-16 on Persian Gulf, hard"

# GUI interface (tkinter)
python gui.py

# Run tests
python -m pytest tests/ -v

# Build standalone Windows EXE
build_exe.bat
```

**Console commands:** `quick <desc>`, `maps`, `examples`, `history`, `campaign`, `settings`, `quit`

## Architecture

```
main.py Console entry point
gui.py GUI entry point (tkinter)
tests/
test_smoke.py 22-test smoke suite (units, maps, builder, kneeboard)
src/
generators/
mission_builder.py Core: plan → mission data structures
lua_generator.py Mission data → DCS Lua table files
miz_packager.py Lua files → .miz zip archive (incl. kneeboard PNG)
briefing_generator.py 13-section tactical briefing generator
kneeboard_generator.py Pure-stdlib PNG renderer for DCS kneeboard cards
llm/
ollama_client.py Ollama REST API client
mission_parser.py Natural language → structured plan (LLM + fallback)
maps/
caucasus.py Caucasus map
syria.py Syria map
cold_war_germany.py Cold War Germany map
persian_gulf.py Persian Gulf map (UAE, Iran, Strait of Hormuz)
mariana_islands.py Mariana Islands map (Guam, Saipan, Pacific carrier ops)
units.py Aircraft, SAM, ground unit databases
difficulty.py Easy/Medium/Hard scaling logic
naming.py Operation name generator
callsigns.py Callsign and frequency assignment
flight_profile.py Altitude/speed/fuel calculations
mission_events.py Radio messages, win/loss, reinforcements
campaign.py Campaign system with debrief logic
custom_mods.py JSON mod loader for custom aircraft
dcs_detect.py DCS install auto-detection and deploy
validator.py Pre-flight mission validation
history.py Mission log tracker (JSON)
custom_aircraft/ User-extensible aircraft mod configs (JSON)
```

## Key Concepts

- **Mission plan**: A structured dict produced by `mission_parser.py` from user input — contains aircraft, map, task type, difficulty, threat types, etc.
- **Mission builder**: `src/generators/mission_builder.py` takes a plan and produces DCS-ready data structures (waypoints, units, groups, etc.).
- **Lua generator + packager**: Converts data structures to DCS Lua tables, then zips them into a `.miz` file. The packager also renders a kneeboard PNG card and places it inside `KNEEBOARD/<aircraft_type>/` in the archive.
- **Custom aircraft**: Drop a JSON file in `custom_aircraft/` following `_template.json` to add modded aircraft without editing source.
- **Multiplayer**: Set `player_count` > 1 to generate co-op slots (slot 1 = `Player` skill, additional slots = `Client` skill for DCS multiplayer).

## Player Aircraft

F-16C Viper, F/A-18C Hornet, F-15C Eagle, F-15E Strike Eagle, AV-8B Harrier II, Mirage 2000C, A-10C II Thunderbolt, JF-17 Thunder, AH-64D Apache — plus any custom mods in `custom_aircraft/`.

## Maps

Caucasus, Syria, Cold War Germany, Persian Gulf, Mariana Islands.

## Mission Types

SEAD, CAS, CAP, Strike, Anti-Ship, Escort, Convoy Attack, Convoy Defense, CSAR, FAC(A).

## Code Style

- Python 3.10+, snake_case functions/variables, CamelCase classes
- Type hints used throughout (e.g., `str | None`, `list[dict]`)
- Module-level docstrings on all source files
- No linting or formatting tools are configured — follow existing style

## Testing

```bash
python -m pytest tests/ -v
```

22 smoke tests cover: unit registry, map registry, flight profiles, mission builder (incl. multiplayer slots), kneeboard PNG generation, naming, and difficulty scaling. Run these after any change to verify nothing is broken.

## Output

Generated `.miz` files are saved to the current directory (or auto-deployed to DCS Saved Games if DCS is detected). Each `.miz` includes an embedded kneeboard card PNG. `mission_history.json` is auto-created to log generated missions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Generate realistic DCS World `.miz` mission files from plain English description
## Quick Start

```
cd dcs-mission-gen
cd DCS-Mission-Manager
python main.py
DCS-MG> SEAD mission in the F-16 on Caucasus with SA-11s. Hard difficulty.
```
Expand Down Expand Up @@ -172,14 +172,13 @@ Run `python gui.py` for a dark military-themed desktop interface with:
## Project Structure

```
dcs-mission-gen/
DCS-Mission-Manager/
├── main.py Console entry point
├── gui.py GUI entry point (tkinter)
├── build_exe.bat Windows EXE builder
├── custom_aircraft/ Drop mod JSON configs here
│ ├── _template.json Template with instructions
│ └── F-22A.json F-22 Raptor mod (included)
├── output/ Generated .miz files
└── src/
├── units.py Aircraft, SAM, ground unit databases
├── difficulty.py Easy/medium/hard scaling
Expand All @@ -205,3 +204,11 @@ dcs-mission-gen/
├── miz_packager.py Lua files → .miz zip archive
└── briefing_generator.py Full 13-section tactical briefing
```

## Output

Generated `.miz` files are saved to the current directory by default. If DCS is detected, the tool offers to auto-deploy directly to your `Saved Games/DCS/Missions/Generated/` folder.
Comment thread
2DoorDevelopment marked this conversation as resolved.
Outdated

## License

MIT License — © 2026 2DoorDevelopment
Loading
Loading