Skip to content
ProgSys edited this page Sep 19, 2026 · 2 revisions

The KM3 format is an archive of models, used only by EFFECT.KM3. It holds the visuals the game plays for spells and attacks: explosions, glows, sparks, rings, flames and lightning.

Every entry inside it is a GEO file. So a KM3 is really just a way to keep a few hundred small models together and give each one a number.

It differs from OLA or SOLA in two major ways:

  • it stores the size of every entry, not its offset
  • it stores its header size explicitly, instead of leaving you to work it out from the entry count

File structure

Overview

Name Format Info
Header km3fileHeader
Sizes vector<unsigned int> one per entry
Ids vector<unsigned short> one per entry
padding zeros, up to header_size
Entries vector<GEO>

Everything is little endian.

Header

struct km3fileHeader // 8 bytes
{
	unsigned int number_of_entries;
	unsigned int header_size; //where the first entry starts
};

header_size is the size table, the id table and the two fields above, rounded up to the next multiple of 16:

header_size = align16(8 + number_of_entries * (sizeof(unsigned int) + sizeof(unsigned short)));

The gap between the end of the id table and header_size is zero filled.

Sizes and offsets

Only sizes are stored, so an offset is the header size plus every size that comes before it:

offset[0] = header_size;
offset[i] = offset[i - 1] + size[i - 1];

Every size is a multiple of 16, and all of them together with the header add up to exactly the file size. That last part is the easiest way to tell a KM3 from an offset list archive, because a size table happily passes for an offset table otherwise.

Ids

One unsigned short per entry, in the same order as the sizes. The id acts like a filename: the game asks for effect 85, not for entry 77.

Ids ascend but are sparse, so removing an effect does not renumber the ones after it. In EFFECT.KM3 they run from 1 to 160 with 32 numbers missing.

Entries

Each entry is a complete GEO file, starting on a multiple of 16. Nothing is compressed and nothing is wrapped, so an entry can be cut out with its offset and size and read as a GEO straight away.

Clone this wiki locally