DKRDS Tilemap (File Format)

From Wexos's Wiki
(Redirected from DKRDS Tilemap)
Jump to navigationJump to search

DKRDS Tilemap is a nameless file format used in Diddy Kong Racing DS which defines a grid of 32x32 tile cells in order to assemble an image. Each cell in the grid is equivalent to one entry from the accompanying DKRDS Tile Layout file. Rendering all cells in order (from the top-left to the bottom-right tile) produces the complete image. Other filetypes that are commonly associated with tilemaps, and necessary to create screen backgrounds, are DKRDS Texture Tileset and DKRDS Palette Bank. Its type identifier in assets.bin is 0x00.

File Format

The file byte order is always little endian.

Structure

Offset Type Description
0x00 UInt16 Map width in tiles (W).
0x02 UInt16 Map height in tiles (H).
0x04 UInt16[W][H] Grid of tile entries, row-major.

Tile Entry

Each entry represents a 32x32 tile which contains a reference index and flip attributes. They use the following bit layout:

A  A  A  A  B  C  D  D  D  D  D  D  D  D  D  D
0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15
Bits Description
0-3 Unknown. Always 0?
4 Flip vertical. If 1, it mirrors the 32x32 tile on the Y axis.
5 Flip horizontal. If 1, it mirrors the 32x32 tile on the X axis.
6-15 Tile ID. This is the index into the DKRDS Tile Layout file (0-1023).

Notes

  • Tile index 0 typically represents an empty or fully-transparent background tile. In minimaps, large regions surrounding the track consist entirely of index-0 entries.
  • The flip fields apply to the rendered 32x32 output of the whole 32x32 tile, after all 8x8 sub-tiles within it have been composited. They are independent of the per-sub-tile flip flags stored in the DKRDS Tile Layout file.

Tools

The following tools can handle DKRDS Tilemap:

  • (none)