Jump to content

How to export Dragon


goodwad

Recommended Posts

Dragon BAMs are divided into 9 sections because the BG2 engine can only handle animations up to 256x256 pixels. So you'd have to export all the mdr* BAMs and assemble them - not sure what you're trying to do though. There's more information in the Infinity Animations documentation and reference picker chart.

Link to comment

I'm actually hoping to incorporate the dragon sprite into another game that I play. Thanks a million for responding. I searched for "Infinity Animations documentation" and all that came up was this thread, almost the same thing with "reference picker chart". Could you pop up a link for me?

 

Also this is the dragon I'm looking for, does anyone have any ideas where to locate it?

 

foulcrow.gif

Link to comment

You can read about Infinity Animations here or download it here. Just get the core mod for starters, it has all the documentation and the reference picker, which explains all about the dragon format if you open the chart in it. There is only one dragon ported in the content modules - the small IWD white dragon. What you posted looks like a shrunk version of the standard red dragon, which would be in the mdr*.bam files as I said.

Link to comment

You can extract the BAMs to animated GIFs with BAM Workshop. Try BAM Workshop I first - II is a different program not quite as robust. DLTCEP is also useful (available on this site).

 

ImageMagick can then join animated GIFs (and other file formats). We were working on some custom scripting utilities to help with this for Infinity Animations but I don't know if any of them are productive to the extent of being able to join dragon animations - maybe Sam. can chip in if he sees this. They were more designed to convert other formats to Infinity Engine BAMs, not vice-versa.

Link to comment

Yuck! I'd forgotten just how bad the dragon animation type sucks :( . Anyway, the red dragon animation is in the MDR1####.BAM files. There are 567 of them, resulting in roughly 10,000 different sequences crying.gif . I'm extracting them all now, and am roughly 2/3 of the way done. Take heart in that only about 1/9 of them contain actual data.

 

Erephine's Reference Chart reports:

DRAGONS (XDR) np

9 Directions mirrored

9 Animation parts

5 Animations (5:1 split no base; 4: 2 split)

 

Animation + Part + Split + Direction

 

Where XDR 1 is the identifier...

[XDR1][1][9][0][2] is the first animation, 9th part (bottom right corner), first split facing south west (third direction).

Parts are arranged top left to bottom right.

 

But I'm having difficulty understanding exactly how the animations come together. So MDR1 is the reference for the red dragon. The next number in the file names is the animation number (and there are 5 different animations). So I guess the next number in the file name represents which position of the total animation that chunk is located. So like:

[1 2 3
4 5 6
7 8 9]

Is this right, and how do split and direction work/come into this?

Link to comment

Yeah, dragon is the worst of all animation formats. That description seems to leave something out, because it only describes 3 dimensions and there are 4 digits there at least.

 

As for the directions, if it is mirrored as it implies:

0=south

1=SSW

2=southwest

3=WSW

4=west

5=WNW

6=northwest

7=NNW

8=north

 

That's nine, I think. If it's unmirrored, then:

 

0=south

1=southwest

2=west

3=northwest

4=north

5=northeast

6=east

7=southeast

8=umm...

 

So I guess 9 means it's mirrored... since unmirroed would not need that 9th direction.

 

As for the split, I think what you've got is right, assuming it starts with 1 and not 0.

Link to comment

This is complex as hell, and considering how much I drank last night it's amazing I got anything at all done today tongue.png.

post-3522-0-41050000-1329360836_thumb.gif

 

I'm going to have to write a program to do the rest of them. This one is "MDR11*00_Sequence_0000.gif" where *=1-9 (see the matrix in my post above). Each frame N is a combination of the Nth frames from each of the nine GIFs, and the page offsets for each of these final frames are the same as the corresponding Nth frame of the first (top left) sequence. To make it even tougher, the page width and page height have to be calculated manually, and they are equal to the largest value of the frame width + X-offset and frame height + Y-offset respectively.

 

The basic imagemagick code to generate this sequence is:

montage MDR11*.gif[0] -tile 3x3 -geometry +0+0 Z_00.gif
montage MDR11*.gif[1] -tile 3x3 -geometry +0+0 Z_01.gif
montage MDR11*.gif[2] -tile 3x3 -geometry +0+0 Z_02.gif
montage MDR11*.gif[3] -tile 3x3 -geometry +0+0 Z_03.gif
montage MDR11*.gif[4] -tile 3x3 -geometry +0+0 Z_04.gif
montage MDR11*.gif[5] -tile 3x3 -geometry +0+0 Z_05.gif
montage MDR11*.gif[6] -tile 3x3 -geometry +0+0 Z_06.gif
montage MDR11*.gif[7] -tile 3x3 -geometry +0+0 Z_07.gif
montage MDR11*.gif[8] -tile 3x3 -geometry +0+0 Z_08.gif
montage MDR11*.gif[9] -tile 3x3 -geometry +0+0 Z_09.gif
montage MDR11*.gif[10] -tile 3x3 -geometry +0+0 Z_10.gif
montage MDR11*.gif[11] -tile 3x3 -geometry +0+0 Z_11.gif
convert ^
-dispose Previous -background #00FF00 ^
-page 257x583+29+49 Z_00.gif ^
-page +36+22 Z_01.gif ^
-page +32+0 Z_02.gif ^
-page +24+35 Z_03.gif ^
-page +23+68 Z_04.gif ^
-page +16+44 Z_05.gif ^
-page +7+30 Z_06.gif ^
-page +0+24 Z_07.gif ^
-page +7+19 Z_08.gif ^
-page +29+67 Z_09.gif ^
-page +39+71 Z_10.gif ^
-page +34+53 Z_11.gif ^
-adjoin -loop 0 -delay 100 Red_Dragon.gif
del Z_*.gif

where only the nine GIFs from "MDR11*00_Sequence_0000.gif" are in this folder.

Link to comment

Um,... So in the screen shot below, BAMWorkshop II is on the left and BAMWorkshop (Erephine's edition) is on the right. They are opened to the same BAM, the same Sequence, and the same Frame, YET they are clearly showing different stuff. I'm confident BW2 is correct, as that is what my program extracts from the BAM as well. Anyone know what's going on here?

 

post-3522-0-85349500-1329428891_thumb.jpg

Link to comment

BAM Workshop has a known defect where it just displays blank frames when there's data in them. I guess Erephine didn't fix this, and I don't know exactly under which conditions it occurs. Sometimes if you go to Manage Frames it will fix it, but sometimes not. BW2 has its own defects... maybe it's time for a new BAM editor.

Link to comment

I have noticed some data corruption in the extracted Dragon animations. At first I thought imagemagick might be 'choking' with how I have it extract the information I use to calculate the page dimensions and offsets, but after looking more closely it seems that the corruption exists in the BAMs themselves. The first (and less significant) corruption can be seen in several places, including (but not limited to):

MDR11207.BAM_Sequence7_Frame92&93

MDR11208.BAM_Sequence8_Frame98&103&104&105

MDR11308.BAM_Sequence8_Frame98

Specifically, at the top of these frames there are some non-transparent pixels that shouldn't be there and also prevent the frames from being optimally cropped (which cuts down on file size and I suppose rendering effort for the game).

 

More importantly, however, some of the BAMs seem to cut off part of the animation at the bottom. You can see it here:

post-3522-0-73447700-1329674048_thumb.jpg

 

and screenshot of MDR14813_Sequence0039_Frame0039 cropped due to lack of upload space:

 

post-3522-0-21457700-1329675184_thumb.jpg

 

I suppose it's possible that what has been cropped from the bottom of a few of these sequences is buried somewhere else in the BAMs in a part of the file format I haven't realized exists, but I haven't been able to find it, so I doubt it. If anyone else (probably Miloch if anyone) determines this is the case, I'll redo the sequences. Otherwise I think I've finished converting the Red Dragon animation to GIF sequences. I have two versions. The first is the originals generated by the program I wrote, and for the second one I ran the GIF sequences through imagemagick to crop out the extra/unnecessary pixels around the dragon animation that would be transparent in the BAMs (and whatever format they will be converted to). I got a few warning messages on this last step, but they were only on the GIFs that contained 1x1 pixel frames, so I don't think anything is actually wrong. The two archives are about 51 MB each, so I'll have to find a place to upload them...

mogrify.exe: geometry does not contain image `MDR14#00_Sequence_0009.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#00_Sequence_0027.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#00_Sequence_0036.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#01_Sequence_0028.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#01_Sequence_0037.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#02_Sequence_0011.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#02_Sequence_0029.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#02_Sequence_0038.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#03_Sequence_0012.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#03_Sequence_0030.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#03_Sequence_0039.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#04_Sequence_0013.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#04_Sequence_0031.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#04_Sequence_0040.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#05_Sequence_0014.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#05_Sequence_0032.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#05_Sequence_0041.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#06_Sequence_0015.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#06_Sequence_0033.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#06_Sequence_0042.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#07_Sequence_0016.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#07_Sequence_0034.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#07_Sequence_0043.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#08_Sequence_0017.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#08_Sequence_0035.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#08_Sequence_0044.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#20_Sequence_0009.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#20_Sequence_0027.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#20_Sequence_0036.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#21_Sequence_0010.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#21_Sequence_0028.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#21_Sequence_0037.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#22_Sequence_0011.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#22_Sequence_0029.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#22_Sequence_0038.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#23_Sequence_0012.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#23_Sequence_0030.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#23_Sequence_0039.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#24_Sequence_0013.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#24_Sequence_0031.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#24_Sequence_0040.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#25_Sequence_0014.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#25_Sequence_0041.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#26_Sequence_0015.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#26_Sequence_0033.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#26_Sequence_0042.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#27_Sequence_0016.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#27_Sequence_0034.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#27_Sequence_0043.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#28_Sequence_0017.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#28_Sequence_0035.gif' @ warning/attribute.c/GetImageBoundingBox/240.
mogrify.exe: geometry does not contain image `MDR14#28_Sequence_0044.gif' @ warning/attribute.c/GetImageBoundingBox/240.

 

... Really, I get a 1MB max total upload size?!?!? dry.png

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...