We were talking a lot about the data format on IRC recently. The L1 vgagrX.dat/groundXo.dat format description at
Mindless's site seems to have a mistake: The terrain is actually stored in the first data section of vgagrX.dat, and the special objects are stored in the second section. The format description claims it's the other way around.
If ccexplore gets to update this, he might also take note of the
hint about bitmap storing from my first reply to this topic.
A third thing he might add is the transparency/opacity coding for the masks. A 1 stands for a solid pixel, a 0 means transparent background. The format description says that he forgot it at the time of writing, and people should experiment.
There's another curiosity we found. The 16-color bitmaps for the terrain only make use of the graphic-set-specific 8 colors, numbered 8 through 15. The bitmaps are stored in 4 planes, and the plane order is little endian, i.e. the plane that adds 8 to the color comes last. Since the terrain uses a color >= 8 for each solid pixel and color 0 (black) for air, the last plane is equal to the mask plane. If you actually look at the terrain metadata in groundX.dat, you will see that the mask location is actually the last plane. (E.g. the crystal set's terrain piece 0 has a size of 0x20 times 0x20, which means its 4-bit bitmap (two pixels per byte) requires 0x400 / 2 = 0x200 bytes of storage, but the mask location starts only 0x180 behind the image location's begin.)
I don't know what L1 itself does with this data. It may read a 16-bit bitmap and then re-use the last plane for the mask, or it may just read the first three planes, add 8 to everything, then cut via the mask. I believe it does the former, since it must read four-plane bitmaps anyway when making the special objects; they use all 16 colors.
-- Simon