KSF image directory
From Worms Knowledge Base
(Up to File formats)
For Online Worms, the raw data of all images used in one menu screen are stored in a single KSF file in the KSF folder. Each pixel is simply a byte index into a palette file with the same name in the Palette folder.
File format
Type | Size | Name | Description |
---|---|---|---|
uint32 | 4 | Image Count | The number of Image structures following. |
uint32 | 4 | Data Size | Total number of bytes of image data at the end of the file. |
Image[ImageCount] | 16 × ImageCount | Images | List of Image structures defining the slice of image data for each image in the Data array. Some images may not actually be used and have most of their values set to 0. Each structure is defined as follows: |
uint32 | 4 | Offset | Index into the Data array at which the image data starts. Same as the previous image if unused. |
uint32 | 4 | X Center | Half width of the image, in pixels. 0 if unused. |
uint32 | 4 | Y Center | Half height of the image, in pixels. 0 if unused. |
uint16 | 2 | Width | Width of the image, in pixels. 0 if unused. |
uint16 | 2 | Height | Height of the image, in pixels. 0 if unused. |
uint8[DataSize] | DataSize | Data | Data of all images as one array. Each byte is an index into the corresponding palette. |
Palettes
The palettes indexed by the image data are stored in separate files ending on the *.pal extension. Each file is simply a dump of 256 3-byte RGB colors.