XnGine Framework

Reverse engineering and mod support for classic Bethesda-era XnGine titles

Personal reverse engineering project | MO2 plugin framework | Ongoing toward 1.0

Project Information

Project type
Reverse engineering + framework engineering
Primary stack
C++20, CMake, Qt6, MO2 plugin architecture
Examples of supported games
Arena, Battlespire, Daggerfall, Redguard
Historical context
Bethesda's in-house XnGine era (mid-to-late 1990s), before the early-2000s shift to NetImmerse/Gamebryo-era technology
Current status
Approaching 1.0 release readiness
Core objective
Reverse engineer and implement full mod-relevant format coverage
Patch formats
.xdelta/.xdelta3/.vcdiff/.ips/.bps/.ups/.ppf + JSON byte-patch catalogs
Remaining 1.0 items
Cross-game compatibility hardening, Redguard stability, broader regression replay
Repository
LegendMaster03/modorganizer-game_xngine

Overview

XnGine Framework is a C++ MO2 plugin suite that combines reverse engineering, binary format tooling, and runtime patch orchestration for classic Bethesda XnGine games. The implementation is split between a shared core (src/xngine) and per-game plugin modules (src/games/arena, src/games/battlespire, src/games/daggerfall, and src/games/redguard).

The project is not a thin launcher wrapper. It implements format readers/writers, save integration, mod-data validation, patch discovery, patch application, and defensive diagnostics so legacy game content can be managed through MO2's virtualized workflow without destructive base-install edits.

Technical Stack and Build System

Historical Significance

This project targets Bethesda's in-house XnGine generation from the mid-to-late 1990s, including games like Daggerfall (1996), Battlespire (1997), and Redguard (1998). That period predates Bethesda's early-2000s transition toward NetImmerse/Gamebryo-era technology (Morrowind released in 2002).

There is also conceptual continuity with later Bethesda tooling. For example, BSA archive usage appears in this earlier era, and archive-centric content packaging remained important in later Bethesda mod ecosystems. While engine internals changed significantly over time, several mod-relevant content-delivery ideas persisted.

Reverse Engineering Focus

The reverse engineering objective is format-level operational coverage: identify mod-relevant formats, decode undocumented structures, and convert that knowledge into parser behavior that survives real mod packages.

Supported games currently include titles such as Arena, Battlespire, Daggerfall, and Redguard, with the broader long-term objective remaining full coverage of mod-relevant formats across the XnGine ecosystem.

Core Architecture and Game Modules

The shared core exposes reusable features for save discovery, mod-data checking, archive operations, and patch tooling. Game modules register specialized behavior on top of that foundation (game IDs, executable layouts, save naming conventions, extension handling, and content signatures).

Patch Pipeline and Runtime Safety

Patching is implemented as controlled runtime staging. Instead of mutating the base install, patch outputs are generated into temporary MO2-managed output paths, then cleaned up after run completion.

Format Operations and Archive Engineering

Archive handling is implemented as a first-class subsystem, not a one-off utility. BSA workflows include both unpack and pack paths, archive trait customization, known-archive index mapping, and optional manifest files to preserve deterministic archive construction rules.

Mod Intake, Validation, and Defensive Checks

Mod intake logic is intentionally defensive. The pipeline detects patch payloads, classic archive payloads, and risky installer-style payloads (batch/executable/self-extracting patterns) before they are treated as safe content.

Current State (Toward 1.0)

Current work is in late-stage MVP hardening. Core architecture and major patch flows are implemented across Arena, Daggerfall, Battlespire, and Redguard, with most remaining effort focused on compatibility regression depth, edge-case hardening, and release-stability validation.

Based on the current progress baseline, Arena and Daggerfall are near complete for defined 1.0 MVP scope, Battlespire is in late polish, and Redguard remains the main remaining depth area for format and stability parity.

Architecture: Reverse Engineering to Runtime Patching

Reverse engineered format knowledge is translated directly into runtime patch workflows. Rather than editing installed game files, patched outputs are generated at launch into a temporary hidden mod and removed on game close.

This allows legacy file formats to function within MO2's VFS model while preserving install integrity and supporting normal mod-manager operations like adding, removing, and reordering mods.

Why The Reverse Engineering Matters

For legacy engines, tooling quality is limited by format understanding. Without reliable reverse engineering, mod management becomes manual, brittle, and difficult to reproduce.

This project improves that foundation by turning undocumented or weakly documented format behavior into usable, testable tooling that fits modern mod workflows.

Remaining 1.0 Milestones

Completing these items will move the framework from advanced implementation to a release-ready 1.0 baseline with stronger reproducibility and safer long-term maintenance.

Technical Documentation

This project includes direct engineering documentation and implementation references. These are the primary technical sources I use for architecture decisions, compatibility tracking, and reverse-engineering validation.

Primary Documentation

Core Implementation References

Game-Specific Technical References

Repository

View on GitHub