Realms of Chaos Sprite Format

From ModdingWiki
Jump to: navigation, search
Realms of Chaos Sprite Format
File:Realms of Chaos Sprite Format.png
There is no image of a tileset in this format — upload one!
Format typeTileset
HardwareVGA
Max tile countUnlimited
PaletteShared
Tile names?No
Minimum tile size (pixels)0
Maximum tile size (pixels)255×255
Plane count1
Plane arrangementUnknown
Transparent pixels?Unknown
Hitmap pixels?No
Metadata?None
Supports sub-tilesets?No
Compressed tiles?No
Hidden data?No
Games

A Realms of Chaos sprite contains multiple 256-colour VGA images (for example, an enemy sprite contains all the animation frames for that sprite.)

File format

Header

All sprite files begin with a string containing the sprite's filename and some unknown data.

Data type Description
CHAR[16] cFilename Name of this sprite file ! (padded with 0's or random data?)
BYTE[5] unknown Unknown data (might even be more padding)

Image list

A number of image blocks immediately follow the header, repeating until EOF:

Data type Description
UINT16 iSize Size of this sprite
BYTE cData[iSize] Block of image data, iSize bytes long

Image format

Each of the blocks of image data in the above structure contains an image header, followed by the pixel data. The header looks like this:

Data type Description
UINT8 iHeight Height of the image in pixels
UINT8 iWidth Width of the image in pixels
BYTE[8] bUnknown ! might be collision data?
UINT16LE iDataSize Size of pixel data, in bytes
BYTE[7] bNulls Always 0
BYTE[iDataSize] bPixelData Pixel data (see below)
UINT16LE[iWidth] iColOffsets ! Indices into pixel data for each column?

The pixel data stores the pixel columns sequentially, using (iType, iCount) pairs to skip transparent pixels. Both values are stored as UINT8 values. Possible values for iType are:

iType Description
0 Skip iCount pixels (the pixels are transparent)
1 Write iCount pixels to the screen
2 Write iCount pixels to the screen and end this column (increase X and reset Y)
3 End of the image

If iType is 1 or 2, iCount byte values follow after the iCount byte. These are the pixels to be drawn onto the screen.

Note: Each sprite image seems to always end with the (iType,iCount) pairs (2,0), (0,0), (3,0).

Credits

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!)