Micro Machines Vehicle Format

From ModdingWiki
Jump to navigation Jump to search
Micro Machines Vehicle Format
There is no example of an image in this format — upload one!
Format typeImage
HardwareVGA
Colour depth8-bit (VGA)
Minimum size (pixels)24×24
Maximum size (pixels)40×40
PaletteExternal
Plane count1
Transparent pixels?Yes
Hitmap pixels?No
Games

The vehicle sprites of Micro Machines are stored in GAME1\ROUNDnBR.VH0, one file per round. The file is compressed with Micro Machines Compression. The palette is the round's ROUNDn.PAL.

File format

After decompression the data is split into two banks. All frames are stored row by row with one byte per pixel. Colour 0 is transparent.

Round Bank 1 Bank 2
1-8 0x1440 bytes: 9 frames of 24×24 0x1B00 bytes: 12 frames of 24×24
9 0x3840 bytes: 9 frames of 40×40 0x1F40 bytes: 5 frames of 40×40

Bank 1: Vehicle rotations

The 9 frames show the vehicle turning from facing up (frame 0) to facing right (frame 8), in steps of 11.25°. For rounds 1-8 the game builds the other 23 directions by mirroring:

frame[9 + k]  = flip_vertical(frame[7 - k])    k = 0..7
frame[17 + k] = flip_horizontal(frame[15 - k]) k = 0..6
frame[24 + k] = flip_horizontal(frame[8 - k])  k = 0..7

A heading of 0-255 (clockwise, 0 = up) uses frame heading >> 3.

Bank 2: Animations

Bank 2 holds the frames for the crash, fall and hazard animations.

In round 8 (Choppers) the first 0x1400 bytes of bank 2 are also used as 5 frames of 32×32: the spinning rotor blades drawn on top of the helicopters.

Colours

The same sprites are used for all four cars. When a car is drawn, every pixel whose colour has a low nibble of 0-2 (except colour 0) gets the car's colour offset added, giving each car its own colours.

When a car is in the air, its shadow is drawn first: the same frame with every non-transparent pixel in colour 0 (black).

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!)