MegaTech VOL Format

From ModdingWiki
Jump to: navigation, search
MegaTech VOL Format
Format typeArchive
Max filesUnlimited
File Allocation Table (FAT)Beginning
Supports compression?No
Supports encryption?No
Supports subdirectories?No
Hidden data?No

The MegaTech VOL Format is an archive used by Cobra Mission to store all the game data. The following .VOL files are included with the game:

File format

There is no header. The format is simply a list of offsets, repeated until the file data begins:

Data type Name Description
UINT32LE offset Offset of this file, relative to start of archive file

Usually the above structure is repeated until it is 256 bytes long (with unused offsets as zero), but it can be smaller (pcm6.vol has a 64 byte header).

The last entry in the list is the file size, followed by zero offsets as needed to pad the list to the required length.

! Will the game accept files that lack this padding?



EMI.VOL contains the music for the game, it has 41 chunks of data. The first chunk has no header. ! Find out if the first chunk is instrument data The 40 remaining chunks all have the EM header.

EM Entry

  • 0 - 3 : signature 45 4D 00 06
  • 4 - 5 : Unknown, most of the times 00 00, but values such as 00 03 are also present.! Number of tracks?
  • 6 - 7 : Unknown, most of the times 1C 00
  • 08 - 09 : UINT16LE, Offset in the EM chunk where the actual data starts
  • 0A - 0B : UINT16LE, Always the same as the previous UINT16LE. (Pointing to data offset)
  • 0C - 0D : UINT16LE, The size of the EM chunk
  • 0E - Datastart : Unknown data, seems to contain a string as well. The last byte before the data starting point always seems to be 0xFF.


MCG.VOL contains the tilesets for the game. It contains 14 chunks of tile data.

Chunk nr Tileset
0 Character sprites
1 Weapon sprites
2 CASTLE tileset
3 AREA1 tileset
4 AREA2 tileset
5 AREA3 tileset
6 AREA4 tileset
7 AREA5 tileset
8 HOUSE tileset
9 BAR tileset
10 CORP tileset
11 BRICK tileset
12 LAB tileset
13 SEASIDE tileset

The header for this file is 64 bytes and contains the offsets for each tileset. The tilesets consist of a number of tiles, all are 32x32 pixels, each pixel stored as a byte, making each sprite 1024 bytes.

The palette for the tilesets is found inside each entry inside MED.VOL. The colors are stored as an array[16] of UINT16LE. For example white is stored as F0FF, this will be read as 0x0FFF, and here the components are 0GRB.

byte r = (value >> 4) & 0x0F;
byte g = value >> 8;
byte b = value & 0x0F;

This will result in values from 0 to 15. Getting the actual color requires 2 shifts, one left of 4 and added to that one right of 2.

Reading all palette entries would look something like this:

Color parse_color(uint16_t col)
	byte r = (col >> 4) & 0x0F;
	byte g = col >> 8;
	byte b = col & 0x0F;
	return Color((r << 4) + (r >> 2), (g << 4) + (g >> 2), (b << 4) + (b >> 2));
void parse_palette()
	int pal = 0;
	for (int i = 32; i < 64; i += 2)
		uint16_t color = (m_data[i + 1] << 8) | m_data[i];
		m_palette[pal++] = parse_color(color);


MED.VOL contains all the levels for the game. It contains 54 chunks of map data.

MD Entry

Each MD entry inside MED.VOL consists of 5 blocks. The header (96 bytes), a block of unknown data (variable size), the tiledata for all the floors(dependent on size and number of floors), the triggers for all floors (same as the floor sizes, but with most entries 0) and a footer of 256 bytes.

MD Header
  • 0 - 6 : signature 4D 44 03 30 02 02 14
  • 7 - 9 : Unknown, most of the times 77 60 00, but values 9F 60 00, FF 60 00 and 8B 60 00 are also found in a few maps
  • 0A - 0B : UINT16LE, the offset inside this MD chunk where the actual map data starts
  • 0C - 0F : UINT32LE, the size of this MD chunk
  • 10 - 11 : UINT16LE, the width (in tiles) of this map
  • 12 - 13 : UINT16LE, the height (in tiles) of this map
  • 14 - 15 : UINT16LE, the number of floors in this map
  • 16 - 1F : Character array, refers to the used tileset (values can be CASTLE, AREA1, AREA2 etc. See MCG.VOL), rest zeroes
  • 20 - 3F : Palette data, 16 colors, each color stored as UINT16LE, colors are stored as 4 bit nibbles.
  • 40 - 5F : Character array, contains 2 names for the map, or for HOUSE types, the area that is referred. A long and a short version seperated by a pipe character.
Unknown data block

Unknown data block, usually ranging from 0060 to 0420. The data inside looks the same for all the MD chunks. It looks like a lot of 16 bit integers.

Tile data block

The size of the block is width * height * number of floors. Each byte corresponds to the tile number in the used tileset. The floors are stored sequentially.

Triggers block

The same layout as the tile data block, but now most bytes are 00 and the bytes that are not are triggers such as item pickups, stairs, doors etc. Unknown what the numbers mean, but exits are usually 0x20, item pickups range in 0x40 and character sprites are usually 0xC0 and higher.


At the end of each MD chunk there are 256 bytes, unknown what the data represents, but it looks like it is related to the trigger block.


These files contain PCM data in the form of the Creative Voice Format


This file format was reverse-engineered by BlackStar. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)