Palette
| This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article. |
To Do
|
The SRB2 Palette is the total set of 256 colors used by the game engine. All graphics used aren't stored with color values, but rather, by color index. The color index maps to an entry in the palette. Every graphic used in the game must adhere to these 256 colors, and each must also be saved in this palette, as well. Otherwise, the game will SIGSEGV upon trying to display the graphic. This doesn't apply to MD2 model textures, being OpenGL-exclusive.
Note that index 247 is understood as "transparent". This is shown as cyan because when a graphic with cyan pixels is imported into a lump editor, cyan pixels will be given index 247 when the graphic is converted. Those pixels will be invisible in SRB2 itself.
Contents |
Setting up the Palette
Regular images can't be loaded into a WAD file right off the bat, because their colors won't be displayed properly. This is because Version 2.0 has a new palette that is different from Doom's standard palette. Luckily, lump editors can change an image's palette:
XWE
Whenever you open XWE, it uses whatever palette is used in its config. So what you need to do is tell XWE to use v2.0's palette, and from there on, every image you load in a WAD file will be displayed correctly. You can do this in three ways.
Using srb2.srb
The first way is to simply open srb2.srb and use the palette in there. The advantage is that you don't have to save anything, but the disadvantage is that you have to open srb2.srb every time you open XWE, which takes a while to load.
- Open XWE and go to "View → Options".
- Make sure the "Perform Clean Up on exit" option is unchecked. Otherwise, SRB2's IWAD will be corrupted and the game won't start anymore.
- Opening v2.0's srb2.srb is generally the easiest way to reach the palette lump. You may also want to export the lump and open it every time instead of opening srb2.srb, which takes a few seconds to load.
- Choose the
PLAYPALlump located in srb2.srb. If you exported the lump as a file, then it'll be select by default, obviously. - Go to "Palette → Use current".
- Close srb2.srb without closing XWE (File → Close).
- Open the files with which you need to operate, and everything should be displayed properly. Obviously, it won't be right if you used an old version of SRB2's palette.
Saving the SRB2 Palette in the XWE Folder
The second way is to save SRB2's palette file in the XWE folder so that you can select it. The advantage of this is that you can convert v1.09.4's images to v2.0 quite easily because you can switch between palettes quickly. The disadvantage is that if you want use the v2.0 palette, you have to select it every time you open XWE.
- Open XWE and go to "View → Options".
- Make sure the "Perform Clean Up on exit" option is unchecked. Otherwise, SRB2's IWAD will be corrupted and the game won't start anymore.
- Open srb2.srb and select the
PLAYPALlump. - Go to "Palette → Save As" and navigate to the PALETTES folder inside your XWE folder.
- Save the file with a file name you can remember (SRB2v2.act, for example).
- Now you can select the palette for an image by going to "Image → Select Palette" and choosing the palette you saved.
Changing XWE's IWAD
The third way is to simply change XWE's IWAD so that it will load the v2.0 palette automatically. The advantage is that you don't have to set the palette every time you use XWE. The disadvantage is that if you switch to another palette, you can't switch back easily. You can prevent this by combining this with the previous option so you can select the v2.0 palette from the Palette menu after changing back.
- Find xwe.ini in your XWE folder and open it with a text editor like Notepad.
- Go to "Edit → Find..." and search for "MainWAD".
- The first time you see "MainWAD", change the text so that it points to srb2.srb, according to the following structure:
MainWAD,C:\Folder\Folder with spaces\SRB2\,srb2.srb. Make sure to put the commas in the correct places.
With SLADE
There are fewer steps and options to setting up the palette with SLADE. To change the palette, simply set the program to use v2.0's IWAD. To do that, go to "Editor → Select Base Resource Archive". Click on "Add Archive" and select srb2.srb (you have to type the filename in manually after navigating to the SRB2 directory). Then click OK and the palette should be selected. All files will show with the v2.0 palette now. To change the palette, select your IWAD in the "Base Resource" dropdown box in the toolbar.
Alternatively, you can save the SRB2 palette in SLADE's resources. This is normally not necessary, but allows more freedom when you want to use more than just two palettes.
- Open
slade.pk3from your SLADE folder and srb2.srb in another tab. - In
slade.pk3, you will see a folder called "palettes". Enter that folder and you will see several palettes. - Now switch to the srb2.srb tab, right-click on the PLAYPAL lump and select "Copy". Paste it into the "palettes" folder with Ctrl+V.
- Right-click on the pasted lump and click "Rename". Choose a name you can remember and add ".pal" as an ending (for example, SRB2v2.pal).
- If you want to, move the lump up until it is sorted alphabetically.
- Save the archive. Restart the program and you will be able to select the SRB2 palette in the "Palette" dropdown list.
Converting Images from v1.09.4 to v2.0
XWE
First you must have the SRB2 palette in your XWE folder. (See Saving the SRB2 palette in the XWE folder). After you have done that, follow these steps:
- Open the file that contains the image you want to convert.
- If you have v2.0's srb2.srb set as your IWAD, then go to "Images → Select Palette → doom" and click OK.
- Go to "Entry → Save As" and export the images.
- Go to "Images → Select Palette → SRB2v2" and click OK.
- Go to "Entry → Load" and open the images that you saved. They will be automatically converted.
SLADE
- Open the file with the IWAD set to v2.0's srb2.srb.
- Select all lumps that you want to convert and right-click on one of them.
- Select "Gfx → Convert to...".
- In the window that should open now, select "Doom Gfx (Paletted)" in the top list.
- Select "Doom" as "Current Graphic" and "Existing/Global" as "Converted Graphic". Both pictures should now look the same.
- Click "Convert All" to convert all selected graphics at once.
If you chose to save SRB2's palette into SLADE's resources, you can also select the saved v2.0 palette as "Converted Graphic". This allows you to choose whatever IWAD you want during the conversion process.
