Skip to content

Repository files navigation

Nuclear Option Modding SDK

Target Game Python Package Manager .NET SDK Mod Framework Mod Manager Protocol

Platform Test Suite

NuclearEngine is a development toolkit and code intelligence system for the combat flight simulator Nuclear Option. It provides reverse engineering tools, a token-efficient code indexer, automated BepInEx mod scaffolding, compilation and deployment pipelines, and a Model Context Protocol (MCP) server for integration with development environments.


Philosophy: AI-Assisted Modding and Accessibility

Modding a compiled game often presents a steep barrier to entry: developers must navigate hundreds of decompiled C# source files, understand undocumented internal engine lifecycles, and master Harmony bytecode patching conventions. For beginners, this steep learning curve can easily lead to frustration; for experienced programmers, searching through thousands of lines of decompiled assemblies is repetitive and time-consuming.

Artificial intelligence serves as a practical developer tool in this workflow. Using AI as an assistive coding partner is not a shortcut that replaces programming skill, but an effective way to accelerate reverse engineering, locate relevant game APIs, and clarify obscure internal logic. This toolkit was intentionally designed to support AI collaboration, providing token-efficient queries and a native Model Context Protocol (MCP) server so that human developers and AI assistants alike can explore Nuclear Option's codebase without exceeding context windows.

Whether you write every line of code by hand, collaborate with an AI assistant, or are building your very first game mod, the objective of this project is to demystify the game's internal systems and make mod development accessible, transparent, and approachable for everyone.


Requirements

  • Operating System: Windows 10 or 11
  • Python: 3.12 or newer, managed via Astral uv
  • .NET SDK: .NET 8.0 or 9.0 SDK installed (providing Roslyn compiler csc)
  • Game: Nuclear Option installed via Steam

Setup

Synchronize dependencies with uv:

uv sync

Decompile the game's core assembly (Assembly-CSharp.dll):

uv run no decompile

Generate the publicized reference assembly for full IDE autocomplete:

uv run no publicize

Mod Development and Code Intelligence

The CLI provides targeted query commands to extract specific class members, methods, and call hierarchies without reading complete multi-thousand-line C# files into context.

Class and Method Queries

# View class inheritance, interfaces, fields, and method signatures
uv run no api Aircraft
uv run no api Radar

# Extract only the implementation source code of a specific method
uv run no method Aircraft LockedByMissile
uv run no method Radar WarningFlash

# Generate a BepInEx Harmony patch template for a method
uv run no hook Aircraft LockedByMissile
uv run no hook Radar EstimateDetection --patch-type Postfix

Call Hierarchy and Inheritance

# Locate all call sites and references to a method, field, or event
uv run no callers LockedByMissile

# Display all classes that inherit from a specified base class or interface
uv run no subclasses Unit
uv run no subclasses MonoBehaviour

# List nested structs defined in a class
uv run no structs MissileWarning

# List C# events defined in a class
uv run no events Aircraft

# View enum values by class name or enum name
uv run no enums SeekerMode
uv run no enums UnitState

API Search

# Search for methods and signatures across all 1,200+ game classes
uv run no sim "Radar"
uv run no sim "Countermeasure"

Machine-Readable JSON Output

All code inspection commands support the --json (-j) flag to output structured JSON data for scripting, editor extensions, and external tooling:

uv run no api Aircraft --json
uv run no method Aircraft LockedByMissile --json
uv run no hook Aircraft LockedByMissile --json
uv run no callers LockedByMissile --json
uv run no subclasses Unit --json
uv run no enums SeekerMode --json

Mod Build and Deployment Pipeline

The SDK includes a build and packaging pipeline tailored for BepInEx 5 plugins:

1. Scaffold a New Mod

uv run no new-mod CombatTracker

Creates a project directory under plugins/CombatTracker/ containing a .csproj and boilerplate Plugin.cs with an initial Harmony patch.

2. Compile the Mod

uv run no build CombatTracker

Compiles the C# plugin using the Roslyn compiler directly against the game's managed assemblies, runtime libraries, BepInEx core, and the publicized Assembly-CSharp.dll.

3. Deploy to the Game

uv run no deploy CombatTracker

Compiles the mod and copies the resulting DLL directly to the Steam game installation directory: <SteamPath>/Nuclear Option/BepInEx/plugins/<ModName>.dll.

4. Verify Harmony Patches

Validate that all [HarmonyPatch] attributes in your mod target classes and methods that actually exist in the current game version:

uv run no verify-patches CombatTracker
uv run no verify-patches CombatTracker --json

5. Generate Mod Configuration

Add a typed BepInEx configuration boilerplate (ModConfig.cs) to your mod:

uv run no add-config CombatTracker

6. Package for NOMM and Thunderstore

Package your mod into a distribution zip archive containing dual layouts for Nuclear Option Mod Manager (NOMM), the NOMNOM registry, and Thunderstore:

uv run no pack CombatTracker
uv run no pack CombatTracker --json

Output is written to dist/<ModName>_<Version>.zip containing manifest.json, nomnom.json, icon.png, README.md, and standard BepInEx/plugins/<ModName>/ binaries, ready for one-click installation via NOMM or upload to Thunderstore.

7. Hot-Reload File Watcher

Automatically watch mod source files and trigger instantaneous recompilation and deployment upon saving:

uv run no watch CombatTracker

The watcher recompiles with publicized assemblies and deploys the resulting DLL to Steam BepInEx plugins in under 600 ms.

8. Launch Game

uv run no run-game

Launches Nuclear Option through Steam protocol.


Log Viewer and Diagnostics

Inspect and stream logs from the game and BepInEx mods with syntax highlighting:

# View last 50 lines of BepInEx mod logs
uv run no logs

# View last 100 lines of Unity engine logs (Player.log)
uv run no logs --source player -n 100

# Show only warnings and errors
uv run no logs --errors-only

# Stream logs live in real time during flight
uv run no logs --follow

# Output logs in JSON format
uv run no logs -n 25 --json

Multi-Assembly Decompilation

In addition to Assembly-CSharp.dll, the SDK can decompile and index any managed game assembly (e.g., Mirage multiplayer networking, Rewired input):

# Decompile Mirage networking stack
uv run no decompile Mirage

# Decompile Rewired input manager
uv run no decompile Rewired_Core

Decompiled sources are saved to no_code_analysis/source/<Assembly>/ and are immediately searchable via api, method, sim, and callers.


Assembly Publicizer and IntelliSense

Unity game assemblies enforce private and internal access restrictions on internal fields and methods. The SDK incorporates an assembly publicizer that rewrites metadata flags to public:

uv run no publicize

The output is written to lib/publicized/Assembly-CSharp.dll.


IDE Integration and Autocomplete

The SDK provides automatic configuration for Visual Studio, JetBrains Rider, and VS Code (C# Dev Kit and OmniSharp):

uv run no sync-ide

Components Configured

  1. Master Solution (plugins/NuclearMods.sln): Automatically discovers and links all mod projects in the plugins/ folder.
  2. Global MSBuild Properties (plugins/Directory.Build.props): Automatically provides references to Assembly-CSharp.dll (publicized), Mirage.dll, UnityEngine.dll, and BepInEx for every mod project without manual XML editing.
  3. C# XML Documentation Tooltips (lib/publicized/Assembly-CSharp.xml): Injects docstrings into the publicized assembly so that hovering over classes and methods (Aircraft.LockedByMissile, Radar.EstimateDetection, Missile.Explode) displays descriptive summaries directly in your editor.
  4. Native dotnet build Compatibility: Mods can be compiled directly through your editor or terminal (dotnet build) with zero NuGet restore errors or missing assembly warnings.

Model Context Protocol (MCP) Server

The SDK implements an MCP server over standard I/O (JSON-RPC 2.0), allowing AI-assisted IDEs (Antigravity IDE, Cursor, Claude Desktop, Windsurf) to call code intelligence tools directly:

uv run no mcp

Registered Tools

  • get_class_api: Returns class hierarchy, fields, methods, structs, events, and enums.
  • get_method_code: Extracts method source code and line numbers.
  • generate_harmony_hook: Generates BepInEx Harmony prefix/postfix patches.
  • find_callers: Finds references across all source files.
  • find_subclasses: Finds derived classes for any base type.
  • find_enums: Queries enum definitions and values.
  • search_code: Searches methods and signatures matching a keyword.
  • analyze_mission: Evaluates tactical threats and force balance in a mission scenario.

Workspace configuration is located in .agents/mcp_config.json.


Interactive Terminal Interface

An interactive terminal interface provides keyboard-driven query capabilities:

uv run no tui

Enter a search term (e.g., Aircraft, Radar, LockedByMissile, subclasses Unit). Press Enter to display the matching API overview, source code, Harmony hook, or callers. Press Esc or type clear to return to the search view. Press q to exit.


Mission and Tactical Analysis

The domain module parses Nuclear Option scenario files (mission.json) from the Mission Editor directory:

# Discover local user missions
uv run no missions

# Run tactical analysis on a specific mission
uv run no analyze "MissionName"

# Inspect unit database (aircraft, air defenses, warships)
uv run no units
uv run no units --category aircraft

# Inspect missile guidance envelopes and countermeasure profiles
uv run no weapons

# Compute pulse-Doppler radar notch gate status
uv run no doppler 250 85

Airframe and Hardpoint Intelligence

Inspect vehicle performance, radar cross sections (RCS), countermeasure reserves, and weapon station layouts:

# List all indexed vehicles and flight metrics
uv run no vehicles

# Inspect Revoker fighter specifications and hardpoint stations
uv run no vehicle revoker

# Inspect stealth bomber hardpoints and loadout compatibility in JSON format
uv run no vehicle darkreach --json

Offline API Documentation

Generate a standalone, client-side searchable HTML and JSON documentation portal for all 1,200+ decompiled game classes:

uv run no docs

The documentation is written to docs/api/index.html and can be opened in any web browser completely offline.


Tactical Mission Map

Render a 2D radar plot of airbases, factories, SAM batteries, and naval units from mission scenarios:

# Render terminal ASCII radar map
uv run no mission-map "Defend"

# Export vector SVG tactical map
uv run no mission-map "Defend" --svg

# Generate interactive HTML Tactical War Room map with live contact inspection
uv run no mission-map "Defend" --web

Multiplayer and Network RPC Inspector

Inspect Mirage networking endpoints, remote procedure calls, and synchronized variables across the game:

# List all RPCs and SyncVars in the Aircraft class
uv run no rpc Aircraft

# Find all ServerRpc endpoints involving missile locks or launches
uv run no rpc --type ServerRpc -q Lock

# Output complete network RPC schema as JSON
uv run no rpc --json

Programmatic Mission Scenario Generator

Generate complete, valid mission.json scenarios with airbases, aircraft spawns, weapon loadouts, and objectives directly into Nuclear Option's MissionEditor:

# Generate dogfight skirmish scenario (Player Revoker vs 2 AI bandits)
uv run no new-mission "AlphaInterception" --preset dogfight

# Generate precision strike scenario against radar and SAM defense network
uv run no new-mission "RadarStrike" --preset strike

# Generate anti-ship naval interdiction scenario
uv run no new-mission "ConvoyHunt" --preset naval_patrol

Audio and Voice Warning Catalog

Inspect game sound effects, SoundManager triggers, and cockpit voice alert hooks:

# List all cockpit voice warnings (stall, overspeed, gear warnings)
uv run no audio --category VoiceWarning

# List sound effects associated with weapons or combat HUD
uv run no audio --class CombatHUD

# Output all audio hooks as JSON
uv run no audio --json

Real-Time Flight Telemetry

Sample live UDP flight telemetry broadcast by the NuclearTelemetry mod on port 8766:

# Sample live telemetry packets and display cockpit HUD
uv run no telemetry --port 8766 --packets 20

Mission Validator and Scenario Linter

Inspect and lint custom mission scenarios for structural faults, missing target entities, ground collisions, and faction mismatches before launching the game:

# Validate an editor scenario or mission folder
uv run no validate-mission "Defend"

# Validate a specific mission.json file directly
uv run no validate-mission "path/to/mission.json"

# Output validation issues in JSON format
uv run no validate-mission "Defend" --json

Harmony CIL OpCode and Transpiler Inspector

Disassemble game methods to raw CIL instructions and generate Harmony Transpiler templates:

# Disassemble a method to its raw CIL bytecode table
uv run no il RadarWarning.Start

# Generate Harmony CodeMatcher C# boilerplate for transpiler development
uv run no il RadarWarning.Start --matcher

Aircraft Livery and Texture Toolchain

Scaffold aircraft skin mods with texture directories, metadata, and automated BepInEx texture loaders:

# Scaffold a custom livery package for the Revoker
uv run no new-livery revoker GhostSquadron --author "AcePilot"

The resulting folder in skins/ contains livery.json, placeholder texture maps, and a compilable C# BepInEx loader plugin that applies textures dynamically at runtime.


Performance and Anti-Stutter Code Auditor

Statically scan mod C# source code for common frame-drop traps and garbage collection spikes in 60 to 144 FPS combat flight simulations:

# Audit a mod in the plugins/ directory
uv run no audit NuclearTelemetry

# Output audit findings as JSON
uv run no audit NuclearTelemetry --json

The auditor flags un-cached GetComponent<T>() calls in Update(), scene searches (FindObjectsOfType), LINQ heap allocations in per-frame loops, and blocking file or network I/O.


Directory Structure

GameEngine/
├── .agents/
│   └── mcp_config.json        # MCP server configuration for IDE integration
├── .vscode/
│   ├── tasks.json             # Build, deploy, and launch tasks
│   └── launch.json            # Unity debugger attachment configuration
├── lib/
│   └── publicized/            # Publicized game assemblies for IDE autocomplete
├── no_code_analysis/          # Decompiled C# sources and decompiler cache
├── nuclear_engine/
│   ├── builder/               # Mod build and deployment pipeline
│   ├── domain/                # Data models for missions, units, weapons
│   ├── extractor/             # Code indexer, decompiler, publicizer
│   ├── tactical_advisor/      # Combat math and mission analysis
│   ├── telemetry/             # Network models for flight telemetry
│   ├── cli.py                 # Command-line interface entry point
│   ├── config.py              # Path resolution (Steam, AppData, Managed)
│   ├── mcp_server.py          # Native Model Context Protocol server
│   └── tui.py                 # Interactive terminal search interface
├── plugins/                   # Source directories for C# BepInEx mods
│   └── NuclearTelemetry/      # Telemetry export plugin
└── tests/                     # Automated test suite

Testing

Run the automated test suite with pytest:

uv run pytest

About

Nuclear Option | SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages