How terrain is drawn
Each tileset is five files. A tile id in the map file leads through them to pixels:
MTXM tile id ──(id >> 4)──▶ CV5 group ──(id & 15)──▶ VX4 megatile
VX4 megatile ──▶ 16 minitile refs (bit 0 = flipped) ──▶ VR4 8×8 bitmaps ──▶ WPE palette
A tile is a 32×32 megatile made of sixteen 8×8 minitiles, each an index into the tileset's 256-colour palette. The CV5 groups megatiles into terrain types with their variations and edge pieces, which is where the terrain palette's list of terrains comes from. The VF4 holds each minitile's walkability and height, which the elevation and buildability overlays, the placement checks and the Walkability plugin all read.
The editor rasterises each tileset once into one large image, the atlas, and draws the map by copying tiles out of it. Only the tileset the open map uses is decoded; the others are fetched into the browser's cache in the background so a later map opens faster, but not decoded, since a decoded tileset is about 20 MB of pixels.
Water and lava#
The graphics are indexed colour, and StarCraft animates water and lava by rotating a few short bands of the palette every eight game frames, about a third of a second at the Fastest speed. The band tables per tileset are the game's own; Space Platform and Installation have none. The editor keeps a second small atlas of just the megatiles that touch those bands and redraws it on each step. View ▸ Animate Water turns it on, and Preferences ▸ View sets the speed from a quarter to four times the game's. The minimap and the far zoom levels, which draw average tile colours, do not animate.