The Forum is up for sale: XeNTaX Forum looking for new owner

Death Rally .bpk images

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
Malachi
ultra-n00b
Posts: 8
Joined: Thu Aug 12, 2004 2:53 am

Death Rally .bpk images

Post by Malachi »

Can someone help me figure out Death Rally .bpk graphic file format?
My research hasn't revealed anything except it's some sort of 8-bit compressed format with outside palette file. I couldn't even figure out header structure (height, width, etc.). While testing it by changing values in images and having the game load changed images, compression seemed like some sort of rle with sliding window or dictionary. If some wants to test it I recommend starting with archive menu.bpa (it's uncompressed) and looking/changing bytes of apogee.bpk image (which is stored in it) as it is the first image game displays when starting.

I attached two images with they captures from game. Others can be extracted from Death Rally .bpa files.
While the Death Rally .bpa game archive format is unknown to me, it can be extracted with Game Archive UnPacker 0.6.0.2 PRO.
You do not have the required permissions to view the files attached to this post.
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 680 times
Contact:

Re: Death Rally .bpk images

Post by Mr.Mouse »

Now this is interesting, I hope someone can find the answer here. If I have time I may take a look myself.
Malachi
ultra-n00b
Posts: 8
Joined: Thu Aug 12, 2004 2:53 am

Re: Death Rally .bpk images

Post by Malachi »

After checking further I have no idea what kind of compression it is. Changing random bytes in image and having it loaded by the game most of the time shows only local distortions and rest of the image is decoded properly (offset left or right). Also changing the bytes to see if they correspond to palette index proved useless as apparently they don't so maybe even huffman coding is involved?

Edit:
I made some progress. After saving captured APOGEE.PNG as GIF and opening it in hex editor, I noticed similarities between BPK and GIF files when watched in 18 bytes column widths (filesizes are also comparable). I will continue attacking it from that angle.
Malachi
ultra-n00b
Posts: 8
Joined: Thu Aug 12, 2004 2:53 am

Re: Death Rally .bpk images

Post by Malachi »

Looks like compression is definitely LZW similar to one found in GIF. Also there appears to be no header information, could be that game has it hardcoded. I managed to decode images partially with modified GIF decoder but the color indexes are wrong and decoding stops after first image block.
I'll continue attacking it. 8)

Edit:
Compressed files have no header, but some decompressed files have header.

Edit2:
Maybe Compressed files and methods subforum would be more suitable now that it appears .bpk files are compressed files with different contents.
Malachi
ultra-n00b
Posts: 8
Joined: Thu Aug 12, 2004 2:53 am

Re: Death Rally .bpk images

Post by Malachi »

After struggling to get LZW decoder working in a moment of inspiration I swapped codes for clear code and ending code (opposite from GIF codes and with no block code) and it worked! :mrgreen:
Almost whole files decompress now, color indexes are still bad, need to figure out why. Work continues.
You do not have the required permissions to view the files attached to this post.
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 680 times
Contact:

Re: Death Rally .bpk images

Post by Mr.Mouse »

Nice work man! Keep it up! :ninja:
Malachi
ultra-n00b
Posts: 8
Joined: Thu Aug 12, 2004 2:53 am

Re: Death Rally .bpk images

Post by Malachi »

Thanks! :D

I've figured out why indexes are wrong. Need to do bitwise rotation of 5 to right (or 3 to left) on output bytes.
Post Reply