Atlas Compression Test
by Taylor Petrick · in Torque Game Engine Advanced · 07/18/2008 (5:24 am) · 11 replies
Earlier today, I was playing around with Atlas and noticed that the files produced are fairly large in size. I was curious as to which compression algorithm would work best with the .atlas files. So I did a few tests on a 3.22mb unique Atlas terrain. Just thought I'd post them.
The results:
Zip at "Best Compression" - 1.12mb
Rar at "Best Compression" - 625kb
BZip2 at "Ultra" - 1.11mb
LZMA at "Ultra" - 614kb
For those who don't know, the BZip2 and LZMA compression algorithms can be used with a handy compression tool called 7Z. When sending files to friends, I usually use the LZMA format as it can cut sizes by up to 15% of the original amount. It takes a lot of RAM and time to compress/decompress, though. LZMA responds well to more CPU cores, and from what I can tell WinRar decompresses it without any corruption issues. The fact that Rar compressed so well also surprised me, as I was expecting it to have similar results to the Zip.
Taylor
The results:
Zip at "Best Compression" - 1.12mb
Rar at "Best Compression" - 625kb
BZip2 at "Ultra" - 1.11mb
LZMA at "Ultra" - 614kb
For those who don't know, the BZip2 and LZMA compression algorithms can be used with a handy compression tool called 7Z. When sending files to friends, I usually use the LZMA format as it can cut sizes by up to 15% of the original amount. It takes a lot of RAM and time to compress/decompress, though. LZMA responds well to more CPU cores, and from what I can tell WinRar decompresses it without any corruption issues. The fact that Rar compressed so well also surprised me, as I was expecting it to have similar results to the Zip.
Taylor
About the author
#2
Edited a spelling error.
07/24/2008 (10:48 pm)
That makes things pretty easy then. Since Torque can read from a zipped directory, I am assuming it could find an Atlas terrain from within one.Edited a spelling error.
#3
07/25/2008 (12:39 am)
Because Atlas is streamed in a separate thread it might be hard to do that. But if it works - that would be pretty sweet
#4
07/25/2008 (12:40 am)
I'll try it out later today and see if it works out.
#5
07/25/2008 (3:06 am)
Atlas doesn't use the Resource Manager to stream so you'd have to start there with your modifications.
#6
07/25/2008 (3:28 am)
Because of the obvious performance hit of streaming a compressed file, it would seem that use of compression with Atlas really is only practical for distribution. Would still be fun to see if it's doable to stream from the .zip though...
#7
07/25/2008 (3:47 am)
I tried streaming from a zip before and it doesn't work out of the box.
#8
07/25/2008 (5:40 am)
We're streaming our terrains and music from compressed containers. Haven't done any lengthy tests, but there's no noticable performance hit.
#9
With atlas I couldn't get it to stream from a zip in TGEA 1.0.3 but haven't tried with 1.7.1.
If I remember the reason it was similar to why ogg files couldn't be read from a zip.
Atlas's paged geometry pulls data from all over the file at any given time so seeking forward and backwards in a compressed stream is the problem.
07/25/2008 (6:00 am)
@ Stefan - Terrains? Legacy and meggaterrians sure.With atlas I couldn't get it to stream from a zip in TGEA 1.0.3 but haven't tried with 1.7.1.
If I remember the reason it was similar to why ogg files couldn't be read from a zip.
Atlas's paged geometry pulls data from all over the file at any given time so seeking forward and backwards in a compressed stream is the problem.
#10
Also, most people have lots of disk space but little patience. Having it be super small for download is probably the big win.
07/25/2008 (12:57 pm)
Hey - if it works, awesome. :)Also, most people have lots of disk space but little patience. Having it be super small for download is probably the big win.
#11
Can anyone else get a atlas file to stream from a zip?
07/25/2008 (1:55 pm)
I just tried it with a zipped atlas file and I get a no stream error.Can anyone else get a atlas file to stream from a zip?
Torque Owner Bill Vee
DayOfWar Studios
It has been my experience since then the bigger the atlas file is to stat with the more you can compress it.