Palette file

From Worms Knowledge Base

Revision as of 10:54, 5 August 2012 by Pac-Man (Talk | contribs) (Unstubbed, complete PAL file format description)

Jump to: navigation, search
(Up to File formats)

W:A and WWP use the Microsoft RIFF file format to store their color palettes used in the frontend. The palette files all reside in the "Graphics" directory and its subfolders.

File format

As like every other RIFF file, the PAL files start off with the RIFF header:

  • 4-byte RIFF signature "RIFF"
  • 4-byte RIFF length in bytes (excluding the RIFF header)
  • 4-byte PAL signature "PAL " (note the space / 0x20 at the end)

The PAL files then include 4 different chunks, of which only the "data" chunk is important. The purpose of the other chunks "offl", "tran" and "unde" are all 32 bytes long, filled with 0x00. Their purpose remains unknown since they can be deleted and the game still accepts the PAL files. Like other RIFF chunks, the data chunk starts with its signature and length:

  • 4-byte data chunk signature "data"
  • 4-byte data chunk size excluding the chunk header
  • 2-byte PAL version. This version is always 0x0300.
  • 2-byte color entry count. This determines how many colors are following.

Each color consists of 4 bytes holding the following data:

  • 1-byte red amount of color
  • 1-byte green amount of color
  • 1-byte blue amount of color
  • 1-byte "flags" - W:A PAL files always have the 0x00 flag, so no flag is set.

See also

  • Worms PAL Editor - does not save the 3 useless chunks, with no side-effect in the game

External links

Personal tools