Page tree
Skip to end of metadata
Go to start of metadata

PLT files - Packed Layer Textures - offer support for multiple layers and are used for tintable armor/body parts for multipart complex models (player characters), tail models and wing models. They can be interpreted as 10 grayscale textures, which can then be tinted separately.

This is a solution circa 2002 for the problem of easily editable colours on items / armor etc. Because of this it might seem archaic in the present day and there may be other options nowadays with shaders.

File Format Heirarchy

Note that PLT files are loaded over the top of TGA files, but under DDS files (ie a DDS file is the first one checked for). Only certain objects can load PLT files in the first place as noted below: creature body parts/armor/helmets/cloaks and their icons, and tail/wings.

Tools

Some PLT tools:

PLT Files Basics

You basically have a standard TGA-like image, but with a number of "layers" - these layers don't really overlap they merely represent which colour option affects which pixel.

The easiest way to edit them is likely the GIMP plugin where the layers for each colour selection can be generated, and thus cutout portions of which part of the image should be tied to which layer can be done.

They can only be applied to:

  • Multipart creature appearances (usually just the default player races, eg Human, Elf, Dwarf etc.)
    • Armor on these appearances (and their icons) replace limbs and torso but not the head
    • Helmets (replaces the head object)
    • Robes (slightly different - it replaces the shoulder body parts of the current armor/body) and their icons
  • Tails - see tailmodels.2da
  • Wings - see wingmodels.2da

While shields, weapons and other held items technically can be more advanced as of writing I am not sure they do support PLTs.

PLT File Usage

You can use PLT files to define the colours in the toolset (or via. scripting) of an object. For instance a specific armour piece could have a red breastplate with one appearance and blue with another.

Since it applies to complex models, meaning a lot of different little models for each race / gender, it can be quite time consuming to make them. Robes have some shortcuts (although a lot of file duplication).

For non-complex models you might be able to workaround this by using tailmodels.2da or wingmodels.2da. The tail.models.2da may be easiest since it already uses a lot of existing model appearances there (used pre-EE to scale certain monsters) so should be simple to replicate and already have a set of "invisible" appearances to attach to properly with the right orientations.

  • Note with this method the PLT textures do not show up properly in the toolset only in the game

You can't apply PLT files to simple models even with script commands, the engine just doesn't like it.

Palette limitations

The palette itself used for PLT files is a specific set of options, not a simple RGB number. Some of these options are quite odd looking in certain situations!

There are always 176 (0 - 175) options in the palette (relevant for script commands).

Each layer has different options - well, a choice of 4 as noted below. The texture names used by the game to replace the colours is hardcoded - ie no more than 176 entries and the file is loaded in a particular way. The "pal_xxx01.tga" files are 256 x 176, with presumably each colour option being a line. The X axis appears to be the amount of alpha applied - for presumably environmental maps and other shiny/matt purposes.

Due to how they are loaded please fill in this section if you've tried to replace them; they might be loaded at client load thus not available for use in Hakpack files. For sure there is a selector texture loaded by the game used in character creation - gui_pal_xxx.tga - which may need also changing to match changes to pal_xxx01.tga files.

Default Palette Files

The BMP files are only used by the toolset. The in-game selectors are limited since you can only select the skin, hair and tattoo in-game (at chargen). The BMP files could be converted to TGA/DDS to be used in game if necessary.

Layer NameToolset Options PicturePalette TexturePalette Texture NameIn Game Selector TextureToolset Selector TextureNotes
Skin

pal_skin01.tgagui_pal_skin.tgamvpal_skin.bmpNot sure if selector texture is for in-game as well as toolset
Hair

pal_hair01.tgagui_pal_hair01.tgamvpal_hair.bmp

Tattoo 1

Tattoo 2

Cloth 1

Cloth 2

Leather 1

Leather 2

pal_cloth01.tga

pal_leath01.tga

pal_tattoo01.tga

gui_pal_tattoo.tga

mvpal_cloth.bmp

mvpal_leather.bmp

mvpal_tattoo.bmp

pal_cloth01 and pal_tattoo01 are identical, but it might be you could use different colours in each.

Metal 1

Metal 2

pal_armor_01.tga

pal_armor_02.tga


mvpal_armor01.bmppal_armor_02.tga seems to be a lightened version of 01. Presumably that PLT layer is a bit lighter / brighter in game even if the toolset shows the same options.

Engine Usage

The engine will load the PLT files in and convert them to a texture for the GPU using the CPU, with whatever colours were selected for the given object. Since this is all client side there is nothing special on the server side for it.

File Format Information

PLTs are binary files consisting of a 24 byte header and an image data block. The image data consist of 2 bytes per pixel, each representing a (color, layer) tuple.

Example File

ByteValue

0"PLT "50 4C 54 20File type


Header

4"V1  "56 31 20 20Version
8
0A 00 00 00Unused
12
00 00 00 00Unused
166440 00 00 00Width
2012880 00 00 00Height
24(255, 1)FF 01Pixel 0


Data

26(120, 9)

78 09

Pixel 1

. . .
16404(255, 2)FF 02Pixel 8191

Valid layer Ids

IDLabel
0

Skin

1Hair
2Metal 1
3Metal 2
4Cloth 1
5Cloth 2
6Leather 1
7Leather 2
8Tattoo 1
9Tattoo 2




  • No labels