Community
SCI Programming => SCI Development Tools => Topic started by: gumby on October 12, 2010, 10:22:12 PM
-
Okay, so how does one go about changing the compression type on a resource? When I open up SQ3, and go to the text resources, there are a handful that have no compression and the rest are LZW. However, I cannot see how one can either change the compression or specify what the compression should be upon a resource when it's created.
-
I checked this out in Studio & setting compression options also do not seem to be there.
-
Too bad that the the source for Companion has not been released. At least there is the source for Studio is available. If Omni can make any headway with Studio VGA to make it usable, the source will be there for it, too. He hasn't been around much lately, though.
-
I could always go diving into the Studio code for the algorithm - I know that Companion can read LZW compressed resources (surely Studio can too). I'm also guessing (haven't tried it) that you can edit & save a LZW compressed resource & it would save it with LZW. Just seems odd that setting the compression type option isn't available.
-
I don't believe that SCI Studio or SCI Companion have the option to *save* resources with any compression algorithms.
-
Yeah, no saving with compression with Companion. Studio is the same... I looked into this when I was working on a tool to extract, modify, then reload text resources from resource files. Thanks for the confirmation that I wasn't missing some option, though.
I still haven't tried opening up a compressed resource & modifying it. Would it save the entire resource in an uncompressed format? I suppose it would.
Good to see you are still around!
-
Yes, it would save it uncompressed. The code to save it in one of the compression formats just doesn't exist in SCI Studio (I could be wrong, but I think that's correct) or SCI Companion.
I'm curious why you'd even want this though. It was important when the resources existed on floppy disks, but even the uncompressed sizes are tiny by today's standards.
-
Yes you are correct, SCI Studio does not recompress the resources. I believe the main 2 reasons are it takes a trivial amount of extra space and the patents surrounding LZW
-
The main reason is to keep prying eyes from viewing the resource files for hints for solving games. Obviously, this would only impact the text resources - and only from a casual browser; someone who was really motivated could decompress them.
I thought it might have to do with patents. But wouldn't that work both directions, encrypting & decrypting? I also thought I saw somewhere that those had (recently) been lifted or that LZW encryption algorithms had been released to the public, or something along those lines.
-
You are allowed to decompress LZW but not compress. Compress requires royalties and payments =p. Similiar to how h264 is patented but royalty free for so many years to get market penetration.
Now as to LZW expiring I would not be surprised, I know it was close.
-
Yeah, that matches what I was roughly thinking about LZW.
Wikipedia indicates that:
On June 20, 2003, this patent on the LZW algorithm expired [1]. All patents on the LZW algorithm worldwide have also expired (see Graphics Interchange Format#Unisys and LZW patent enforcement).
In SCI0, there is also Huffman encoding that we could use. I may be the only interested party in this endeavor & might implement it (either LZW or Huffman) as an 'after-compilation' solution (external tool).
-
Troflip! Nice to see you!