Changing the default
palette of Duke Nukem 3D
[second edition; contains
major revisions]
By Usurper
aesire@hotmail.com
Thanks go to:
--Ken Silverman for his valuable information on the palette.dat structure,
transpal.exe and its keys, and editart keys as listed in the build docs (not to
mention creating a great game engine and the utils for it).
--TerminX for his initial help with my palette conversion.
--James Ferry for his information and assistance, and for creating
OpenGL BuildTouch 2.1, which makes palette editing a lot easier.
_________________________________________________
Intro
1. Creating a new palette
(Paint Shop Pro or OpenGL Buildtouch 2.1)
2. Importing it via editart
3. Fixing the palette.dat
file (transpal.exe and Opengl BuildTouch 2.1)
_________________________________________________
Intro
If you are making a TC or
other advanced build engine project involving graphics, you may wish to alter
the default game palette. You will
first have to construct a new palette to import via editart. I'll explain how to do this with Paint Shop
Pro 5 and 6 (probably works with other versions as well).
1. Creating a new palette
The game uses a 256 color
palette. Each individual color is made
up of three numbers. These three
numbers are it’s r/g/b values. They
tell how much red, green, and blue is mixed to create the color. Each value can range from 0 (least amount,
darkest) to 63 (greatest amount, lightest).
Windows palette files usually range from 0 to 255. You can either make your palette in a
windows program such as Paint Shop Pro 6 (http://www.jasc.com)
or you can make it in James Ferry’s OpenGL BuildTouch 2.1 program (http://www.dukeworld.com/oglbt or http://members.xoom.com/HCAD).
Keep in mind that if you
want the colors to shade properly, a bright blue will need darker blues to fade
to before fading to black.
Paint Shop Pro 5/6 (from
scratch):
Paint Shop Pro 5/6
(modifying regular palette)
OpenGL BuildTouch 2.1
2. Importing it via editart
If you created your palette
in a windows program such as PSP, make sure you’ve saved an image with the new
palette in non-interlaced gif 89a format.
Open editart and select a blank tile.
Size the tile, then press u to import the image that contains the new
palette. **IMPORTANT NOTE The image that you select must not be in another duke
directory. If so, it could cause
unusual things to happen, changing the palette of the directory the image is in
rather than the desired directory.**
Select the image from the list and press enter. The image will appear with a white box
around it. Now, instead of pressing
'enter', press 'P'. A message will
appear asking if you want to make this the new build palette. Press 'Y'.
You may have to wait a few moments for editart to finish writing the new
palette.dat file. Press enter to finish
importing the image.
3. Fixing the palette.dat file
The palette.dat file
contains more than just the palette. It
also contains the number of shade tables, the shade table information, and
transparency information. This information
isn't set up automatically when you change the palette, nor does it use the old
information by default. There's a
program called transpal.exe that can fix the file, assuming you know what the
figures to input and the right keys to press are.
The command line parameters
for transpal are:
Transpal [number of shade
tables] [translucency number] [r] [g] [b]
(rgb values are optional)
There are usually 32 shade
tables in the palette.dat file.
Originally, there were going to be 64, but the number was dropped to 32
for the sake of slower machines. I
don’t recommend using any number but 32, as some odd bugs have crept up in my
tests. Also, you would be forced to
re-shade any map you have already started with the original 32-shade-table
palette.
The translucency number ranges
from 0-256. Were it set on 0, the first
translucency setting would be totally invisible, and the second would be
solid. If it is set to 256, the first
translucency setting would be solid, and the second would be invisible. 160 and 170 are the example values, which
appear similar to the standard values.
The RGB values are
optional. I don’t recommend using
them. The default values look
fine. Feel free to experiment though.
Once you’ve typed the
correct command line information, hit enter.
You’ll see colors streak across the screen. There are three key commands for transpal that you can now use.
You’ll probably want to
just hit enter and save both.
According to Silverman,
some teams wanted to use another program to write the shade table information,
hence the reason for the space command.
The reason for this is likely to create full-bright colors. You may have noticed full-bright colors in
the default palette. The last 16 colors
are not affected by shading in any way.
This is because the shade tables were modified to prevent this. You can modify the shade tables to add
full-bright colors to your palette using OpenGL BuildTouch 2.1. I must warn you that it is a very tedious
process due to the number of shade tables.
© 2000 Matthew Palmer
An R.T.C.M. Document