Jump to content


Photo

[RELEASE] BAM Batcher


75 replies to this topic

#41 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 19 January 2017 - 06:54 AM

Hello Sam!

 

Thanks a lot!

It did work although I am not sure I understand how it does since you said you only tweaked the Description BAM section while my problem was with the BMP to Inventory BAM operation? :)

 

Thank you also for the advice about the BMP format. I did want to use the full palette but GIMP automatically forced a truncated palette when I changed mode from RGB to Indexed.

You're right, I meant the Inventory BAM section.  I'll try to find time to fix the rest sometime today.


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#42 Salk

Salk
  • Member
  • 1196 posts

Donator

Posted 20 January 2017 - 10:27 PM

Thanks a lot, Sam! ;)



#43 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 21 January 2017 - 10:30 AM

Hello Sam!

 

Thanks a lot!

It did work although I am not sure I understand how it does since you said you only tweaked the Description BAM section while my problem was with the BMP to Inventory BAM operation? :)

 

Thank you also for the advice about the BMP format. I did want to use the full palette but GIMP automatically forced a truncated palette when I changed mode from RGB to Indexed.

You're right, I meant the Inventory BAM section.  I'll try to find time to fix the rest sometime today.

I have ported the fix to the other components but haven't tested it thoroughly.  Let me know if you run into any more problems and I'll take a look.

Attached File  BGRs fix full (20170121.zip   5.79K   30 downloads

 

(As a note-to-self, I really need to merge the various fixes and put all this on GitHub sometime...)


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#44 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 22 January 2017 - 03:58 PM

(As a note-to-self, I really need to merge the various fixes and put all this on GitHub sometime...)

And done: BAM Batcher on GitHub.  All of the fixes posted in this forum have been incorporated (plus a couple more of my own), but again I haven't tested the end result extensively so post here if it catches on fire.  Also, I didn't bother to update the readme.


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#45 Salk

Salk
  • Member
  • 1196 posts

Donator

Posted 24 January 2017 - 05:03 AM

Thanks again!

 

I wish I could return the kindness somehow...



#46 Miloch

Miloch

    Barbarian

  • Modder
  • 6440 posts

Posted 10 March 2017 - 02:00 PM

I wish I could return the kindness somehow...

See the second to last item in the mod's FAQ. I guess this applies to him now since he's been updating the mod, and also since he already got me a bottle... (You'd think the least I could do is update my own mod in return, but hey, times are tough :o.).


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"My definition of an intellectual is someone who can listen to the William Tell Overture without thinking of the Lone Ranger." -Billy Connolly


#47 Salk

Salk
  • Member
  • 1196 posts

Donator

Posted 10 March 2017 - 09:49 PM

I wish I could return the kindness somehow...

See the second to last item in the mod's FAQ. I guess this applies to him now since he's been updating the mod, and also since he already got me a bottle... (You'd think the least I could do is update my own mod in return, but hey, times are tough :o.).

 

I'll have you two drink together but how does it happen in practice? It is not that I can send a bottle of scotch from here... :)



#48 Miloch

Miloch

    Barbarian

  • Modder
  • 6440 posts

Posted 04 April 2017 - 08:10 PM

I'll have you two drink together but how does it happen in practice? It is not that I can send a bottle of scotch from here... :)

Well, Sam used an online thing called ReserveBar that seemed to work out... though you could probably send Swedish akvavit over here easier than we could send bourbon over there... :D


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"My definition of an intellectual is someone who can listen to the William Tell Overture without thinking of the Lone Ranger." -Billy Connolly


#49 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 28 April 2017 - 07:50 AM

I'll have you two drink together but how does it happen in practice? It is not that I can send a bottle of scotch from here... :)

Well, Sam used an online thing called ReserveBar that seemed to work out... though you could probably send Swedish akvavit over here easier than we could send bourbon over there... :D

If shipping to or within the US (which is where I am), ReserveBar is definitely the way to go.  Honestly, I'd be happily surprised to get anything (well, maybe not gin:  I've never cared for gin), but Scotch is probably my favorite with whiskey being a close second.  On the off chance anyone is legitimately interested, just drop me a PM :)


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#50 Creepin

Creepin
  • Coordinator
  • 911 posts

Posted 07 May 2017 - 03:09 AM

I have a problem with BamBatcher. It's generally fantastic and incredibly handy tool, but somewhy it changes (?) bmp along converting it to the bam.

Here's an example:

Spoiler

On the left is the original bmp, already paletted into 256 colours, so this should not be a conversion issue. On the right is the same picture which is the part of the bam. See that two blacker lines on the blade that were not in the original source? How do I fight them? Am I doing something wrong?



#51 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 07 May 2017 - 05:07 PM

I have a problem with BamBatcher. It's generally fantastic and incredibly handy tool, but somewhy it changes (?) bmp along converting it to the bam.

Here's an example:

Spoiler

On the left is the original bmp, already paletted into 256 colours, so this should not be a conversion issue. On the right is the same picture which is the part of the bam. See that two blacker lines on the blade that were not in the original source? How do I fight them? Am I doing something wrong?

I haven't looked at the source code in a while, but the only way I can think of for this to happen is if you convert two different BMPs (usually a small and a large for inventory item BAMs) that don't have EXACTLY the same palette into a single BAM.  The other thought I have is that if you are viewing the source BMP and resulting BAM using different programs or at different zoom levels, you graphics card (or software) may render them slightly differently depending on blending/aliasing/etc. settings causing them to look slightly different even though the sources are technically identical.  If you upload me your source BMPs and the resulting BAM, I'll be happy to take a closer look and see if I can determine anything further.


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#52 Gwendolyne

Gwendolyne
  • Member
  • 239 posts

Posted 07 May 2017 - 06:57 PM

You got it Sam. ;)

 

That's the issue I encountered when I began to mod (two many years ago). As Creeping is using Photoshop, he should "enforce" the palette of the 64x64 frame and apply it to the small one.


Edited by Gwendolyne, 07 May 2017 - 06:58 PM.

CARPE DIEM ....



In progress : Menace sur le Royaume de Diamant Éternel there.

#53 Creepin

Creepin
  • Coordinator
  • 911 posts

Posted 07 May 2017 - 11:20 PM

Thank you for your willingness to help guys, but... ugh that is awkward... I think I rung false alarm about BamBatcher, it is perfect though and through. :blush:

I have originally put certain bmps into respective "invlarge" and "invsmall" folders and in a few days forget about that to the point when I decided it would be a good idea to put my modified bmps in "bmp" folder. No wonder BamBatcher kept yielding me the same result no matter how I edited bmps in "bmp" folder! :lol:



#54 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 11 May 2017 - 12:44 PM

V2.1 on GitHub is a first attempt at a new component to Convert BMPs to paperdoll BAMs.  If it works as intended without any complications, I'll turn it into a proper release.
 
What you should do:

  • Have an 8-bit paletted bitmap image of your paperdoll, with dimensions 128x160 px.  Pad your image with pure green pixels if necessary, but make sure your character within that box is centered/offset as desired.
  • Cut your bitmap in half, so that the top half measures 128x80 px and the bottom half measures 128x80 px.
  • Place the image of the top in the .bambatch\paperdolltop folder, and append the letter 't' to the end of the filename.
  • Place the image of the bottom in the .bambatch\paperdollbottom folder.  It should have the same filename as the top image, but the last letter should be a 'b' instead of 't'.
  • Run setup-bambatch and choose the component titled "Convert BMPs to paperdoll BAMs"
  • If you want to trim the excess transparent pixels from the frames (to make the filesize smaller), you can use BAM Resizer with something like
    bamresize -p 100 -q 100 -t 1 file.bam

     

Note:
1) Your palette should look like
Palette.png
Here are some resources:
Attached File  Palette.zip   2.87K   22 downloads
 
2)

From Erephine's Developer Files - Colour Guide:

**** PALETTE ENTRIES ****

The following depicts the BG standard colour scheme. Each entry represents one gradient in the palette.

Pure colours:

grey
teal
pink
yellow
red
blue
green

==--

Colour gradients, mixed between pure colours:

grey, teal
grey, pink
grey, yellow
grey, red
grey, blue
grey, green

teal, pink
teal, yellow
teal, red
teal, blue
teal, green

pink, yellow
pink, red
pink, blue
pink, green

yellow, red
yellow, blue
yellow, green

red, blue
red, green

blue, green

==21


To calculate mixed colours, add the two pure RGB values and divide by two. Always round down. Here are the eight mix shades and their correspondence to pure colour shades:

I
3rd

II
4th

III
5th

IV
6th

V
7th

VI
8th

VII
9th

VIII
10th

If you need a mixed shade darker than the 10th, or brighter than the 3rd, you're out of luck.


**** STANDARD COLOUR USAGE ****

For character/monster animations:

GREY - Belt buckles, small metal things
TEAL - Minor clothing colour
PINK - Major clothing colour
YELLOW - Skin colour
RED - Leather colour
BLUE - Armour colour
GREEN - Hair colour (nice!)


**** COLOUR LOCATIONS ****

---WEAPONS---


16 -- GREY
17 -- TEAL
18 -- PINK
19 -- YELLOW
20 -- RED
21 -- BLUE
22 -- GREEN


---HELMETS---


48 -- GREY
49 -- TEAL
50 -- PINK
51 -- YELLOW
52 -- RED
53 -- BLUE
54 -- GREEN


---SHIELDS---


32 -- GREY
33 -- TEAL
34 -- PINK
35 -- YELLOW
36 -- RED
37 -- BLUE
38 -- GREEN


**** COLOUR FALLBACK SCHEME ****

If a colour is not set by the item, it will fall back on the character colour set for its gradient.

For instance, if you have a sword with a pink hilt but don't assign pink a colour, the hilt will always have the major clothing colour of the character who has it equipped (since pink is the major clothing colour on characters). If you change your character's colours, the item will change as well.

If you do have an item colour set, but it happens to be one of the colours you can set on your character (hair, skin, clothing major, clothing minor) it will *appear* to change if you change your colour. It will change on the paperdoll and the avater, but only until a new animation sequence is loaded. As soon as that happens, it is reset to its assigned colour.

Things causing a reload are for instance attacking (loading the attack idle sequence), yawning, waiting, re-equipping the item, clicking on the quickbar.




**** PLANESCAPE TORMENT ****


Planescape Torment uses a different colour mapping system than Baldur's Gate. It more closely resembles the PLT way of doing things in that there are no anti-aliasing colours in favour of more shades per gradient.

The paletted animations of Planescape Torment are all found in the D series. The C series is entirely pre-rendered. Unlike BG paletted animations, they may be partially paletted (that is, part is a selectable colour while the rest is pre-rendered).

The Planescape palette is divided into eight blocks with 32 colours each. Each of these blocks may be used for a selectable gradient or fixed colours. A block always must start at a clean 32 colour interval, so colours are often left blank in between.

The first 32 colours may not be used as a gradient.


Setting the colours is a two step process in PST:

First you set the colours you wish to use. You can set up to seven different colours per animation.

Now you assign a colour placement to each of the colours you set: This determines which part of the palette will be replaced by the selected colour. The placement setting is also a control for special effects (pulsing, etc.).

This means there are seven placement possibilities, though one is unused.

As such the distinctions aren't as clear as with the Baldur's Gate series but there is a general colour scheme as follows:

TEAL 1 - Metal accessory*
BLUE - Major clothing colour
TEAL 2 - Minor clothing colour
RED - Hair & fur, leather**
PINK - Tertiary clothing colour*** (rarely used)
YELLOW - Skin


* e.g. Annah's dagger, Metal on hammer, Dakkon's Blade, Armour parts

** These share the same gradient, but have different placements.

*** Shares placement with leather

Teal 1 and Teal 2 are different in that Teal 1 is not a clear teal gradient while Teal 2 is. In comparison to Teal 2 (0,255,255 -> 0,75,75) it contains some red (75,255,255 -> 0,63,63).


Edited by Sam., 11 May 2017 - 01:01 PM.

"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#55 Creepin

Creepin
  • Coordinator
  • 911 posts

Posted 11 May 2017 - 01:57 PM

Sam., many thanks, that's fantastic: BamBatcher was really lacking this option!

 

I'm a little confused by "bitdimensions 128x160 px" though: does that implies that only creature paperdolls are supported, not gear paperdolls?

 

P.S. Do you think you could add a few words to the readme about how component 13 should work? Readme stops on 12 atm.


Edited by Creepin, 11 May 2017 - 01:59 PM.


#56 Miloch

Miloch

    Barbarian

  • Modder
  • 6440 posts

Posted 12 May 2017 - 06:09 AM

Awesome work. That man deserves a bottle of scotch.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"My definition of an intellectual is someone who can listen to the William Tell Overture without thinking of the Lone Ranger." -Billy Connolly


#57 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 12 May 2017 - 10:20 AM

P.S. Do you think you could add a few words to the readme about how component 13 should work? Readme stops on 12 atm.

I'll take a look.

 

I'm a little confused by "bitdimensions 128x160 px" though: does that implies that only creature paperdolls are supported, not gear paperdolls?

Creature, item, monster; all paperdolls work exactly the same in terms of sizes and offsets.  You are welcome to feed BAM Batcher pre-trimmed paperdoll frames of any size, but the frame offsets will be incorrect.  This will force you to set them manually using some other tool, and you will likely have to resort to a guess-and-check method to find the correct offsets.  This can certainly be done, but I don't recommend it.

 

Think of it this way:  every paperdoll BAM frame's dimensions and their offsets are derived from an image whose dimensions are 128x160 pixels.  This 128x160 pixel image is pure green, and then the creature or weapon or monster is placed somewhere within this 128x160 pixel box.  Item paperdolls for tall races will be located closer towards the top of the box, while item paperdolls for short races will be placed closer to the bottom.  Items that go into a character's left hand will be towards the right of the box, while items that go into a character's right hand will be located toward the left of the box.  Everything is located somewhere within this green box.  You now cut your box in half:  the top half is now a 128x80 pixel box, and the bottom half is a 128x80 pixel box.  When converted into a BAM, each of these 128x80 pixel frames will have an offset of (0,0), and the paperdoll will be positioned properly on the inventory screen in the game.  BUT the frames of your BAM will have an excessive number of unnecessary transparent (pure green) pixels.  These rows and columns of transparent pixels can be trimmed (using BAM Resizer for example), but doing so requires the horizontal and vertical frame offsets to be adjusted accordingly in order to keep the image properly positioned within your (now virtual) 128x160 pixel box.

 

Here's an visual demonstration:

PaletteInstructions.png


Edited by Sam., 12 May 2017 - 10:28 AM.

"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#58 Creepin

Creepin
  • Coordinator
  • 911 posts

Posted 12 May 2017 - 10:38 AM

That is just awesome! I mean both idea and your tutorial: it has never occured to me before that I could have an underlying layer with a paperdoll as a reference instead of move-one-pixel, check, repeat routine! :D


Edited by Creepin, 12 May 2017 - 10:39 AM.


#59 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 12 May 2017 - 11:29 AM

That is just awesome! I mean both idea and your tutorial: it has never occured to me before that I could have an underlying layer with a paperdoll as a reference instead of move-one-pixel, check, repeat routine! :D

Heh, I've been messing with paperdolls since at least as far back as 2008 :P .


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage


#60 Sam.

Sam.
  • Modder
  • 1001 posts

Posted 14 May 2017 - 06:32 PM

P.S. Do you think you could add a few words to the readme about how component 13 should work? Readme stops on 12 atm.

I'll take a look.

Done:  Readme
 
Version 2.2: 15 May 2017

  • Include more palette resources in tools folder
  • Update repalette BAMs component
  • Update Readme

Version 2.1: 11 May 2017

  • Added "Convert BMPs to paperdoll BAMs" component

Download from GitHub


"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?!"

-- to Portalbendarwinden

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

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

CA Forums CA Homepage




Reply to this topic