Using SLADE to Palette-ize Daggerfall Unity images

Discuss modding questions and implementation details.
Post Reply
User avatar
Mosin Nagant
Posts: 40
Joined: Thu Nov 16, 2017 2:06 am
Location: Land of the Free, Home of the Brave

Using SLADE to Palette-ize Daggerfall Unity images

Post by Mosin Nagant » Sat Dec 02, 2017 4:51 am

Using SLADE to Palette-ize Daggerfall Unity images
SLADE: It's a Doom editor!

Let me know if the spoilers aren't working. I'm having trouble with them for some reason, and I'm not sure if its just on my end or not. There is no vital information contained in them.

While SLADE only has a very limited capacity to mod Daggerfall, I have found it to be a fairly helpful tool in the process of file renaming and sprite editing. This tutorial will cover the following:

→Setting up SLADE to be useful for editing Daggerfall image files extracted using Daggerfall imaging.
→Palette-izing images
→Palette translations
→File renaming
→Exporting as .png for use in Daggerfall Unity

While this tutorial seems very long, don't be dismayed. The instructions are simple and illustrated, so it should be a breeze! I'll be updating a "Possible Problems and Solutions" section at the bottom of this post in case you run into trouble. I'll also monitor this thread pretty frequently for the near future, so if you have questions, ask away!

So why use SLADE to edit sprites instead of GIMP?

The purpose of this tutorial isn't to show you how to replace GIMP with SLADE. SLADE simply doesn't have to ability to edit images like GIMP can. Rather, the two are complimentary. GIMP is fantastic for editing sprites and other 2D art related aspects of mod development, but I've found that it's ability to palette-ize sprites is rather lacking. Moreover, managing palettes in GIMP has been a massive pain in the rear for me, and it seems GIMP as no ability to do palette translations. SLADE, on the other hand, seems to do all this quite well and in a user-friendly manner to boot.

What is SLADE ?

For those aware of what Slade is, you can safely skip this section.

I'll save some writing and just quote the about page from Slade's website:
SLADE3 is a modern editor for Doom-engine based games and source ports. It has the ability to view, modify, and write many different game-specific formats, and even convert between some of them, or from/to other generic formats such as PNG.
Acquiring SLADE
While I'm not going to walk you through how to use your computer and install software, I'll point you in the right direction for acquiring SLADE.

The following link leads to the download page for SLADE:
http://slade.mancubus.net/index.php?page=downloads

Use the link above and choose the appropriate version for your Operating System. For windows users, the simplest route is to download the "Windows Installer (exe)" version under "Latest Stable Release." This way, you don't need to manage loose files or portable installations, etc...

Setting up SLADE
to be useful for editing Daggerfall image files

While SLADE itself can't view Daggerfall's native image format, Daggerfall Imaging can. Alas, Daggerfall Imaging falls outside the scope of this tutorial, but we'll be using images extracted from it in this tutorial. I suggest using .PNG format for images. However, png files loaded into SLADE aren't automatically palette-ized. We need to tell SLADE what the Daggerfall palette is.

I have provided a png image of the palette that should be 100% accurate to Daggerfall's original palette with two exceptions: Color 0, Daggerfall's transparency color, and color 255, a special color that glows yellow at night (used in Daggerfall's windows), have been changed to cyan (#00ffff). This is to prevent SLADE from using these colors in palette-izing images, as png already supports transparency and it would be an undesirable result for it to use these two colors, since it wouldn't be accurate to vanilla Daggerfall.

Palette link:
http://www.mediafire.com/file/vps4vap6l ... aggPal.png

The first thing we need to do is start SLADE.
Image

Create a new ZIP archive by clicking the "New Zip Archive" button in the upper left hand corner.
Image

Wait a second, and SLADE should now look something like this:
Image

Now go to Archive→ New→ New PLAYPAL
Image

Click the "OK" button on the resulting window
Image

You should now have a file in your Archive called "playpal.lmp." This is our palette file, but that sure ain't no Daggerfall palette. Download the Daggerfall Palette png file from the link above, and save it somewhere you can remember. Right click "playpal.lmp" and go to Palette→ Import From...
Image

Change your file type to "PNG File" and open the PNG you downloaded. Your playpal.lmp should now look like the png you just downloaded.
Image

Now make sure you save it so you can re-use this file and not have to go through this process again!

:D Good job! The most complicated part is over and our palette should now be ready to go! :D

A quick note regarding how I generated my palette image:
If you don't want any technical info on the inner workings of this, you can skip this and be just fine.

For full transparency: the way I generated the palette image in the download link was by taking the image of the Daggerfall palette from http://images.uesp.net//f/f4/DF-Art_Pal.Col.Palette.png, opening it in GIMP, and shrinking down the image to be 16x16 with no interpolation. I have done numerous tests, and it has been 100% accurate to Daggerfall's colors.
Palette-izing Images
Finally! We're getting to the good part!

Now that our palette is set up, palette-izing images is a piece of cake. Click the "Import files" button near the top of the screen.
Image

Select any valid image files you want to palette-ize. (png, bmp, jpg, etc...) Once you've imported them into SLADE, right-click the entries you want palette-ize (you can select several with standard windows selection keys, Shift+click, and so on). Go to Graphics→ Convert to..., and the following windows should appear.

We are converting it from a standard image format to Doom's paletted image format. This will allow SLADE to preform palette translations on your image. Click convert, and you're done! :)

Image

These images can be exported back into png by right clicking an entry and going to Graphic→ Export as PNG, or using the "Convert to..." menu.

Preforming Palette Translations

This is even easier than the previous parts of this guide.

Simply select the entries that have been converted into Doom's image format as described in the previous part, right click on them and go to Graphics→ Colour Remap. In the window, you have two sets of colors: Origin Range, and Target Range. Origin range describes the colors in the image that you wish to modify, target range describes what those colors will become. You can select colors in either by clicking and dragging. To avoid losing detail, make sure the size of your selection in both ranges is the same.

For instance, if you want to change 16 shades of blue in the origin range, then select 16 shades of another color in the target range.

Additional translations can be created with the plus and minus buttons in the upper left-hand corner of the menu. The best way to figure out how all of this works is to just play around with it and experiment.

Image

Image Image
Either they're praying, as good monks do, or listening to the heaviest of metal.

Renaming and Exporting Files

For this segment of the tutorial, you'll want to familiarize yourself with Daggerfall Unity's image naming format. An excellent explanation of it can be found here:
http://www.dfworkshop.net/projects/dagg ... /textures/


Recoloring stuff is great, but it if doesn't comply with Daggerfall Unity's image naming format, then it's not much use. The process of renaming files is straight forward, as with most things in SLADE. In my example, you can see that nothing here comes remotely close to the standard.

Start by selecting all images you want to rename. Right click your selection and click "rename."

If you're images are not sequential frames in an animation, i.e., you're replacing multiple static sprites in an archive file, you may find the "Rename Each" function more useful.

Image

You'll get a window like this, perhaps with some gibberish in it. Enter the appropriate code to rename images. This is example demonstrates how to rename frames in animation.

Image

You should end up with a result like this:

Image

Occasionally, some entries will have their file extension still attached (".png," ".jpg," etc...). Just select those entries individually and remove it using one of the renaming functions.

To export the files as png, select all the images you wish to export, right click and go to Graphics → Export as PNG.

Image

All you have to do from here is select a folder and click save, and you're done!

You're filename here doesn't matter, but using the name of an existing file may replace that file. The best practice is just to leave it as "ignored.png"

Image

Conclusion

You now know how to use SLADE to manage and modify some of your Daggerfall Unity files. SLADE wasn't built specifically for this, so it certainly isn't a comprehensive tool set for modding Daggerfall Unity.

If you have any questions or are experiencing any difficulties, feel free to leave a post and I'll do my best to help you out! Point out my typos, too. I'm sure they're there!

I plan on adding comparisons between images palette-ized by GIMP and by SLADE so you can have a side-by-side of the two. This will come at a later (near future) date.

Possible Problems and Solutions

When I convert my image to Doom's file format, it doesn't palette-ize it correctly. The colors are strange.

Ensure that every step was followed accurately in the Setting up SLADE section of this tutorial. If that doesn't work, ensure your palette is set to "Existing/Global"
Image

I will continue to update this section as issues arise.
Last edited by Mosin Nagant on Sat Dec 02, 2017 5:52 pm, edited 3 times in total.
Previously known as LordMordecai on DXL forums

User avatar
Mosin Nagant
Posts: 40
Joined: Thu Nov 16, 2017 2:06 am
Location: Land of the Free, Home of the Brave

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by Mosin Nagant » Sat Dec 02, 2017 4:52 am

Reserved
Previously known as LordMordecai on DXL forums

User avatar
King of Worms
Posts: 639
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by King of Worms » Sat Dec 02, 2017 11:34 am

Very nice tutorial, thanks a lot!
This might come very handy. Im gonna try this. The spoiler parts do not open to me as well.
Spoiler!
I create spoiler by typing this text, selecting it all and clicking spoiler on the top of the text input field - its right to the "youtube" button & left to the "s" button

User avatar
TheLacus
Posts: 626
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by TheLacus » Sat Dec 02, 2017 12:31 pm

Great work!
Note there is a limit of one spoiler/quote per post.
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
Mosin Nagant
Posts: 40
Joined: Thu Nov 16, 2017 2:06 am
Location: Land of the Free, Home of the Brave

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by Mosin Nagant » Sat Dec 02, 2017 5:56 pm

Thanks for the feed back, guys! :)

I tried both things with the spoilers and still can't get them to work. I'll look more deeply into it later today, but for now I've just removed them and put the information in a quote.
Previously known as LordMordecai on DXL forums

User avatar
King of Worms
Posts: 639
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by King of Worms » Tue Dec 05, 2017 4:37 pm

it appears to me that spoilers dont work now when you want to put a image inside them...

User avatar
King of Worms
Posts: 639
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by King of Worms » Fri Jun 29, 2018 12:55 pm

Ok this seemed scary but when I went step by step, I did it and next time it will be super easy. Thank you!!! This will be very handy indeed.
Original:
010_2-0.png
010_2-0.png (628.61 KiB) Viewed 444 times
Adjusted:
010_2-0b.png
010_2-0b.png (80.62 KiB) Viewed 444 times

Interesting byproduct is reducing the size almost 10 folds???? What is happening here?

User avatar
King of Worms
Posts: 639
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: Using SLADE to Palette-ize Daggerfall Unity images

Post by King of Worms » Fri Jun 29, 2018 3:58 pm

This is a godsend man... with this I can repair all the textures which have a wrong color compression resulting in that disgusting magenta tint. Plus I can optimize SOME of the textures size considerably without even 1% of compromise in quality. :geek:

No more purple BS all around!

Original - these stones are NOT supposed to be purple:
135_3-0.png
135_3-0.png (100.5 KiB) Viewed 425 times
Corrected - no more purple shades - instead we have 10 shades of grey:
135_3-0b.png
135_3-0b.png (98.91 KiB) Viewed 425 times

Post Reply