RPG Tileset File Format
Chad Austin
1.14.99


---- 256 byte header ----

byte signature[4];   // Must be ".rts"
word version;        // Must be 1
word num_tiles;
word tile_width;
word tile_height;
word tile_bpp;       // Must be 32
byte compression;    // 0 = no compression, 1 = Huffman, 2 = LZ
byte reserved[241];


---- Tileset data ----

Each tile is (tile_width * tile_height * (tile_bpp / 8)) bytes.  You read each
like a normal top-down bitmap.


---- Tile information block ----

Every tile has a corresponding 32-byte information block:

struct TILE_INFORMATION_BLOCK
  byte obsolete_;
  byte animated;
  word nexttile;      // For animated tiles
  word delay;         // number of frames to wait until next tile switch
  byte reflective;    // 1 = reflective, 0 = transparent
  byte blocked;       // 1 = has obstruction data after information block
  byte reserved[24];
end struct


---- Obstruction data ----

There are tile_width * tile_height bytes in the obstruction data area.  Each pixel in the tile
can currently be either blocked (1) or not blocked (0).  Values 2 through 255 are reserved for
future use.
