LZG format

About PR usage and development, and about the POP format.
Post Reply
hrvach
Scholar Scribe
Scholar Scribe
Posts: 2
Joined: October 12th, 2014, 12:10 pm

LZG format

Post by hrvach »

Hello everybody,

I'm new here, trying to write LZG implementation in Python to extract images from DAT files, and I was wondering if anybody could give me example of compressed and extracted data?

Thanks a lot!
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: LZG format

Post by David »

There were examples on the Princed page but now they're gone.
(Its description page is available here: http://web.archive.org/web/200805232231 ... ontest.jsp )

You could extract some images with PR (Princed Resource Editor) twice.
First time regularly, so you get the uncompressed *.bmp images.
Second time with the --raw switch, so you get the compressed image data.

By the way, what are you trying to do?
hrvach
Scholar Scribe
Scholar Scribe
Posts: 2
Joined: October 12th, 2014, 12:10 pm

Re: LZG format

Post by hrvach »

Thanks for the reply! I will try using PR the way you mentioned...

I'm not doing anything too smart, just trying to implement some of these routines in Python, POP1 was one of my favorite games when I was a kid and it's fun to finally learn what was in those DAT files and how the data was stored... :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: LZG format

Post by Norbert »

I asked Enrique (poirot) if he remembers what exactly was inside that lzg.samples.tar.gz file that's mentioned on the archived page David linked to.

Enrique probably won't mind if I paste his replies here:
poirot wrote:I think they were all the B3 and B4 images from titles.dat (un both
forms: compressed and original: when we launched the contest we
already had an algorithm to decompress the files, but we didn't find
an algorithm to compress it, in fact we even didn't understand how the
compression worked until the contest was finished), I'm trying to
locate the file, but it's very difficult.

It's a funny fact that Tammo Jan found a way to decompress small
images and sent me a pseudocode of a compressor, after having
successfully tested my port of the decompressor to C I found that big
images (bigger than 1024 bytes) were corrupted so I started a try &
error methodology and created a very complex decompression algorithm
which worked for all sizes but I didn't even understand how it worked,
so I simplified it and published in the page.

-----

Still looking for it, I've found the schema in
https://github.com/ecalot/princed/blob/ ... t/lzg/test
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Re: LZG format

Post by poirot »

Ohhh, if you are still interested I think I've got the files
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: LZG format

Post by Norbert »

poirot wrote:Ohhh, if you are still interested I think I've got the files
Yeah, sure. :)
Post Reply