Jump to content


Photo

How to create high quality palleted animations?

pallete animation npc character

  • Please log in to reply
8 replies to this topic

#1 Gamemacik

Gamemacik
  • Member
  • 55 posts

Posted 18 May 2020 - 11:21 PM

Hi,
i try to create new palleted npc animation, the pallete is same as for character animations in BG2:EE.
 
I ran into several problems:
1. Resizing (resampling, downsampling, to make it smaller) animation gives very poor results, same with NearInfinity, Photoshop, or other tools if Nearest Neighbor algorithm is used.
2. When i used bicubic algorithm i got much better results but this method will change colors of pixels which are restricted by pallete, so when resized image is palleted again pixel colors are messed, eg, Hair color pixels appears somewhere at body skin (colors [15,A-H] on picture), or on Minor color clothes of npc (colors [15,I-P] on picture).
 
I render animation from 3DSmax with turned OFF Antialiasing and Filter Maps so i get exactly same colors as are in the pallete. Exported NPC is same size as the palleted texture, so high of npc and texture is 1:1, note: the texture is already palleted with same colors which are required for palleted characters.
NPC is resized from 106x224px to 38x80px.
 
3. Palleted animations in  BG2:EE use some colors from pallete which are used for both colors eg. "Minor" and "Skin"  colors, when we move color customization slider in the game. Color pixels will change if first or second slider is moved (1 color belongs to two sliders, or two sliders use same color...), these colors are used for smoothing, transitions between colors (256 colors, 8-bit images supports Nearest Neighbor algorithm only). I do not know how they got these transition colors to correct place (doing it manually with pencil.., 1000 slides that would take long time...fuh).

0748VqOl.png qpHNxUVl.png
 
 
Following table shows other colors which are not connected to any slider, first row is color in the pallete an second row, how are colors displayed in the game.

FDCzi0xl.png

Also IE animation are not perfect eg. CHMB1G17.bam, eyes lulz :D
 
3f22IsM.gif

//edit: Updated Color table for Armor, Leather, Metal


Edited by Gamemacik, 10 June 2020 - 02:42 AM.

For modders:
Animation resources: NWN RED DRAGONTRWNDbl.pngDRAGONWHELP PACK+DRAGONBREATHTRWNDbl.png
For loosers: SPOILER ALERT! RCEuOoU.pngQeZVcUw.png


#2 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 20 May 2020 - 04:52 PM

I'm not sure I quite follow everything you are asking, but have you tried using BAM Resizer to resize BAMs?  Also see 1pp New developer resources for some useful notes as well as my rewrite of Erephine's Palette Generator (described in that same topic).  You can find a list of the different assignable color "locations" on the IESDP, but those aren't my favorite descriptions.  Presumably if the same pixel is modified by changing the colors assigned to more than one gradient, it belongs to one of the mixed gradients and not one of the primary seven.  I do not recall if I have personally observed this behavior in the games, but I haven't studied the EEs that closely.  As far as tricking your particular image editor into using the appropriate gradients in the palette, that's program specific and I don't have much advice.  Gwendolyne might.


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#3 Gamemacik

Gamemacik
  • Member
  • 55 posts

Posted 21 May 2020 - 03:06 AM

I tested BAMresizer, it gives same bad results as NearInfinity or Photoshop, i guess it also uses Nearest Neighbor algorithm. Nearest Neighbor is incredible bad for very small animations where every pixel and color is very important.
I have already seen Palette Generator, but i do not need to generate pallete, pallete its already in the game, question was more if anyone was successful with creation of custom made pelleted NPC with pallete posted above.
 

This was not clear? "I do not know how they got these transition colors to correct place" These colors works like antialiasing probably.
iXgMgyLl.png


Edited by Gamemacik, 21 May 2020 - 08:01 AM.

For modders:
Animation resources: NWN RED DRAGONTRWNDbl.pngDRAGONWHELP PACK+DRAGONBREATHTRWNDbl.png
For loosers: SPOILER ALERT! RCEuOoU.pngQeZVcUw.png


#4 Ange Musicien

Ange Musicien
  • Member
  • 60 posts

Posted 07 June 2020 - 12:33 PM

Hello,

 

I'm dealing with similar concerns.

 

Could you tell me where did you find the original palette and how you decided where each color belong ?

 

Wouldn't GemRB developpers have a better idea about that since they had to write a motor for that ?



#5 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 07 June 2020 - 03:13 PM


Hello,

 

I'm dealing with similar concerns.

 

Could you tell me where did you find the original palette and how you decided where each color belong ?

 

Wouldn't GemRB developpers have a better idea about that since they had to write a motor for that ?

Palette.png

Attached File  Palette.rar   1.06K   230 downloads

This is the palette, although there are some rare variances (examples can be found in this post.)


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#6 Ange Musicien

Ange Musicien
  • Member
  • 60 posts

Posted 08 June 2020 - 07:32 AM

Thank you !  :Bow:



#7 Gamemacik

Gamemacik
  • Member
  • 55 posts

Posted 10 June 2020 - 03:32 AM

Hello,
 
I'm dealing with similar concerns.
 
Could you tell me where did you find the original palette and how you decided where each color belong ?
 
Wouldn't GemRB developpers have a better idea about that since they had to write a motor for that ?

 
I updated remaining colors in the color table. The second table in my first post.. to be exact the color which shows in the game may not be exactly as is shown in the second table, it depends which colors character uses or if he has some buff which modifies these color (buff can be from some item, armor, weapon or spell...) or simply it can be changed via NearInfinity editor or EEKeeper. We can change colors Hair, Skin, Major, Minor by moving slide bar in the game but remaining colors Armor, Leather, Metal can be changed manualy via editor only eg. EEKeeper.
I extracted palette with NearInfinity from bam file which i modified in my case it was CHMB1G12.BAM
 
I modified paperdoll BAM file to display color table in the game, and checked which colors are changed when slide bar is shifted. To change colors for Armor,Leather,Metal i used EEKeeper Editor.
 
Below i posted animated PNGs (gif are limited to 256 colors and they would not display colors correctly, Note: Not all web browsers support animated pngs)
 

 

oZ47Byv.png

 


Armor colors (i changed armor color to blue and i checked which colors are changed)

 

ISvcfXP.png
 

 

Leather colors (i changed leather color to red and i checked which colors are changed)


1XDKtxf.png

 

 

Iron (Metal) colors (i changed metal color to green and i checked which colors are changed)

 

rkGfljB.png

As we see when i changed Metal color to green (with EEKeeper) it changed the color table near slide bars i am not sure why it happens, it probably mess colors (more transition colors?).

NOTE: I did not shift slide bar (in the last 3 pictures) for Armor, Leather, Metal, i only changed the color with EEKeeper)

(I guess table posted in my first post is not final and there will be more transition colors, eg. between Hairs/Skin/Major,Minor and Armor/Leather/Metal)

 

I have finished armor level 1 for new paletted character, its really pain, there is a lot more work. Weapons and Helms are in order WQL....BAMs :zzz:   Making unpaletted animations is pretty easy...

 

 

Which one is correct Armor or Armour ?


Edited by Gamemacik, 10 June 2020 - 03:59 AM.

For modders:
Animation resources: NWN RED DRAGONTRWNDbl.pngDRAGONWHELP PACK+DRAGONBREATHTRWNDbl.png
For loosers: SPOILER ALERT! RCEuOoU.pngQeZVcUw.png


#8 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 10 June 2020 - 07:22 AM

Which one is correct Armor or Armour ?

I believe "Armor" is the American spelling while "Armour" is the British spelling.  While either is technically correct, the games use "Armor".


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#9 Gamemacik

Gamemacik
  • Member
  • 55 posts

Posted 10 June 2020 - 10:32 AM

I had to check rest of colors, i got slightly different result i left table in the first post unchanged so we can compare what was changed, i feel this could be final result, also it looks more logical 12 colors for each color scheme and rest colors are anti-aliasing, each possible combinations.
 
XLmMS14l.png

Edited by Gamemacik, 10 June 2020 - 10:02 PM.

For modders:
Animation resources: NWN RED DRAGONTRWNDbl.pngDRAGONWHELP PACK+DRAGONBREATHTRWNDbl.png
For loosers: SPOILER ALERT! RCEuOoU.pngQeZVcUw.png






Also tagged with one or more of these keywords: pallete, animation, npc, character