Open reimplementation · in progress
An incremental open engine for the 1996 Sierra/Impressions strategy game, built the way
OpenXcom was: new code, original data files. The shipped Lords2.exe is kept as an
oracle — ground truth to verify each reimplemented system against, not a thing to patch.
l2-game — the application spine nothing is plugged into yetl2-simKnow the target, and be able to watch it run.
The gate for everything downstream. Each format is validated across the whole corpus, not one lucky sample — PL8 self-verifies because every frame must end exactly on the next frame's declared offset.
.eng text — three unrelated formats sharing an extension.skr battle scenarios — arithmetic closes exactlyWhere the project proper starts. Everything so far is Node prototyping, kept deliberately disposable until the formats were known.
l2-formats crate — PL8 and palette decoders portedA palettised framebuffer mirrors how a 1996 software renderer thinks, so porting drawing code stays close to mechanical.
winit 0.30 window + pixels 0.17 framebufferl2-view — renders real game screens in our own windowThe first milestone that is genuinely a piece of the finished engine rather than
scaffolding — and where the pathing work lives. A battle now runs and draws
itself: real .skr terrain, auto-tiled river banks, a bridge, and both
liveries of men walking, fighting and falling, stepping the simulation tick by tick.
Turns the original binary into a test fixture — and the big lesson of this phase is that the binary is the fixture, not the running game. Reading the executable answers nearly everything, instantly and with no window to steal focus. Launching the original turned out to be the last resort, not the second.
MOV immediates that write themddraw.dll proxy and hard-link sandbox — install untouchedThe turn-based half: the larger and less charted body of rules, and the one place the printed manual has been caught wrong twice. Every economic constant lives in the executable rather than a data file, which is much of the reason to build an open engine at all.
The original's networking is abandoned rather than studied — it is replaced outright, not reimplemented. What matters is determinism, which is a property of the simulation and was designed in from its first line.
The actual destination. Designed in from the first crate rather than retrofitted: rules live in data files, and assets load through an overlay filesystem. Assets shadow; rules accumulate — the asymmetry is deliberate.
| Tool | Does | Verified by |
|---|---|---|
| ddraw-proxy | Injects our code into the original game | Verified: attach, forward, S_OK |
| l2-formats | Rust crate — PL8, palettes, maps, .skr | 291/291 files; 180,224/180,224 tile invariant |
| l2-sim | Battle rules — figures, melee, missiles, movement, pathing | Every ranking the manual states, asserted |
| l2-kingdom | The turn-based economy — 7 phases, 30-pass pipeline | 895 tests; the shipped save reproduced |
| l2-net | Lockstep, canonical encoding, TCP transport | Two peers bit-identical over a real socket |
| l2-mods | Overlay filesystem — assets shadow, rules accumulate | Override proven with synthetic art |
| l2-view | Viewer — sprite sheets and campaign maps | Slot 0 renders as England and Wales |
| ghidra_scripts/ | Headless binary analysis — find loaders, decompile to C | Found the renderer at 0x0040A21A |
| symbols.json | One symbol database, applied to Ghidra and rendered to docs | 1,464 functions, 596 globals, 0 failures |
| xref.js | Finds call sites of imported functions | Located both DirectPlay calls |
| peimp / peexp / pehdr / pefun | PE imports, exports, headers, per-DLL functions | Resolved imports-by-ordinal |
| probe.ps1 | Reads memory from a live process | Read the game at 0x400000 |
| screen.ps1 | Window capture via PrintWindow | Occlusion-proof |
| input.ps1 | Synthetic mouse and keyboard | Drove a real GUI |
| windows.ps1 | Enumerates a process's top-level windows | Found hidden dialogs |