Difference between revisions of "PALETTES.DAT"

From UFOpaedia
Jump to navigation Jump to search
(→‎Usage: more accurate, final 16 of each palette are replaced by backpals)
Line 19: Line 19:
 
Color 0 is not used in the game, it instead represents "transparency" (ie. Pixels which should not be drawn to the screen).<br>
 
Color 0 is not used in the game, it instead represents "transparency" (ie. Pixels which should not be drawn to the screen).<br>
 
<br>
 
<br>
The UFOpedia either uses the second or fifth palette. Although it displays items used in the Battlescape. Because of this, there are two different sets of item images, each bearing the title "[[BIGOBS.PCK|BigObs]]": Those used in the UFOpedia (stored in a collection of 57 PCK files in the [[UFOGRAPH]] folder), and those used in the Tactical display (stored in a PCK archive in the [[UNITS]] folder).<br>
+
The UFOpedia either uses the second or fifth palette, though it is known to display items used in the Battlescape. Dispite (or perhaps, because of) this, there are two different sets of item images, each bearing the title "[[BIGOBS.PCK|BigObs]]": Those used in the UFOpedia (stored in a collection of 57 PCK files in the [[UFOGRAPH]] folder), and those used in the Tactical display (stored in a PCK archive in the [[UNITS]] folder).<br>
 
<br>
 
<br>
The final 16 colors of each palette are reserved. They are replaced in-game by the colors from the appropriate [[BACKPALS.DAT]] palette. These last 16 colors are used to draw the backgrounds of the bordered windows. Where there are no background images these entrys are unused.
+
[[Image:5_BattleScapePal2.Png|right|frame]]
 +
The final 16 colors of each palette are reserved. They are replaced in-game by the colors from the appropriate [[BACKPALS.DAT]] palette, and used to draw the backgrounds of the bordered windows; where there are no background images they are unused.<br>
 +
<br>
 +
The exception to this is the Tactical palette, where the final 16 colors are replaced by a greyscale set (pictured right) which is stored in neither of the palette files (presumably, they are hard coded into the executable instead). These colors are not loaded for the UFOpedia display (providing at least one reason for the alternate item image sets).
  
 
=Color Indexes=
 
=Color Indexes=

Revision as of 01:34, 12 June 2007

Back in the days of low video memory, storing each pixel as a multi-byte color value (such as in today's "High Color" and "True Color" modes common under MS Windows) was not practical. Instead, a common method for was to create a palette of 256 different colors (usually of 3 bytes each), and then use single byte values to index into that. The ability of a video card to use such a palette was known as "VGA compatibility".

This dramatically decreased the memory requirements of an given image, though it lowered the amount of colors that could be used at any given moment.

There are a total of five "complete" palettes in UFO, each for a different situation. Each is made up of the standard 256 colors, stored as three byte RGB records (A value for Red, a value for Green, and a value for Blue). This makes a total of 768 bytes per palette.

Each RGB value has a maximum intensity of 63/x3F (making a total of 262,144 shades available, which seems to be standard for VGA), as opposed to 255/xFF (which would have provided 16,777,216). Each palette has a six byte 'buffer' following it. While their meanings are unknown, they are:

Pal1: B7 13 FF 76 FE 50
Pal2: A1 E8 13 0B 06 E6
Pal3: 01 00 8B 46 FA 0B
Pal4: FF 76 10 FF 76 0E
Pal5: C8 1E 00 00 1E B8

Five palettes of 768 bytes each, plus five buffers of 6 bytes each, makes 3,870 bytes in Palettes.Dat.

Usage

Color 0 is not used in the game, it instead represents "transparency" (ie. Pixels which should not be drawn to the screen).

The UFOpedia either uses the second or fifth palette, though it is known to display items used in the Battlescape. Dispite (or perhaps, because of) this, there are two different sets of item images, each bearing the title "BigObs": Those used in the UFOpedia (stored in a collection of 57 PCK files in the UFOGRAPH folder), and those used in the Tactical display (stored in a PCK archive in the UNITS folder).

5 BattleScapePal2.Png

The final 16 colors of each palette are reserved. They are replaced in-game by the colors from the appropriate BACKPALS.DAT palette, and used to draw the backgrounds of the bordered windows; where there are no background images they are unused.

The exception to this is the Tactical palette, where the final 16 colors are replaced by a greyscale set (pictured right) which is stored in neither of the palette files (presumably, they are hard coded into the executable instead). These colors are not loaded for the UFOpedia display (providing at least one reason for the alternate item image sets).

Color Indexes

1. GeoScape Palette.
2. Unknown Usage. UFOpedia?
3. Graph Views.
4. Research Displays.
5. Tactical Palette.

See Also