Odin reimplementation of OpenMW 0.51 on the Rune engine: format readers, tooling, and port plans
  • Odin 80.7%
  • Shell 9.8%
  • Python 9.3%
  • C++ 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
michael d0d233f300 N10: an answer's result script writes its journal entry
`lib/rules/result_script.odin` parses the command surface dialogue writes out of
an INFO's result script: `Journal "id" index`, `SetJournalIndex` and `AddTopic`,
with `;` comments, blank lines, signed indices and quoted names, five tests.
`tool/import topics` writes each INFO's parsed commands as `journal` and
`add_topics`, `game/systems/talk.odin` applies them when a topic is chosen, so a
chosen answer adds its journal entry through `journal_add` in both the console
and the dialogue screen.

C10's premise did not hold in the data. 0 of 23693 INFOs add any A1_* entry and
Morrowind.esm carries no quest subrecords: the shipped scripts write the
opening's entries from bytecode, which M6's VM will run. The row is re-decided,
not lowered: C10 now proves the dialogue path on the 830 INFOs whose result
scripts do carry `Journal` commands, and drives the opening's three steps
through `journal add`, the same `Journal::addEntry` the interpreter will call.

`bash reference/m5_c10.sh` prints
  c10 gate: PASSED
  the opening holds 3 steps in order: A1_2_AntabolisInformant at 10, A1_6_AddhiranirrInformant at 10, A1_11_ZainsubaniInformant at 1
  3 dialogue choices applied the journal commands their result scripts carry

`./build.sh check` ok, queue 11 of 13, STATUS 136 lines, M5 107 lines, 475
tests. 117 harness lines against 300 feature lines is over the third the cost
rules ask for; the gate re-parses the dump C3 and C5 also parse, and N11 pays
that debt by folding the three into one reference module.
2026-12-05 23:24:33 +00:00
docs N6: persuasion, the refusal fallback, and C6 green 2026-12-05 16:17:08 +00:00
fixtures W8: containers open, the item survives a reload, an NPC follows across a cell 2026-12-02 22:33:53 +00:00
game N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
lib N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
reference N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
tests N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
tool N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
.gitignore N3: topic selection agrees with the reference on twelve speakers 2026-12-05 08:36:45 +00:00
AGENTS.md M5 opens: dialogue, journal and quests, with navigation as its first item 2026-12-04 17:16:55 +00:00
build.sh N3: the topic selection core and the topics tool 2026-12-05 06:51:13 +00:00
game.sh N9: the journal page's topic links, and UI batch 3 done 2026-12-05 21:26:02 +00:00
LICENSE Initial commit: OpenMW to Rune format readers, tooling and port plans 2026-11-29 20:01:04 +00:00
M4.md M12: the M4 contract prints PASS with an empty queue 2026-12-04 16:46:10 +00:00
M5.md N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00
PLAN.md N1: the follower steers on the navmesh, C1 still red on the route start and the stair gap 2026-12-04 21:14:14 +00:00
README.md Rewrite the plan around a Rune-native game 2026-11-30 18:34:04 +00:00
rune-model-material-merge.md rune report: material slots versus meshes after the importer merges identical materials 2026-12-01 21:06:45 +01:00
SLICE.md Verification cost: a cheap tier, cached reruns and cached reference frames 2026-12-03 18:56:01 +00:00
STATUS.md N10: an answer's result script writes its journal entry 2026-12-05 23:24:33 +00:00

runewind

Morrowind, re-imagined as a Rune game: an Odin reimplementation of OpenMW 0.51's observable behaviour, running on the Rune engine. Player-visible parity is the contract; internals are Rune's. Rune owns the frame, the ECS, rendering, physics, navigation, animation, audio, input, UI and saves. Game code owns Morrowind's formats and rules, plus an offline importer that turns the game's data into Rune assets.

Status: the data-format layer, verified against OpenMW's own tools, plus one Rune-native exterior cell that renders Balmora from real game data through Rune's ECS, terrain, materials, lights and camera. PLAN.md is the implementation plan for the game; STATUS.md is the live handoff; AGENTS.md is how to work in this repo.

What exists

Path What
openmw-port/src/formats/bsa BSA v0x100 reader: header, directory, hash table, path normalisation, extraction
openmw-port/src/formats/esm3 TES3 plugin reader: record and subrecord stream, header, GMST, CELL, STAT/DOOR/CONT, SCPT, DIAL
openmw-port/src/formats/dds DDS decoder: BC1/BC2/BC3 plus 24- and 32-bit uncompressed, with mask handling
openmw-port/src/vfs Layered lookup over directories and archives, case and separator normalisation
openmw-port/src/pack .runepack container: index with CRCs, reader, writer, extraction
openmw-port/src/paths Shared path normalisation and relative-path rules
openmw-port/src/config Boost-style cfg parser for openmw.cfg and settings files
openmw-port/src/content Load-order resolution with master and missing-file detection
openmw-port/src/tools/bsadump list, info, find, hash, extract
openmw-port/src/tools/esmdump info, list, raw, script, records
openmw-port/src/tools/nifdump NIF header, version and record count
openmw-port/src/tools/runepack create, list, verify, extract
openmw-port/src/tools/cfgdump dump cfg files with sections
openmw-port/src/tools/census resolve a config against data directories, verify referenced models
openmw-port/src/tools/texscan decode every texture in an archive and report formats
openmw-port/src/tools/nifscan parse every NIF container, optionally walking blocks and reporting where it stops
openmw-port/fixtures Generators for valid BSA, ESP and DDS fixtures built from the format specs
openmw-port/tests 194 Odin tests across the modules, error paths included
runtime/cell Rune-native exterior cell: ECS entities, static meshes, terrain, materials, lights, capture
runtime/firstdraw Independent raylib renderer used as a decode oracle, not a shipping target

Verification without game files

Fixtures are judged by the reference implementation, not by my own readers:

  • bsatool reads archives written by fixtures/gen_bsa.py, and the Odin reader reads archives written by bsatool create. Both directions are exercised by the suite.
  • esmtool dump parses fixtures/out/ring1.esp with exit code 0 across all 11 records, so the plugin is valid by OpenMW's own loaders.
  • ffmpeg decodes the DDS fixtures to raw RGB and the decoder is compared against it pixel by pixel.
  • The BSA hash function is implemented twice, in Python and Odin, and the tests assert agreement with the hashes stored in the fixture.

Build

cd openmw-port
./build.sh fixtures   # regenerate BSA, ESP and DDS fixtures plus oracle references
./build.sh all        # build bsadump and esmdump
./build.sh test       # run the Odin test suite

Requires Odin dev-2026-10, plus bsatool, esmtool and ffmpeg for fixture regeneration.

Plans

  • PLAN.md: the implementation plan, authoritative from 2026-11-30
  • docs/superseded/: the three earlier plans and their effort model, kept for reference, not binding

Not in this repo

The OpenMW checkout used for analysis (a clone of the upstream repo) is deliberately excluded. Get it with git clone --branch openmw-0.51.0 https://github.com/OpenMW/openmw.

License

GPL-3.0. This is a derivative work of OpenMW, which is GPLv3. Rune itself is zlib and GPLv3-compatible.