Ultima Underworld Palettes

From Ultima Codex
Jump to navigation Jump to search

This document describes the colors palettes used in Ultima Underworld. This is highly technical behind-the-scenes info that is not useful to the typical game player.

Description[edit]

Ultima Underworld renders it's game screens in VGA (hardware mode 13h) that draws 320x200 pixels is an 8-bit paletted (256 unique colors per screen) mode. It's palette pulls from RGB colors at 6 bits per channel (18-bit true color) for a total of 262,144 unique colors. Compare that with more modern 8 bits per channel (24-bit true color) systems that have 16,777,216 colors to pick from.

Ultima Underworld has several different palettes, stored in several files. It has 8 main palettes (8-bit index, 256 colors) several 4- and 5-bit to 8-bit lookup palettes, shader lookup palettes, tranlucency lookup palettes, and palette animations/rotations. All of these things will be discussed below.

Main Palettes[edit]

The main palettes are stored in the file Data\Pals.Dat.

Each palette is 256 colors, and each color is 3 bytes, one for each channel of red, green, and blue. Though each channel only uses 6 bits, so the top 2 bits of each 8-bit byte go unused. Each palette is 768 bytes, and the file size is 6,144 bytes, so it hold exactly 8 palettes and no header or any other kind of data.

In all palettes color #0 is always the transparent color.

Palettes stored in data/pals.dat
# Image Where used
0 Uw1pal0.png Used in the main game screen

Not all colors are available in game, some are place holders for translucency look-ups

Color #0 is transparent, color #1 is true black, colors #2-15 are mostly full-bright non-animated colors used for spell effects.

Several rotations run at 5 per second:

  • Fire 1, 5 colors, #16-20, move up (lower index to higher)
  • Fire 2, 3 colors, #21-23, move up (lower index to higher)
  • Water, 16 colors in 4 blocks of 4, #48-63, move down (higher index to lower)
1 Uw1pal1.png Used in the map screen
2 Uw1pal2.png Used in the title screen

Rotation of 4 blocks of 16 colors, #64-127, each at 10 per second

3 Uw1pal3.png Used in the character creation screen
4 Uw1pal4.png Joke palette, used in the main game screen

Fire and water are blacked out, all other colors are mapped to simulate Apple ][e color palette

5 Uw1pal5.png Used in the splash screen
6 Uw1pal6.png Unknown usage, duplicate of #5
7 Uw1pal7.png Used in the game win screen

All Palettes[edit]

Aside from the 8 main palettes, the game has several other palettes. These are all main screen palettes, so really they just lookup into palete #0 (and technically, palette #5)

Consider this image:

Uw1pals.png

All this color data is stored in different places in the game, it is just gathered here in one image for convenient demonstration.

There are 4 blocks of colors:

  1. The first block is the 8 palettes from the file data/pals.dat, details of those are coverd in the section above.
  2. The second block has 3 sub-blocks:
    1. The first is the shades, it tells the game which color to shade a pixel when an object of the color has a certain light level on it. Notice that the fire/lava colors stay full bright all the time and that the water stays nearly full bright until the very end. This comes from the file data/light.dat
    2. The second is the same as the first, but it is used when the player is using a night vision spell. Notice that fire and water aren't affect by night vision's black and white palette. Notice that the fire and water aren't in grayscale and behave the same as the full color shading. This comes from the file data/mono.dat
    3. The third shows the palette rotations for the fire and water colors.
  3. The third block has two small columns:
    1. On the left are the 4-bit palettes used to draw item sprites and other 4-bit graphics. They are found in the file data/allpals.dat.
    2. On the right are the palettes used to draw the weapon POV overlay sprites. There are only two of these, one used to draw weapons wielded by players with light colored skin and the other for dark colored skin. This comes from the file data/weapons.cm
  4. The forth block has 6 color strips, mappings for 6 translucent colors: This comes from the file data/xfer.dat
    1. Black
    2. White
    3. Brown
    4. Green
    5. Blue
    6. Red

Not included here are the 5-bit Critter palettes. Since each critter has it's own set of palettes and they aren't used anywhere else in the game except for that one set of sprites, they weren't deemed important enough to include here.

PSX Version[edit]

The PSX-port of Ultima Underworld uses an entirely different engine. It is not limited to 256 colors on-screen and as such it doesn't use any of the same palette techinques that the PC version does that are described here. The PSX version stores it's graphics files in 8-bit paletted format, but each graphic can have it's own 256 color palette and the PSX hardward can display tens or hundreds of thousands of colors on the screen at once.

For all it's advantages, the PSX version does seem to have some missing features:

  • It doesn't emulate the PC's palette rotation feature, so water and fire graphics are static and unanimated
  • The shader doesn't seem to be programmed to make the fire/lava graphics full bright, so you can see dark fire and lava which seems odd.

For more details on the differences of the PSX version, see the article Technical Differences in Ultima Underworld on the PSX


Technical Details
Game Ultima IIIUltima IVUltima VUltima VIUltima VIIUltima VIIIUltima IXUltima Underworld