Micro Machines Map Format

From ModdingWiki
Jump to navigation Jump to search
Micro Machines Map Format
File:Micro Machines Map Format.png
There is no image of a map in this format — upload one!
Format typeMap/level
Map type2D tile-based
Layer count1
Tile size (pixels)96×96
Viewport (pixels)256×200
Cell dimensions32×32
Games

Tracks for Micro Machines are stored in GAME1\ROUNDnm.MAP files, where n is the round (1-9) and m the race (1-4). Rounds 1 and 2 have four races, all others three, for 29 tracks in total. Every file is exactly 2048 bytes. The world is 32×32 cells of 96×96 pixels (3072×3072 pixels) and wraps around at the edges.

Each cell refers to a meta-tile of the round. The graphics of a meta-tile come from the .CT file, its collision mask from the .COL file, its terrain and AI direction from the .DIR file and its respawn data from the .LEV file. All of these are shared by every race of the round.

File format

The file consists of two uncompressed 32×32 byte planes, each stored row by row.

Plane 1: Meta-tile map

Bytes 0-1023. One byte per cell, at offset row * 32 + column.

Bits Purpose
0-5 Meta-tile index (0-63)
6 Attribute bit 0: turn the AI direction of this cell around by 180°
7 Attribute bit 1: mirror the AI direction of this cell (see the .DIR page)

The attribute bits only affect the AI direction and the heading of a car respawning in the cell. They do not change the graphics.

Plane 2: Track progress

Bytes 1024-2047. One byte per cell, in the same order as plane 1. This numbers the cells along the racing line, starting at the start/finish line. Cells off the racing line are 0.

The game uses this value for several things:

  • Lap counting and checkpoints. A lap is complete when the value wraps from the highest number back to a low one. A cell with value 0 does not change a car's progress, so the game keeps the last non-zero value.
  • Race positions.
  • As a byte offset into the .BRK file, which holds the AI braking hints for that stretch of track.

The game uses the highest value in the plane for the lap and race position logic.

Notes

  • ROUND82.MAP and ROUND92.MAP refer to meta-tiles that do not exist in the round's files. These cells can never be reached or seen by a car, so the game gets away with it.
  • The game chooses the round's overlay tiles itself, not from the map: in round 2 (bathtub) and round 3 (pool table) some tiles are drawn again on top of the cars, so the cars pass under the soap rack and the table rails.

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