Difference between revisions of "PALETTES.DAT"

From UFOpaedia
Jump to navigation Jump to search
m
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, 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>
+
The UFOpedia uses the first, second, fourth or fifth palettes, depending on the requirements of the entry being displayed.<br>
 +
<br>
 +
The final 16 colors of each palette are reserved. These 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>
 
<br>
 
[[Image:5_BattleScapePal2.Png|right|frame]]
 
[[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>
+
The exception to this is the Tactical palette, where the final 16 colors are replaced by a greyscale set stored in neither of the palette files (pictured right; presumably, they are hard coded into the [[TACTICAL.EXE|executable]] instead). These colors can be used by objects or terrain, etc, but are not loaded for the UFOpedia display.<br>
 
<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 [[TACTICAL.EXE|executable]] instead). These colors are not loaded for the UFOpedia display (providing at least one reason for the alternate item image sets).
+
Because of this there are two different sets of item images, each bearing the title "[[BIGOBS.PCK|BigObs]]": Those used in the UFOpedia (a collection of 57 PCK files in the [[UFOGRAPH]] folder), and those used in Tactical mode (a single PCK archive in the [[UNITS]] folder).
  
 
=Color Indexes=
 
=Color Indexes=
[[image:1_GeoScapePal.Png|center|frame|1. GeoScape Palette.]]
+
[[image:1_GeoScapePal.Png|center|frame|1. GeoScape World View.]]
[[image:2_UnknownPal.Png|center|frame|2. Unknown Usage. UFOpedia?]]
+
[[image:2_UnknownPal.Png|center|frame|2. Base Palette.]]
 
[[image:3_GraphPal.Png|center|frame|3. Graph Views.]]
 
[[image:3_GraphPal.Png|center|frame|3. Graph Views.]]
 
[[image:4_ResearchPal.Png|center|frame|4. Research Displays.]]
 
[[image:4_ResearchPal.Png|center|frame|4. Research Displays.]]

Revision as of 03:42, 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 a given image, though it lowered the amount of colors that could be used in any single 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 uses the first, second, fourth or fifth palettes, depending on the requirements of the entry being displayed.

The final 16 colors of each palette are reserved. These 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.

5 BattleScapePal2.Png

The exception to this is the Tactical palette, where the final 16 colors are replaced by a greyscale set stored in neither of the palette files (pictured right; presumably, they are hard coded into the executable instead). These colors can be used by objects or terrain, etc, but are not loaded for the UFOpedia display.

Because of this there are two different sets of item images, each bearing the title "BigObs": Those used in the UFOpedia (a collection of 57 PCK files in the UFOGRAPH folder), and those used in Tactical mode (a single PCK archive in the UNITS folder).

Color Indexes

1. GeoScape World View.
2. Base Palette.
3. Graph Views.
4. Research Displays.
5. Tactical Palette.

See Also