Realms of Chaos Tileset Format
The BG Format is used in Realms of Chaos to store non-transparent tile graphics.
Files in this Format contain four blocks of interleaved 8bpp pixel values for up to 512 16x16 pixel tiles. This means that each tile consists of four blocks (64 bytes each). The first block contains all pixels where x=0 mod 4, second block: x=1 mod 4 etc. The pixel data is stored sequentially (left to right, top to bottom) for each tile.
The number of tile graphics in a file can be calculated by dividing the file size by 256. When the tileset is to be shown to the user, it should be displayed with a width of 20 tiles (320 pixels).
This file format was reverse engineered by K1n9_Duk3. 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!)