Jump to content


Editing paperdolls?


  • Please log in to reply
48 replies to this topic

#1 -Rhaka-

-Rhaka-
  • Guest

Posted 17 July 2006 - 01:06 PM

I'm trying to make a minor edit to the BG2 (and, if succesful, later on the BG1) paper dolls: specifically, to remove the fugly beard from the human male wizard.

Using Near Infinity, I'm able to extract the file, and I can edit it with MOSWorkShop. However, when used in-game, the colours are all sorts of screwed up. I'm assuming this is because it didn't get the proper pallete data.

Any assistance with this would be greatly appreciated, as I have no clue where to start.

#2 -Guest-

-Guest-
  • Guest

Posted 26 July 2006 - 04:16 AM

I'm trying to make a minor edit to the BG2 (and, if succesful, later on the BG1) paper dolls: specifically, to remove the fugly beard from the human male wizard.

Using Near Infinity, I'm able to extract the file, and I can edit it with MOSWorkShop. However, when used in-game, the colours are all sorts of screwed up. I'm assuming this is because it didn't get the proper pallete data.

Any assistance with this would be greatly appreciated, as I have no clue where to start.

Paper Dolls are stored in the PLT files, not BAMs or MOS files. MOS Workshop (at least my copy) has no idea what to do with one.

Paper dolls have a very simple header; By changing that first 24 byte header to the following, and renaming the file .DIB, I was able to get a reasonably workable image in paint; getting it back will be another story.

42 4D 42 A0 00 00 00 00 00 00 42 00 00 00 28 00
00 00 80 00 00 00 A0 00 00 00 01 00 10 00 03 00
00 00 00 00 00 00 C3 0E 00 00 C3 0E 00 00 01 00
00 00 00 00 00 00 FF 00 00 00 00 F0 00 00 00 0F
00 00


What this does is call it a Bitmap using the first byto for the red channel, the second byte split between blue and green. When you bring this into Microsoft Paint (under XP at least) it manages to interpret it correctly enough - you get a red background image with the appropriate thing showing fairly clearly in red-washed grey. At least it would let one check one's work, or decide HOW to modify something.

#3 -Guest-

-Guest-
  • Guest

Posted 26 July 2006 - 04:49 AM

It appears a PLT file is in reverse order, that is, top of file is highest Y scan line. Very odd, but this appears to be a hold-over from windows BMP or DIB format.

Perhaps a paint program "brush" file format would be close... nah. bother.

#4 WizWom

WizWom
  • Member
  • 270 posts

Posted 26 July 2006 - 05:57 AM

It appears a PLT file is in reverse order, that is, top of file is highest Y scan line. Very odd, but this appears to be a hold-over from windows BMP or DIB format.

Perhaps a paint program "brush" file format would be close... nah. bother.

MOS Workshop 1.0.0.7 works with PLT files; it seems to treat them as greyscale with transparency channels, which is definately wrong. I was able to make something fairly useful by doing cut and paste on an existing PLT, though I have not yet tried working up a new one. I'm not sure how it maps colors to the PLT, either, which is why the greyscale in MOS workshop worries me so. For instance, using the existing WPMD2INV.PLT with just cut and paste to make a WPMD1INV.PLT for a buckler, my buckler uses the palette colors for the character's skin, rather than those of a shield.

Edited by WizWom, 26 July 2006 - 06:08 AM.


#5 WizWom

WizWom
  • Member
  • 270 posts

Posted 26 July 2006 - 09:48 AM

Hm, hacking a bit, I see the IESDP has PLT formats wrong.

The first byte is intensity; this is mapped, it seems, to the color intensity profiles applied by the various colors selected. An intensity of 255 indicates transparent.
The second byte for each pixel is the color.

For a character portait paperdoll:
0: Skin
1: Hair
2: Metal
3: Armor
4: Leather
5: Clothing Minor Color
6: Clothing Major Color
7-127: Shadow (intensity ignored)

these colors seem to cycle again after 128; which probably means the high bit is a flag of some sort.

So, now to make some sort of translator...

Edited by WizWom, 26 July 2006 - 10:00 AM.


#6 -Guest-

-Guest-
  • Guest

Posted 26 July 2006 - 12:58 PM

OK, I just finished a PLT->BMP converter:

http://mysite.verizo...wom/PLT2BMP.EXE

#7 Rabain

Rabain

    God

  • Member
  • 653 posts

Posted 26 July 2006 - 01:31 PM

Link doesn't work
A knight without armour in a savage land...

#8 WizWom

WizWom
  • Member
  • 270 posts

Posted 26 July 2006 - 02:11 PM

Link doesn't work

Heh, Silly typo :-)

http://mysite.verizo...wom/PLT2BMP.exe

http://mysite.verizo...wom/bmp2plt.exe

color mapping:
Reds: Belt
Greens: hair
Blues: skin
Cyans: Main Armor
Magentas: Main Clothing
Yellows: secondary clothing
Black: shadow
pure white: transparent

#9 WizWom

WizWom
  • Member
  • 270 posts

Posted 26 July 2006 - 02:28 PM

[http://mysite.verizo...wom/PLT2BMP.exe

http://mysite.verizo...wom/bmp2plt.exe

The first word after the file version is not garbage, it is the paperdoll type:
0 = character
8 = equiptment (like a shield or a helmet)

I think this keeps you shield from coming in in the color of your character's skin. But it appears to have no discernable effect at all.

I'll look into having a command line option to set this. I suppose one could just hack it in after for now.

It looks like the weapons still have BAM paperdolls.

Edited by WizWom, 26 July 2006 - 03:08 PM.


#10 WizWom

WizWom
  • Member
  • 270 posts

Posted 26 July 2006 - 03:30 PM

You know, this paves the way for a proper R-rated paperdoll mod :-)

Heh - it's good to chuckle over... The Marilith needs a paper doll ASAP :-)

#11 Sir BillyBob

Sir BillyBob
  • Modder
  • 5315 posts

Posted 26 July 2006 - 04:52 PM

Hlid used to talk about a paperdoll nude he had of Imoen. It only worked in the original BG1 game, not in SoA.

Tired of Bhaal? Try some classics mods instead:
Classic Adventures
Official Classic Adventures Website


#12 Vlad

Vlad
  • Member
  • 577 posts

Posted 27 July 2006 - 12:27 AM

Hlid used to talk about a paperdoll nude he had of Imoen


It was funny. I still have this minimod in my Backups.

#13 WizWom

WizWom
  • Member
  • 270 posts

Posted 27 July 2006 - 04:12 AM

Hlid used to talk about a paperdoll nude he had of Imoen


It was funny. I still have this minimod in my Backups.

Well, let's see... how would one do something like that?

Take photo; Split out the hair from the skin; convert hair to greyscale, put at green channel; convert skin to greyscale; put as blue channel; trim to size; convert BMP to PLT.

Hm. I thkn I'll try it for a Sirine. MSIRINV.PLT is just aching to be done...

#14 Sir-Kill

Sir-Kill
  • Member
  • 906 posts

Posted 27 July 2006 - 04:32 AM

cool utility, hopefully it might prove usefull. :)

I noticed that your color id's are different than this picture
note the blues and yellows

I am not sure if BWS1 messed the pallete (like avenger says it does) and that is what I am seeing or what.

Attached Images

  • tempplt.jpg

Edited by Sir-Kill, 27 July 2006 - 04:34 AM.

Live Free Or Die

#15 WizWom

WizWom
  • Member
  • 270 posts

Posted 27 July 2006 - 06:55 AM

cool utility, hopefully it might prove usefull. :)

I noticed that your color id's are different than this picture
note the blues and yellows

I am not sure if BWS1 messed the pallete (like avenger says it does) and that is what I am seeing or what.

That's the color mapping for a BAM; you can make you paper dolls in a BAM just as easily. My color mapping was done by taking the color options (only 7) and using eash of the 3 bits to indicate a color channel. And since color 0 was valid (and color 7 was shadow), I incremented by 1 before doing that. Matching that color mapping would not be hard; a translation table is just as valid a way to map colors from an index to RBG.

And that would make it more simple to convert a PLT to BAM and vice versa...

#16 WizWom

WizWom
  • Member
  • 270 posts

Posted 27 July 2006 - 08:22 AM

Wondrous, absolutely wondrous. Inconsistent. Um, that code of mine isn't quite ready for prime time :-)

Color #  Elf Fighter, Armor3	Dwarf Thief, Armor 2	 Gnome Fighter, Armor 1   Helm 5
0		 Skin				   skin					 skin						  
1		 Hair				   hair					 hair
2		 Metal Armor			Edge of clothes		  belt buckle			  main
3		 Belt & highlights	  Belt & highlights								 edge
4		 Boots & sec. armor	 Boots and main armor	 boots & sash
5		 codpiece			   bracers & codpiece	   pants					studs
6								cowl & pants			 shirt
Well, OK, I guess I can work with this.
Using the metal color for the edge of the cowl on the thief is, well, odd, but I didn't do it :-)

Colors used by BAM
Color   BAM
Blue	 Armor	   
Red	  Belt, Straps, Edging
Green	hair
Yellow   skin
Cyan	 Bracers
Magenta  Main clothes
White	Buckles
Note: because it's paletteized, they might be using other colors, so there might be more tha 7 mapped. Hm. No, the palette seems to be 7 groups of 12 grades for each color I've listed, and that seems to be all they used.

And that's why the PLT file is superior: 254 shades of each color vs 12. much smoother. But over a 128x160 pixel area, who would notice?

#17 igi

igi

    IESDP Guardian

  • Administrator
  • 1059 posts

Posted 27 July 2006 - 08:50 AM

If the IESDP forum were up, I'd ask you to post any information you find there.
Since it's down, I'll ask you to post nay information you find there, but wait until it's back up :)

Visit the IESDP


#18 WizWom

WizWom
  • Member
  • 270 posts

Posted 27 July 2006 - 08:54 AM

OK, they are updated. Now you can take a BAM output BMP like that, change the palette color for transparent to white and shadow to black, convert to 256 color, and use my bmp2plt directly from that to have a PLT.

#19 WizWom

WizWom
  • Member
  • 270 posts

Posted 29 July 2006 - 03:00 PM

Ah, it does this old boy's heart good to see a naked lady when I take the robe off a female mage :-)

And with the hair color and skin soloration of the "target", too.. Although the "blue skin" viconia looks mighty strange, what with white hair and all.

#20 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 30 July 2006 - 03:06 AM

The first word after the file version is not garbage, it is the paperdoll type:
0 = character
8 = equiptment (like a shield or a helmet)

I think this keeps you shield from coming in in the color of your character's skin. But it appears to have no discernable effect at all.


I have yet to see a paperdoll without 0x8 on the first byte!
Please tell me an original paperdoll which has no 0x8 there.
Avenger