PAL (Dark Reign)
From Just Solve the File Format Problem
(Difference between revisions)
(→Structure) |
(→Palette and Dimmed palette) |
||
Line 50: | Line 50: | ||
|} | |} | ||
− | == | + | == Primary and dimmed palettes == |
− | The palette entries in the ''' | + | The palette entries in the '''primary''' and '''dimmed''' palettes are store as red, green, and blue planes: |
* The first 256 bytes are the red components in order, the next 256 are the green components, etc. | * The first 256 bytes are the red components in order, the next 256 are the green components, etc. |
Revision as of 18:06, 11 January 2023
A .pal is a palette format used by the real-time strategy game Dark Reign.
Each of the game's terrains has an associated .pal file. Dark Reign comes with the following Terrains:
- BARREN
- SNOW
- JUNGLE
- ASTEROID1
- AUSTRALIA1
- VOLCANIC1
- ALIEN2
- These terrains were add-ons released by the developer, Auran, after the game launch.
- This terrain was included in the expansion Dark Reign: Rise of the Shadowhand but also released separately after the game launch.
Contents |
Structure
Variable | Type | Notes |
---|---|---|
Signature | "PALS"
|
|
Version | 0x0102
|
|
Palette | bytes[768]
|
Stored as RGB planes |
Dimmed palette | bytes[768]
|
Stored as RGB planes. The purpose of this palette is unknown, but assumed to be the dimmed palette that is used when the game is running but left idle. |
Unknown chunks (1) | bytes[32768]
|
|
Unknown data (2) | All remaining bytes up until the shading tables (last 147,456 bytes of the file) | |
Shading tables | bytes[147456]
|
Primary and dimmed palettes
The palette entries in the primary and dimmed palettes are store as red, green, and blue planes:
- The first 256 bytes are the red components in order, the next 256 are the green components, etc.
- Each component is stored in 6-bits (0-63) and will need to be multiplied by 4 to map to the range 0-255.
- Index 0 is always transparent.
The index of the colors within the palettes are important:
Purpose | Range |
---|---|
Unit palette | 0-159 and 255 |
Terrain palette | 160-254 |
Team remapping colors (for game units) | 32-39 |
Team 0 | 48-55 |
Team 1 | 40-47 |
Team 2 | 64-71 |
Team 3 | 56-63 |
Team 4 | 72-79 |
Team 5 | 80-87 |
Team 6 | 88-95 |
Team 7 | 32-39 |
User definable | 96-159 |
Unknown chunks (1)
- The Unknown chunks appears to be 32 (or 33) chunks of 1,024 bytes, representing what appears to be a non-looping animation of 32x32 pixel images.
- These chunks do not appear to use the palettes.
- These chunks are different for each palette.
Unknown data (2)
The Unknown data is all of the data from the end of the Unknown chunks up until the start of the Shading tables.
- The purpose of this data is not known, but might be compressed using the same RLE method used by sprites.