Skip to content

Modding research

Taking the game apart

An ongoing effort to work out how Lords of Magic stores its world, its artwork, its rules and its saves — by reading the game's own code and by running controlled experiments in the running game.

Why bother

Lords of Magic keeps almost all of its rules in plain-text scripts, and almost all of its content in archives that ordinary tools can open. That is why a modding community existed at all, and why the two big community projects — a bug-fix patch and a full balance overhaul — could be built by people with no access to the source.

What that community never had was a reliable description of the binary formats: how a map stores its terrain, how a sprite knows where to stand, what a savegame contains. Tools were written against guesses, the guesses were mostly right, and the places where they were wrong produced bugs people lived with for years — sprites that wobble a few pixels, maps that cannot be resized, sessions that desync.

This is an attempt to replace the guesses with measurements, and to be explicit about which is which.

File formats

Overview of all 5

Maps and scenarios

The world grid, its terrain, and the objects standing on it — decoded, written back, and accepted by the game.

Sprites and animation

How a frame is positioned, how a direction picks a stored facing, and why the file contains no timing at all.

GameScript

The stack language the whole game is written in — and the 1,906 engine operators it calls into.

Savegames

Nine sections, no compression, no encryption — and a leak of the game's own memory into every file you share.

The game archives

Where everything lives, and what the two big community mods actually change.

Elsewhere in this section

Multiplayer

Why it desyncs, what the asterisk in the game list means, and why a dedicated server would not help.

Tools

The tooling behind this research is not publicly available yet.