Jump to content

Sierra/Dynamix Image Compression (3D Ultra games)


Recommended Posts

Hi experts, I'm currently investigating a number of games by Dynamix (Sierra), all published under the 3D UItra banner. They have 2 types of images, with (I'm assuming) an RLE compression on them, although it could just be a regular compression.

 

For the BMX images, the structure is:

// HEADER
  4 - Number of Sprites
  4 - Max Width
  4 - Max Height
  
  // for each sprite
    4 - Offset (relative to the offset of this field)
    2 - X Position?
    2 - Y Position?
    2 - Sprite Width
    2 - Sprite Height
    2 - Unknown
    2 - Compression Type (0=uncompressed 8-bit paletted, 6=?, 109=?)
    
// FILE DATA
  // for each sprite
    X - File Data

 

For the TBB images, the structure is:

// INFO DIRECTORY
  4 - Header (INF:)
  4 - Info Directory Length (not including these 2 header fields)
  2 - Unknown (1001)
  2 - Number of Images
  2 - Unknown (16)
  
  // for each image
    4 - Image Data Offset
    
  // for each image
    2 - Image Width
    2 - Image Height
    
// PALETTE
  4 - Header (PAL:)
  4 - Palette Length (not including these 2 header fields)
  
  // for each color (256 colors)
    4 - RGBA Color

// REL BLOCK
  4 - Header (REL:)
  4 - Block Length (not including these 2 header fields)
  X - Unknown
  
// BITMAPS
  4 - Header (BMP:)
  4 - Bitmap Block Length (not including these 2 header fields)
  
  // for each image
    2 - Image Width
    2 - Image Height
    1 - Compression Flag? (131)
    4 - Compressed Data Length
    X - Image Data (Unknown compression)

 

I've run the Image Data through the QuickBMS compression finder, including some variation on the start byte, but it doesn't come up with anything.

 

For reference, for the game 3D Ultra Lionel Traintown, the BMX images do use a combination of RLE and LZO1X Compression:

// HEADER
  4 - Header? (237,95,132,0)
  4 - Unknown (4)
  4 - Pixel Type (1=Grayscale, 2=RGB555)
  4 - File Data Length
  for most {
    48 - null
    }
  for some (only ones with LZO1X compression?) {
    4 - Unknown
    12 - null
    4 - Unknown
    4 - Unknown (1)
    4 - Unknown
    }
  
// DETAILS DIRECTORY
  4 - Number of Sprites
  
  // for each sprite
    4 - Offset (relative to the offset of this field)
    2 - X Position?
    2 - Y Position?
    2 - Sprite Width
    2 - Sprite Height
    2 - Unknown (32)
    2 - Compression Type (0=Raw RGB555, 1=RLE, 3=LZO1X+RGB555, 4=LZO1X+RLE, 5=Empty?)
    
// FILE DATA
  // for each file
    if (Compression Type == 0){
      if (PixelType == 1){
        X - Pixel Data (Grayscale)
        }
      else if (PixelType == 2){
        X - Pixel Data (RGB555)
        }
      }
    else if (Compression Type == 1){
      X - File Data (RLE encoding){
        // for each line {
          2 - Block Length
          X - Block {
            // repeat until we have a pixel for each of the sprite width {
              1 - Control Character (<128 = copy pixels raw, >128 = Repeat the next pixel X-128 times)
              X - Pixels (2-byte RGB555)
              }
            1 - null End Of Line character
        }
      }
    else if (Compression Type == 3){
      4 - Compressed Data Length
      4 - Decompressed Data Length
      X - File Data (Uncompress using LZO1X and then read RGB555 as per Compression Type 0){
      }
    else if (Compression Type == 4){
      4 - Compressed Data Length
      4 - Decompressed Data Length
      X - File Data (Uncompress using LZO1X and then apply RLE as per Compression Type 1){
      }
    else if (Compression Type == 5){
      1 - null
      }

 

The BMX format in this game is different to other games like 3D Ultra Radio Control Racers, 3D Ultra Cool Pool, ...

 

In all those games, as well as 3D Ultra Lionel Traintown, the TBB format seems to be consistent. I'm assuming that the TBB and BMX formats from all those other games might be using a similar compression.

 

I've had an attempt of trying to run the EXE through a few decompilers and other tools, but unfortunately didn't come up with anything, and it's pretty beyond my expertise.

 

Is there anyone who might be able to have a try at this. Attached are some sample files, and the demos of these games are easily downloadable if you want to look through the EXE.

 

Thanks for your help.

3d_ultra_images.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...