Lemmings DAT Anticompressor

Started by Mindless, August 27, 2005, 07:23:00 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Mindless

Quote from: ccexplore (not logged in)  link=1125127380/0#14 date=1125427446Cool!  B)  The final missing piece of information finally falls into place.

Did you figure this out by examining the data in the actual file, or did you ask Mike for help?
I'm just messing with the bits in the file, I haven't seen Mike around for a long time... :'(

Quote from: ccexplore (not logged in)  link=1125127380/0#14 date=1125427446If possible, I'd love for you to give us the offsets to the various bitmaps you found in main.dat.  I presume the format should be either some version of a planar bitmap.  Most likely a 3-bit one, possibly with an additional mask.
Well, at the moment I'm working on the Lemmings animation data which is 2bpp planar bitmaps with black being transparent (no mask).

Quote from: ccexplore (not logged in)  link=1125127380/0#14 date=1125427446Is section #5 (decompressed) large?  If so it's most likely the intro screen (main menu) as a single bitmap.

Thanks!  B)

P.S.  Oh, and don't forget to do it for the Xmas Lemmings, which have different graphics in particular the lemmings animations.
Hmm? I'm numbering the data sections from 0 to 6, so section 5 decompressed is 758 bytes.

The intro screen is composed of a brown background with seperate planar bitmaps for the Lemmings holding signs and the Lemmings logo.

On a similar note, it's interesting that the shadow behind the Lemmings logo and the Lemmings holding signs is dynamic, therefore if you change the logo graphic or the sign graphics, the shadow on the intro screen is created at runtime to match the graphic.

Mindless

Quote from: Mindless  link=1125127380/15#15 date=1125441750Well, at the moment I'm working on the Lemmings animation data which is 2bpp planar bitmaps with black being transparent (no mask).
Apparently this only applies to the first two animations, which are the walking animations.  They are 2bbp planar, black as transparent, 16x10 pixels, 8 frames each.

Some of the other animations (mining, basing, exploding?) require more planes. (possibly different dimensions, 8x10?)

ccexplore

Quote from: Mindless  link=1125127380/15#15 date=1125441750Hmm? I'm numbering the data sections from 0 to 6, so section 5 decompressed is 758 bytes.
I was just venturing a wild guess for the section you listed as "unknown".  Well, 758 bytes is clearly not the intro graphics.

What happens when you modify the data of that section?  Where the game messes up/crashes/changes should give us a clue about that section

QuoteOn a similar note, it's interesting that the shadow behind the Lemmings logo and the Lemmings holding signs is dynamic,
Wow, didn't think the programmers/Mike would pull something that fancy (well okay, it's not that hard, but still).  Cool.

ccexplore

Quote from: ccexplore (not logged in)  link=1125127380/0#14 date=1125427446If possible, I'd love for you to give us the offsets to the various bitmaps you found in main.dat.
Alternatively, since we can calculate, you just need to give for each section the sequence of bitmaps, and their dimensions, how many bpp, and whether there's a mask.  (This is assuming there are no unused or non-graphics bytes between one bitmap and the next.)

Thanks again, actually I'll probably look into this too as soon as I have a chance.

ccexplore

Quote from: Mindless  link=1125127380/15#16 date=1125443269Some of the other animations (mining, basing, exploding?) require more planes. (possibly different dimensions, 8x10?)
I would expect them to be larger, not smaller......

One thing I've planned in mind (but will probably take some time to implement, if ever) currently is an app that helps explore this sea of uncharted bits.  I envision it to be like this:  There are 5 columns:  one that interprets the bits as just monochrome bitmaps (in effect, displaying the planes individually), next column interprets them as 2 bpp, the next as 3 bpp, another as 4 bpp, and yet another as 5 bpp (4 bpp+mask, in essense).  You can set the program to start interpreting from a particular offset, and also to set the width.  The program will then go thru a certain number of scanlines (say, 300) assuming that you have a sequence of bitmaps of the specified width.  If you guess right, then you'll get something legible, otherwise you get garbage and should try another width.

This should hopefully help with figuring out how exactly the bitmap are laid out.

Mindless

That would be a useful program!

Anyway, as to my comment about the smaller animations, that was because I was missing a frame.
main.dat section 0:
  lemming animations -  black = transparent
    [0x0000] walking (r)       8 frames, 16x10 px, 2bpp planar, 40 Bytes/frame
    [0x0140] jumping (r)       1 frame,  16x10 px, 2bbp planar, 40 B/f
    [0x0168] walking (l)       8 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x02A8] jumping (l)       1 frame,  16x10 px, 2bpp planar, 40 B/f
    [0x02D0] digging          16 frames, 16x14 px, 3bpp planar, 84 B/f
    [0x0810] climbing (r)      8 frames, 16x12 px, 2bpp planar, 48 B/f
    [0x0990] climbing (l)      8 frames, 16x12 px, 2bpp planar, 48 B/f
    [0x0B10] drowning         16 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x0D90] post-climb (r)    8 frames, 16x12 px, 2bpp planar, 48 B/f
    [0x0F10] post-climb (l)    8 frames, 16x12 px, 2bpp planar, 48 B/f
    [0x1090] brick layer (r)  16 frames, 16x13 px, 3bpp planar, 78 B/f
    [0x1570] brick layer (l)  16 frames, 16x13 px, 3bpp planar, 78 B/f
    [0x1A50] bash (r)         32 frames, 16x10 px, 3bpp planar, 60 B/f
    [0x21D0] bash (l)         32 frames, 16x10 px, 3bpp planar, 60 B/f
    [0x2950] mine (r)         24 frames, 16x13 px, 3bpp planar, 78 B/f
    [0x30A0] mine (l)         24 frames, 16x13 px, 3bpp planar, 78 B/f
    [0x37F0] fall (r)          4 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x3890] fall (l)          4 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x3930] pre-umbrella (r)  4 frames, 16x16 px, 3bpp planar, 96 B/f
    [0x3AB0] umbrella (r)      4 frames, 16x16 px, 3bpp planar, 96 B/f
    [0x3C30] pre-umbrella (l)  4 frames, 16x16 px, 3bpp planar, 96 B/f
    [0x3DB0] umbrella (l)      4 frames, 16x16 px, 3bpp planar, 96 B/f
    [0x3F30] splat(ter?)      16 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x41B0] exit(ter?)        8 frames, 16x13 px, 2bpp planar, 52 B/f
    [0x4350] burn(er?)        14 frames, 16x14 px, 4bpp planar, 112 B/f
    [0x4970] blocker          16 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x4BF0] shrug(ger?) (r)   8 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x4D30] shrug(ger?) (l)   8 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x4E70] exploder         16 frames, 16x10 px, 2bpp planar, 40 B/f
    [0x50F0] explosion         1 frame,  32x32 px, 3bpp planar, 384 B/f
The jumping animation refers to the action that a Lemming does when it reaches a height of terrian that it can scale w/o being a climber.

Mindless

I completeded disecting section 0, and I also wrote a tool something like you mentioned above, if anyone wants it, I'll put it up.

ccexplore

Quote from: Mindless  link=1125127380/15#21 date=1125541853I completeded disecting section 0, and I also wrote a tool something like you mentioned above, if anyone wants it, I'll put it up.
Cool!  I don't know if I'll ever do anything with it, but it's cool that you've completed the entire section 0.  And yeah, put up the tool.

Mindless

main.dat section 1:
  terrain destruction masks
    [0x0000] bash (r)          4 frames, 16x10 px, 1bpp planar, 20 B/f
    [0x0050] bash (l)          4 frames, 16x10 px, 1bpp planar, 20 B/f
    [0x00A0] mine (r)          2 frames, 16x13 px, 1bpp planar, 26 B/f
    [0x00D4] mine (l)          2 frames, 16x13 px, 1bpp planar, 26 B/f
    [0x0108] nuke              1 frames, 16x22 px, 1bpp planar, 44 B/f
  nuke counter
    [0x0134] "9"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x013C] "8"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x0144] "7"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x014C] "6"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x0154] "5"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x015C] "4"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x0164] "3"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x016C] "2"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x0174] "1"               1 frame,  8x8 px,   1bpp planar, 8 B/f
    [0x017C] "0"               1 frame,  8x8 px,   1bpp planar, 8 B/f

Tool: http://it.travisbsd.org/lemmings/_misc/gxplr.zip
Limitations: Many. Loads palette from ground0o.dat.

ccexplore

Quote from: Mindless  link=1125127380/15#23 date=1125551072main.dat section 1:
&#A0;terrain destruction masks
&#A0; &#A0;[0x0000] bash (r) &#A0; &#A0; &#A0; &#A0; &#A0;4 frames, 16x10 px, 1bpp planar, 20 B/f
&#A0; &#A0;[0x0050] bash (l) &#A0; &#A0; &#A0; &#A0; &#A0;4 frames, 16x10 px, 1bpp planar, 20 B/f
&#A0; &#A0;[0x00A0] mine (r) &#A0; &#A0; &#A0; &#A0; &#A0;2 frames, 16x13 px, 1bpp planar, 26 B/f
&#A0; &#A0;[0x00D4] mine (l) &#A0; &#A0; &#A0; &#A0; &#A0;2 frames, 16x13 px, 1bpp planar, 26 B/f
&#A0; &#A0;[0x0108] nuke &#A0; &#A0; &#A0; &#A0; &#A0; &#A0; &#A0;1 frames, 16x22 px, 1bpp planar, 44 B/f
<drools...>Ooh ooh ooh, I had been wanting this for such a long time.  This is heaven (well, it'll come in handy someday anyway in some unexpected way, I'm sure), thanks!

:party: <- (well, for me, anyhow ;P)

ccexplore

By the way, you can probably drop the word "planar" from future listings.  Because of the way the VGA/EGA hardware works, it simply doesn't make sense programming-wise to use anything else if you know you'll work with a specific graphics mode.  So all bitmaps should be planar.

ccexplore

Well, here's my attempt at section #2.  Unfortunately, most of it is still indecipherable junk to me, and I also found things that doesn't seem to be used in the game.  Anyhow:

main.dat section 2:
  skill number digits
     [0x1900] right "0", 1 frame, 8x8, 1bpp
     [0x1908]  left "0", 1 frame, 8x8, 1bpp
     [0x1910] right "1", 1 frame, 8x8, 1bpp
     [0x1918]  left "1", 1 frame, 8x8, 1bpp
     [0x1920] right "2", 1 frame, 8x8, 1bpp
     [0x1928]  left "2", 1 frame, 8x8, 1bpp
     [0x1930] right "3", 1 frame, 8x8, 1bpp
     [0x1938]  left "3", 1 frame, 8x8, 1bpp
     [0x1940] right "4", 1 frame, 8x8, 1bpp
     [0x1948]  left "4", 1 frame, 8x8, 1bpp
     [0x1950] right "5", 1 frame, 8x8, 1bpp
     [0x1958]  left "5", 1 frame, 8x8, 1bpp
     [0x1960] right "6", 1 frame, 8x8, 1bpp
     [0x1968]  left "6", 1 frame, 8x8, 1bpp
     [0x1970] right "7", 1 frame, 8x8, 1bpp
     [0x1978]  left "7", 1 frame, 8x8, 1bpp
     [0x1980] right "8", 1 frame, 8x8, 1bpp
     [0x1988]  left "8", 1 frame, 8x8, 1bpp
     [0x1990] right "9", 1 frame, 8x8, 1bpp
     [0x1998]  left "9", 1 frame, 8x8, 1bpp
Each digit is actually only 4 pixels wide, so they made two versions of each digit, one with the digit on the left half of the 8x8 box, the other with the digit on the right half of the 8x8 box.  This makes it convenient to construct any 2-digit number within an 8x8 box, like the numbers in the skill toolbar.


 mystery 8x16 characters
     [0x19A0] "%", 1 frame, 8x16, 3bpp
     ...
(characters included, in order)
% 0 1 2 3 4 5 6 7 8 9 . A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
These 8x16 characters takes up all the space up to the end of section #2.  The intended palette is clearly not the one from groundXo.dat.  I'm not able to figure out where they are actually used; maybe they aren't.  Note: they are not the green letters you see when playing a level.

ccexplore

Only partially figured out parts of sections #3 and #4 so far:

main.dat section 3:
  Lemmmings holding signs
    [0x9488]  F1 sign, 1 frame, 120x61, 4 bpp
    [0xA2D4]  F2 sign, 1 frame, 120x61, 4 bpp
    [0xB120]  F3 sign*, 1 frame, 120x61, 4 bpp
    [0xBF6C]  Difficulty Selection sign**, 1 frame, 120x61, 4 bpp
    [0xCDB8]  Exit to DOS sign, 1 frame, 120x61, 4 bpp
    [0xDC04]  F4 sign, 1 frame, 120x61, 4 bpp
*with the music/fx set to blank
**with the difficulty set to FUN
This is the end of section 3, contains the "Lemmings holding signs" graphics you see on the main menu screen.

main.dat section 4:
  purple text
     [0x69B0] "!", 1 frame, 16x16, 3bpp
     ...
  (contains the ASCII characters, in order, from '!' to "~")
This is end of section 4, contains all the purple text characters you see throughout the game.

ccexplore

I seem to do best with the font graphics in all sections so far:
main.dat section 6:
  Green text characters:
  [0x1900]  "%", 1 frame, 8x16, 3bpp
  ...

% 0 1 2 3 4 5 6 7 8 9 - A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Again, located at end of section.  Notice parallel with end of section 2 (note correction:  my earlier description of end of section 2 listed the character '.' after '9'.  It should be a '-' instead just like here, the '-' is the minute-second separator in the display of time remaining).  These characters are the ones actually used in the game when playing a level.

Shvegait

I think I know what the other set of characters is for. Could they be the green text when playing the game in IBM PS2 or "High Performance" mode? (These characters are different from the ones when playing with PC Compatible or AMSTRAD modes).