Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

BAM sprites palette question

I was working with the frames and animations in the bam files which have alot of the character frames. These are mostly the BAMS in BG which begin with letter C (ie like CHFW2CA.BAM). The palettes on these are not the colors actually appearing in the game, and expect there is some conversion routine or formula which can change the color palette in various ways to reuse the same sprite but have different palette. Is this routine or formula documented anywhere on how to convert the frame colors to the actual game colors?

Comments

  • leekunleekun Member Posts: 12
    Sorry for bumping an old thread.
    I want to know this too.

  • leekunleekun Member Posts: 12
    edited September 2017
    Ugh... I just read both of those threads but still not understand very much.

    I simply want to extract the actual game colored animations.

    I wonder if anyone here could lists me some example steps using NI to achieve my goal.

    Post edited by leekun on
  • leekunleekun Member Posts: 12
    Still don't understand how to do it. The first thread said something about palettes I tried skimming through data and found files named palxx then I tried applying those to the animations but got an error...
    Anyone please guides me through this. I just don't know what to do...

  • Sam_Sam_ Member Posts: 141
    edited September 2017
    leekun said:

    I simply want to extract the actual game colored animations.

    That isn't the original question you said you wanted an answer to.
    leekun said:

    I wonder if anyone here could lists me some example steps using NI to achieve my goal.

    There are not separate BAM (animation) files for every possible color combination available in the game: you can NOT simply "extract" the BAM files from the game in the color combinations you want. There is one set of BAMs (for each animation) that is dynamically recolored by the engine. What it is dynamically recolored to is determined by A) the 'default' values in the CRE file (see offsets 0x002c thru 0x0032 for Metal Colour Index thru Hair Colour Index), or B ) the default values are overwritten by Effect Opcode 7 either directly on the CRE file or as an effect on worn equipment.

    While you theoretically can export the BAMs for a particular animation and then repalette them to use the colors you want, there is almost no conceivable reason why you would actually want to do this, nor do I believe this is actually what you want to achieve. The niche cases where one would genuinely want to do this are so obscure I only know of one person to have ever done it (in this context), and that was Erephine (the god behind 1pp and Infinity Animations). While I'm probably one of the few modders still around that could step you through this process, it involves a handful of tools (some of which are quite buggy) and is a moderately involved process. So before I go to the trouble of typing up pages of step-by-step guide, what is the end result that you actually want to achieve by doing this? If it's just change the colors of your character (or a creature) in the game, then see the previous paragraph.

  • leekunleekun Member Posts: 12
    Okay, I'm more or less understand this a little better now.

    I used NI to skim through CRE files and found metal color index for Vhailor which is 129. Then I checked his palette color index in bam file and found that his #129 color index which is grey (90, 74, 57). It is indeed, should be his in game weapon color. But what to do next? Edit Bam and replace the Teal indexes one by one? Is that right? Please help me a little more.

    I just want to extract Dak'kon and Vhailor animations with in game colors. I'm gonna use them in another game. So just be able to extract all of animation sequences in actual game color in BMP or PNG is my goal.

  • Sam_Sam_ Member Posts: 141
    Congratulations. To my genuine surprise you actually do want to repalette the exported BAMs. Unfortunately the primary tool I had in mind (around which the other tool chain was linked) only works on BG and IWD style paletted BAMs, and not the PST style. This means that you are correct in that you will have to edit each BAM palette individually and replace the teal entries with the color range of your choosing, probably employing linear interpolation in 3D RGB colorspace. Dak'kon for example will require you to do this for all 16 *dkkb.bam files.

    The 'lightest' teal entry is rgb(75, 255, 255) while the 'darkest' is rgb(0, 63, 63). If you give me the corresponding lightest and darkest palette entries in the color range you want to recolor the BAM to, I'll try to help with the math (if you want).

  • GwendolyneGwendolyne Member Posts: 163
    leekun said:

    ...
    I just want to extract Dak'kon and Vhailor animations with in game colors. I'm gonna use them in another game. So just be able to extract all of animation sequences in actual game color in BMP or PNG is my goal.

    Sam_ said:

    ...
    Unfortunately the primary tool I had in mind (around which the other tool chain was linked) only works on BG and IWD style paletted BAMs, and not the PST style.

    A few years ago, a French modder wrote a tuto explaining how to create/modify PsT palettes.
    It is written in French but it is not that difficult to understand if you follow the pictures. ;)

  • leekunleekun Member Posts: 12
    Sorry for late reply.

    I'm not gonna replace color indexes one by one anymore, instead I'm using hue/saturation. What I have to do is simply try to adjust the colors as close as in game colors as possible.

    Thanks so much for answering all my questions!

Sign In or Register to comment.