Micro Machines Collision Format

From ModdingWiki
Jump to navigation Jump to search

Collision data for Micro Machines is stored in GAME1\ROUNDn.COL files, one per round. It defines which parts of each meta-tile are solid (walls, obstacles, the table edge) and which can be driven on.

File format

The file is a list of 18-byte records, one per meta-tile (in the same order as the .CT file), with no header. The number of meta-tiles is the file size divided by 18.

Each record is a 12×12 bit mask. A meta-tile is 96×96 pixels, so each bit covers an 8×8 pixel square. The bits are stored row by row, most significant bit first, with no padding at the end of a row (12 × 12 = 144 bits = 18 bytes).

To look up a world position x, y (0-3071):

cell    = map[(y / 96) * 32 + (x / 96)] & 0x3F
subx    = (x % 96) >> 3
suby    = (y % 96) >> 3
bit     = suby * 12 + subx
solid   = col[cell * 18 + bit / 8] & (0x80 >> (bit % 8))

A set bit is solid.

The game loads the file into a buffer of 0x480 bytes (64 meta-tiles), so a round cannot have more than 64 meta-tiles.

Credits

This file format was reverse engineered by VorticonCmdr. 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!)