Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Kashmir on 2006-09-28 04:13:30

Title: SceneFile Compression
Post by: Kashmir on 2006-09-28 04:13:30
Hey,

Ive got my program extracting & de-compressing all parts of the scenefile ok, and all the data in in those files are ok and in the right spots... but when i try to recompress any of those files, without anychanges made to them, they come out about 300bytes bigger than the originals.

Does anybody know what causes this, is there some trick to successfully compress the files?
Title: Re: SceneFile Compression
Post by: The Skillster on 2006-09-28 06:41:03
I think -GoneAway- had a similar problem when he made his editor - hense it never got far.
There is a couple of extractors and compressors around, best bet is to approach the authors for those programs.
Title: Re: SceneFile Compression
Post by: Kashmir on 2006-09-28 07:22:17
Hmmm, doesnt sound good.

with the current level of compression it will need 48 sections instead of 33, so just a standard scenefile will take up 393,216bytes.
(I dont think that will work in game, but im going to try it anyway till i get something better)

Im just using the GZipStream compression & Decompression methods provided with .net, maybe i should be using different ones.

*edit*
tried in game, just caused crashes.
Title: Re: SceneFile Compression
Post by: halkun on 2006-09-28 08:50:55
Use Zlib

http://www.zlib.net/

It's most likely what the original developers used.

Keep in mind, there are a few ways to compress the files. Take a look at the original files and see what algo was used. I think there are 5 levels of compression (don't quote me)