Jump to content


MasterScrat

Member Since 31 Mar 2009
Offline Last Active Jun 25 2020 01:08 AM

Topics I've Started

Problems reading BAM files

30 March 2015 - 02:17 PM

Hello everyone,
 
I am trying to read BAM files but I'm having some issues.
 
I parse the BAM header according to the IESDP doc, and get generally good results:
 
[signature] => BAM     [version] => V1      [nbFrames] => 135    [nbCycles] => 9    [transparentIndex] => 0    [offsetFrameEntries] => 24    [offsetPalette] => 1680    [offsetFrameLut] => 2704
 
That's for DBAM1A1.bam. This one works fine!
 
But now some other BAM files, like DBAM1G1.bam, are arranged in a different order:
 
[signature] => BAM     [version] => V1      [nbFrames] => 846    [nbCycles] => 99    [transparentIndex] => 0    [offsetFrameEntries] => 45728    [offsetPalette] => 24    [offsetFrameLut] => 1048
 
Here I have the palette, the frame lookup table then the frame entries (and, I guess, the cycle entries). That's problematic because I rely on the cycle entries to know how large the frame lookup table is! As per the IESDP:
 
To find the number of entries in this lookup table, find the largest value of start+count in the cycle entries table.
 
So I am stuck, I tried computing the lookup table size from (offsetFrameEntries - offsetFrameLut) but this doesn't work. Actually, parsing frames from the offsetFrameLut position doesn't even work!
 
Any idea? Am I missing something?

Edit: fixed file names

Rendering fake colored avatars

29 March 2015 - 10:42 AM

Hello everyone, long time no see!

 

I have resumed work on my toy Infinity Engine renderer.

 

So far I have implemented support for the simpler characters from BG2, like DOGWAR01. But now that I want to handle humanoids things are getting trickier!

 

Here's a sprite from a dwarf (DOPTHI01), it looks nice but I am not such a fan of the purple shirt/green hair color scheme.

 

I don't understand how the color customisation work. I tried using a palette from the Extended Palette Entries mod (attached as palette.bmp) instead of the palette from the BAM file but the result isn't any better.

 

Can anyone provide some hints?