[How-To] Palette Editing Tutorial (Finished)

Sun, 18 Jan 2009 05:28:02

Karnizero

As I told here, i will explain how to create or modify a Doom Palette (this also works for Hexen, Heretic and Strife games).
Some modern Source Port users (for example an ugly guy called F*rebrand <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> ) think that this is not useful, since the modern Source Ports can handle true color graphics without the need of a color palette.
Well, they are correct, modern SPs are "palette-indepedents", but also, knowing how to change/create a palette, will allow us new effects, in a couple steps, without coding, and keeping lot of time, for example:
-> Changing all original textures and sprites colors, without having to edit each of them.
-> Making special effects without scripting/coding, for example fog effect
-> Making certain game colors to be more bright/dimmer/reddish/blueish, etc...
-> Change the fade effects when player dies, picks up an item, receives damage, uses radiation suit, etc.., without coding.
If you want to keep a lot of time, and dont want to code for all those effects, the the Palette Editing is your friend.
Lets start.
[color=#FF8111:s90qavzk][size=150:s90qavzk]Basics on Editing a Palette[/size:s90qavzk][/color:s90qavzk]
[u:s90qavzk]1.- Materials: you will need the next programs:[/u:s90qavzk]
a) Duum. Yes, only Doom. You dont need a source port. You can even use Doom on DosBox. You will get the same results. Buy it on the nearest shop.
b) A Lump editor, such as Slumped, XWE, Wintex, or any other. Im using Slumped. The lump editor is not for Palette editing, just for WAD manipulation.
c) Inkworks. This is an important program. I will explain what this is for. You can download it here: [url:s90qavzk]http://www.doomworld.com/idgames/index.php?id=4890. Thats only a couple KBs. Download and uncompress it to any directory.
d) The Gimp. This is a powerfull graphic editing program. This allows to change the colors from a palette. You can do much more things, but thats not important right now. You can download it from [url:s90qavzk]http://www.gimp.org.es/modules/mydownloads
Well, thats all.
Once you have all programs installed, you can continue.
[u:s90qavzk]2.- Editing a palette with GIMP:[/u:s90qavzk]
It's suposed you have already installed The Gimp.
A palette, for Gimp, is a list of colors, defined as RGB colors.
Each list element defines the amount of Red, Green and Blue ink, of that color.
For example, the color RGB(255, 255, 0) is Yellow. The RGB(0,255, 255) is Cyan. And so on, to a total of 256 colors.
256 colors is the number of colors on Doom Palette. Other games can use more or less amount of colors. That depends on the engine.
Now, we go to the path "C:\Documents and Settings\<user>\.gimp-2.6" (or the gimp version you have download).
You will see a lot of folders. We are interested in a folder called "Palettes". Create on that directory a new simple text document. Edit it with notepad, and call it as "Doom.txt".
Now copy into it this whole text:

Save and close the text file.
Now rename it to "Doom.gpl".
Your Gimp Doom Palette is finished, and ready to be used and modified.
Now open The Gimp.
Dont start a new image. We dont need to do that now.
No, from the menus, go to "Windows > Dialogs > Palettes". That will open the Palettes Dialog.
Select the "Doom" item from the list, and double click over the small image.
Now you can edit each color from the palette. Use double click to edit an item.
When you finish the modifications, save the palette before close it.
Now create a new image ("File > New"). Create any size image. Thats not important.
Now draw a couple of lines on the blank canvas.
Then, go to "Image > Mode > Indexed". On the new window you will have to choose the palette. Choose "Custom Palette" and select the Doom palette you have just modified.
Now, uncheck the checkbox with the text "Delete unused colors from the final palette". This is important. If you dont do this, your palette will not work.
Finaly, save and close that image as a BMP image.
Next, we will create the palette for Doom itself, and we can preview it.
Execute Inkworks program.
Dont get scared for all those letters and MsDos like window. We are not going to use them all now.
On the menu (you can use mouse), go to "File > Import Base Palette".
You will get a dialog. On that dialog, find the BMP draw you created with The Gimp. The, press OK button.
If all is ok, then your palette should be loaded onto Inkworks.
You can preview it before importing to Doom.
You can click on any "Preview" button. Press Scape to exit preview.
If you like how your custom palette looks, then you can export it to a WAD.
Before exporting, you have to create a PWAD, so you can save it.
Dont export the palette to an IWAD, or you will overwrite the original Doom palette.
To create a PWAD, you can use any Lump editor.
You dont have to create a lump. A PWAD with a only Colormap and Palette, is valid.
Now return to Inkworks, and go menu "File > Export to Wad". On the new dialog, select the recently created PWAD.
Close Inkworks, and open the PWAD. You will see there two files: "Colormap" and "Playpal".
To test the palette in-game, simply add the PWAD to the command line parameters.
Here goes a sample on a modified palette. I made all palette colors to look brownish, the blue colors as red, and gave a bit more brightness to the original red colors, making blood and red eyes to look a bit more terrifying:
[img:s90qavzk]http://xs435.xs.to/xs435/09036/playpal432.png.xs.jpg[/img:s90qavzk]
[color=#40FFFF:s90qavzk][Next Day: Modifying the fading effects][/color:s90qavzk]

Sun, 18 Jan 2009 14:46:41

Karnizero

[color=#FF8111:xqgec74m][size=150:xqgec74m]Modifying the Fade Effects[/size:xqgec74m][/color:xqgec74m]
[u:xqgec74m]1.- Materials:[/u:xqgec74m] you will need the same programs as before: The Gimp, Inkworks, a Lump editor and Doom.
[u:xqgec74m]2.- Changing the Fade Effects:[/u:xqgec74m]
With this second Palette tutorial, we can change the game effects when we die, pick up an item, or use Invul/rad. suit.
We dont need to edit the palette with Gimp, so that is an optional step.
If you want a general custom palette, then you have to use The Gimp, and then import the palette into Inkworks, as we learn before.
Now lets open Inkworks. In this second tutorial, we will use this program to modify the palette, but not the colors, just some palette definitions, such as fading effects.
Once you open the Inkwork, you will get a MsDoS window like this next. You can see different elements. We will learn how to use some of them:
[img:xqgec74m]http://img167.imageshack.us/img167/2619/inkworksmainiy6.jpg[/img:xqgec74m]
Lets start modifying the "damage fading" effect. Actually, you cannot change the color the screen flashes when you take damage or die, by usin Inkworks. You have to edit the palette itself with The Gimp.
As you see, there is a section called "Damage Fade". There you can change the feel of the screen flash when you take damage or die.
You can click on the desired effect, and then on "Preview". Press ENTER on the preview screen to test your fade effect.
Now lets change the color of the screen when you pick up the Invul. Artifact. On the section "Invulnerability Colour Range", you can set the color range of the screen when you take this object.
You can think the Range is a list of color who will tint the screen, using those both colors and the intermediate colors brightness. For example, if you pick up the colors Red and Green, your screen will change to red and green colours, with different brigt values, but not the mix of bot colors (would be yellow on this case).
An example for this: if you want the screen to feel like gold, you have to set a range of Yellow and Brown colours, going to Black.
Finally, click on "Build Range and then on "Preview" to test your first screen effect. Press SPACEBAR to activate and deactivate the Invulnerability effect. Dont forget to build the range, or you wont see your changes applied.
We will change the Radiation Suit screen effect, and the PickUp screen effect color now.
This is easier than the Invulnerability effect.
On the section "Miscelaneous" you have the "Radiation Suit and "Item Pick-up Colour" options. Click on the colors and choose your desired color.
As you probably noticed, both effects are not a color range.
This is because the whole screen will tint all textures and sprites with the choosen colour.
You can also click on "Preview" to test those both effects.
Well, i think it's enough for today.
To test your new palette effect on the game itself, go to "File > Export to WAD". Select the PWAD you want to store your palette. Dont forget to create a PWAD with your favourite lump editor.
And finally, run the game (you dont need a source port) and admire your work.
[color=#40FFFF:xqgec74m][Next Day (will be next weekend): Fog, Underwater Feeling, Hell Ambience, Dust Fog][/color:xqgec74m]

Sun, 18 Jan 2009 14:47:46

Karnizero

[color=#FF8111:2cqw462v][size=150:2cqw462v]Fog, Underwater Effect, Hell Ambience, etc...[/size:2cqw462v][/color:2cqw462v]
This is the last tutorial's chapter, and here we will learn how to make some nice effects, allowing us to change drastically the game feeling.
[u:2cqw462v]1.- Materials:[/u:2cqw462v] although the title of this last chapter sounds pretty hard, those effects are quite simple, and your maps will look impressive. We will need only Inkworks and a Lump Editor.
[u:2cqw462v]2.- Creating any king of fog effect:[/u:2cqw462v]
First, execute Inkworks.
Nearly in the top of the window, you will see a "sub-window" called "Distance Fade". This is what we will use right now.
This is where we can change the color the game will fade to when the player is looking to the distance in a bright sector/s.
Note that this effect is only viewable when the player is looking AT bright sectors, and not when the player is AT bright/dark sectors. This is, the efect is independant of the player's position in the map. Does not matter if the player is in a dark or bright sector, because the effect will be only viewable if he is looking directly to the bright sector from the darker one.
Here is a screen showing the "Distance Fade" sub-window atop the main window:
[img:2cqw462v]http://img167.imageshack.us/img167/2619/inkworksmainiy6.jpg[/img:2cqw462v]
Choose a "weak" color, not a strong one, or the player field of view will be reduced drastically.
An amount higher than 125 or 130 will make the game visualization a bit harder for medium - far distances.
Some sample of a map with different Distance Fade values:
[size=85:2cqw462v](click images to enlarge. Arround 200 Kb per image)[/size:2cqw462v]
Original Doom Palette:
[img:2cqw462v]http://xs435.xs.to/xs435/09045/nofog340.jpg.xs.jpg[/img:2cqw462v]
Underwater feeling [RGB(10, 10, 80)]
[img:2cqw462v]http://xs435.xs.to/xs435/09045/fog01764.jpg.xs.jpg[/img:2cqw462v]
Hell Ambience [RGB(80, 10, 10)]
[img:2cqw462v]http://xs435.xs.to/xs435/09045/fog02347.jpg.xs.jpg[/img:2cqw462v]
Sandstorm [RGB(100, 80, 60)]
[img:2cqw462v]http://xs435.xs.to/xs435/09045/fog03958.jpg.xs.jpg[/img:2cqw462v]
For general reference, the sector illumination for the map in the image was 145 Doom light units.
Thats all.
I hope you enjoy those effects much.
Cya next How-To. <!-- s:-D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":-D" title="Very Happy" /><!-- s:-D -->
Note: if i have time this weekend, i will write this to the Vavoom Wikia. If not, the next weekend will be.