Corsix's Mod Studio: Definitive Edition (CDMS) is a modding IDE for Relic Entertainment's games — primarily Dawn of War (and its expansions Dark Crusade, Soulstorm, Winter Assault) and Company of Heroes. Originally written by Corsix around 2006–2007, this Definitive Edition is a ground-up modernization of the original codebase, bringing it to C++20, 64-bit, and modern tooling while preserving full compatibility with Relic's game file formats.
- SCAR editor with Lua Language Server — real-time diagnostics, autocomplete, hover-to-inspect, go-to-definition, and find-in-file powered by LuaLS, with SCAR API stubs for full engine function coverage
- Hotkey Improvements - Added some common hotkeys to make editor feel more modern. Save with CTRL+S. Use CTRL + TAB to switch tabs. Close tab with CTRL + W. Show autocomplete suggestions with CTRL + SPACE. Etc.
- Preview Tab - Files will open preview on one click for faster navigation
- Performance Improvements — uses multithreading to improve load times and UI responsiveness
- DPI-aware Scaling — updated icons and graphics for modern systems
- Dark Mode - Configurable theming with dark mode support
- Removed broken functionality - Trimmed out or hid functionality that was never used such as the developers big red button, etc.
The software was released as open source under the GNU GPL v2 (CDMS app) and GNU LGPL v2.1 (Rainman library).
The original codebase targets technology from 2006:
| Component | Original | Definitive Edition |
|---|---|---|
| C++ Standard | Pre-C++11 (VS 2003/2005 era) | C++20 |
| Architecture | 32-bit (x86) | 64-bit (x64) |
| wxWidgets | 2.8.0 | 3.2+ |
| Lua | 5.0.2 + 5.1.2 (DLL) | Vendored 5.0.2 + vendored 5.1.2 (static, renamed symbols) |
| zLib | Bundled ancient copy | vcpkg 1.3.1 |
| libsquish | Runtime-loaded DLL | Static link via vcpkg |
| Build System | Manual VS project (COMPILE.txt) | CMake 4.1 + vcpkg + presets |
| Compiler | MSVC 2003/2005 | MSVC 2026 (v19.50) |
| Testing | None | Google Test (635 tests) |
| Static Analysis | None | clang-tidy |
| Memory Management | Raw new/delete throughout |
std::unique_ptr, std::shared_ptr, std::string |
| Concurrency | Single-threaded | Thread pool + async task runners |
| Logging | None | spdlog (structured logging) |
| Script Editor | Basic syntax highlighting | Full LSP integration (LuaLS) |
The software no longer compiled on modern compilers and exhibited bugs on current Windows versions. This project brings it back to life — and significantly beyond the original.
The codebase has three layers
The core I/O library for Relic game file formats. No UI dependencies — pure data parsing and manipulation. Organized into subdirectories: core/, io/, archive/, formats/, lua/, localization/, module/, util/.
Key classes:
CSgaFile— SGA archive reader (v2, v4) with zLib decompressionCSgaCreator— SGA archive writer with parallel compression via thread poolCRgdFile— Binary game data (RGD) with Lua integrationCUcsFile— Unicode localization string tables withCUcsMap(dual ordered/unordered map)CChunkyFile— Relic's chunked container formatCModuleFile— Game mod descriptor (.module files)CResourceLoader— Parallel mod resource loading with deferred error propagationCRgtFile— Texture files (DXT1/3/5, DDS, TGA)IFileStore/CMemoryStore/CFileSystemStore— Polymorphic I/O abstractionCInheritTable— Lua-based data inheritance resolutionCThreadPool— Process-wide thread pool singleton (std::thread::hardware_concurrency()workers)
An intermediate layer between Rainman and the GUI, providing error-safe wrappers and concurrency:
services/—ModuleService,FileService,FormatService,HashServicewrap Rainman calls withResult<T>error handlingasync/—CTaskRunner(pure C++) /CWxTaskRunner(posts results to main thread viaCallAfter) for background work,CCancellationTokenfor cooperative cancellation,CProgressChannelwith Rainman callback bridge
The GUI application uses a Model-View-Presenter (MVP) architecture with 14 presenters and 16 view interfaces for separation of concerns and unit testability.
Presenters (src/cdms/presenters/):
CModuleLoadPresenter, CFileTreePresenter, CScarEditorPresenter, CRgdEditorPresenter, CRgdMacroPresenter, CUcsEditorPresenter, CSgaMakePresenter, CLuaInheritTreePresenter, CModuleSettingsPresenter, CMassExtractPresenter, CImagePresenter, CRefreshFilesPresenter, CUcsToDatPresenter, CDpsCalculatorPresenter
View interfaces (src/cdms/views/interfaces/):
IMainFrameView, IFileTreeView, IScarEditorView, IRgdEditorView, IRgdMacroView, IUcsEditorView, ISgaMakeView, ILuaInheritTreeView, IModuleSettingsView, IMassExtractView, IImageView, IRefreshFilesView, IUcsToDatView, IDpsCalculatorView, ISaveable, ISearchable
Key views:
ConstructFrame— Main window with splitter, AUI notebook tabs, and file treefrmFiles— File browser with tree view, SVG icons, and expand/collapse navigationfrmScarEditor— SCAR script editor with LSP integration, FindBar, hover popup, and go-to-definitionfrmRgdEditor— Property grid editor for RGD game data filesfrmUCSEditor— Unicode string table editorfrmSgaMake— SGA archive creation wizardfrmModule— Mod settings editor (dependencies, data folders, archives)frmLoading— Async loading dialog with progress bar and cancel button
The SCAR editor integrates LuaLS (lua-language-server) for a modern editing experience:
- Real-time diagnostics — errors, warnings, and hints displayed inline with squiggly underlines
- Autocomplete — context-aware completions for SCAR engine functions and mod code
- Hover-to-inspect — rich popup with syntax-highlighted signatures, markdown descriptions, and merged diagnostics
- Go to Definition — Ctrl+Click or F12 to jump to function/variable definitions
- Find in File — VS Code-style Ctrl+F bar with match highlighting, count, and navigation
- SCAR API stubs — auto-generated type definitions for ~500+ Dawn of War and ~1000+ Company of Heroes engine functions (from ScarDoc HTML and scardoc.dat)
--?annotation translation — Relic's--?doc comments are translated on-the-fly to LuaLS-compatible---@param/---@returnannotations- Status bar indicator — real-time LSP status (Idle → Starting → Loading → Ready) with colored dot
- Toggle on/off — View menu option to enable/disable the language server
See docs/lua-language-server-integration.md for detailed documentation.
- Visual Studio 2022 or later (tested with VS 2026 Enterprise)
- vcpkg —
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg && C:\vcpkg\bootstrap-vcpkg.bat - CMake 3.20+ (bundled with Visual Studio)
# Set environment
$env:VCPKG_ROOT = "C:\vcpkg"
# Configure + Build + Test (uses CMake presets)
cmake --preset default
cmake --build --preset debug
ctest --preset debug
# Release build (LTO, static CRT)
cmake --build --preset release
# Static analysis with clang-tidy
cmake --preset tidy
cmake --build --preset tidy-debug
# Run clang-tidy manually
.\tools\run-clang-tidy.ps1 # all sources
.\tools\run-clang-tidy.ps1 src/rainman/archive/CSgaFile.cpp # single file
.\tools\run-clang-tidy.ps1 -Fix # auto-fix- zlib 1.3.1 — compression for SGA archives
- Google Test 1.17 — unit testing framework
- libsquish — DXT texture compression (for CRgtFile)
- wxWidgets 3.x — GUI framework
- spdlog — structured logging
The original code uses two Lua versions for different purposes:
- Lua 5.0.2 — compiled and linked statically for core game data parsing (RGD files use Lua internally)
- Lua 5.1.2 — now statically linked (originally runtime-loaded via
LoadLibraryW). All public symbols are renamed vialua512_rename.h(lua_→lua51_) to avoid linker conflicts with Lua 5.0.2.
We vendor both Lua versions' source directly (including Corsix's patches to ltm.c/h and lvm.c/h in 5.0.2).
The original bundled a modified zlib with a custom crc32_case_idt() function for case-insensitive file path hashing (essential for Windows file system compatibility in Relic's formats). We now use system zlib from vcpkg and extracted crc32_case_idt() into a standalone file with its own CRC table.
Rainman was originally a DLL (__declspec(dllexport/import)). We build it as a static library for simplicity — the only consumer is the CDMS executable. The RAINMAN_NO_EXPORTS define makes RAINMAN_API expand to nothing.
The docs/ directory contains detailed specifications:
architecture.md— System architecture overviewtarget-architecture-v2.md— Target architecture designlua-language-server-integration.md— LuaLS integration design and implementationsga-archive-format.md— SGA archive file format specificationrgd-game-data-format.md— RGD binary data formatrelic-chunky-format.md— Relic Chunky container formatucs-localisation-format.md— UCS localization formatmodule-file-format.md— .module file formatdata-inheritance-system.md— Lua-based data inheritancehash-algorithms.md— Hash algorithms used in Relic formatstexture-material-script-formats.md— Texture and material formatsknown-bugs.md— Known issues and workarounds
- CDMS Application: GNU General Public License v2.0
- Rainman Library: GNU Lesser General Public License v2.1
- Vendored Lua 5.0.2 / 5.1.2: MIT License
- Lucide Icons: ISC License