SD7 vs SDZ: read time

SD7 vs SDZ: read time

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

SD7 vs SDZ: read time

Post by Caydr »

Can one of these be accessed by Spring faster? Is there any reason to use SDZ instead of SD7? I'm sort of curious why so many things, like XTA for instance, are still SDZ when superior compression is available.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

Sdz is accessed faster. At least on my machine this is the way it works.

See when it says "Opening map file" when loading up? That is accessed faster for example. I don't use sd7 simply because I don't like it. The compression is so huge that it makes minimaps load slower, makes loading the game slower when starting the match, etc.

I have done somewhat extensive testing on this and found the above to be true.

For example, delete your pathing info on altored earth. then put the map in a zip file on max compression and rename to sdz. Then take the same maps folder and compress it with 7z on ultra setting.

You will notice a big difference in loading times (probably... on my machine I notice it). The tradeoff is filesize. Personally I don't care about filesize. Other ppl don't agree with me thats fine. I'm not forcing them to download anything I post.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

The Linux port had a problem with 7-zip files but thats fixed afaik.
But it was a reason why zip was used.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

What I'm really concerned about is quickening AA's operation. I use the "fast" compression method with 7zip because it requires less time and memory to decompress and its savings compared to Ultra are almost the same.

Something I'm curious about though, is the periodic "hiccup" that happens when you start construction on new things, especially construction units and factories. Is this the game accessing the SD7 file and caching the buildpics? Or is it completely unrelated?

What got me thinking about this was when I converted all my BPs to DDS and noticed that the effect *seemed* to be a little less noticable. So it seemed to logically follow that it might be possible to negate the hiccup entirely if I used the right combination of low compression on the archive and high compression on the buildpics. Or somesuch similar...

Then I remembered that XTA has always been sdz. Maybe they too noticed this phenomenon and found it was not as bad with zip compression? There's no other logical reason they'd stick with crappier compression when the savings could be as much as a few megabytes.

I guess what I really need to know is, when spring initializes, does it decompress the sd7 entirely, or just the parts that are needed at any given time? If the entire thing is decompressed, the compression obviously couldn't be to blame.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

XTA hiccups for me as much as any SD7 compressed mod.

I think it's texture loading on the model, btw, since it only does it once per unit type. Build one Krogoth and it hiccups, but it doesn't on the second or after.
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

Gnome wrote:XTA hiccups for me as much as any SD7 compressed mod.

I think it's texture loading on the model, btw, since it only does it once per unit type. Build one Krogoth and it hiccups, but it doesn't on the second or after.
no its not just units that hickup its the (builder) units that do it... and buildings too... anything with build tree :!:
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

i feel no speed difference really
User avatar
SeaEagle1
Posts: 17
Joined: 27 Apr 2005, 00:00

Post by SeaEagle1 »

Theoretically the SD7 compression is indeed slower than SDZ, but it also has better compression ratios, so it's just what you consider more important. I think SD7 is great for the distribution of Mods, saving bandwith. If you want more speed you can always repack it to SDZ.
User avatar
mother
Posts: 379
Joined: 04 May 2005, 05:43

Post by mother »

SeaEagle1 wrote:I think SD7 is great for the distribution of Mods, saving bandwith. If you want more speed you can always repack it to SDZ.
No you cannot repack a mod on your own... You would no longer get sync.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

HOLY FRINK! This is WEIRD. I just discovered something, neener neener neener!

I just got my 9.5 MB mod down to 8.5 MB... hee hee hee... Ahh, this'll be a good surprise for the next version. If you want to figure out what I did, think "completely illogical" and you'll find it sooner or later :P
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

I fail.
Last edited by Nemo on 23 Jan 2006, 03:42, edited 1 time in total.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

No.
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

Something completly illogical? Did you add more stuff? That would seem illogical to me, as you are trying to reduce the filesize.

Or, you changed to a different compression option, that usually makes stuff larger.

Or you found a magic thing that made an uber compression program for you, that is some how compatible with spring?

Or your computer exploded, in the process ejecting a floppy disk that somehow had the new AA thing on it?

Or aliens visited you in your sleep, and in exchange for letting them carry out experiments, they game you the new AA thing?

Tell us!
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Well, maybe he stored the buildpics in a less compressed format thats better supported by 7zips media compression, resulting in a better overall compression...
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Ahh, you're getting warm...
Mugslugs
Posts: 89
Joined: 23 Aug 2005, 00:08

Post by Mugslugs »

i got it it isnt compressed :lol:
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

I know! :twisted:
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Well, the best way to story those pics would be one big uncompressed bitmap inside the sd7, as you cannot use solid compression and those small files create lots of overhead.

But i dont think spring accepts coordinates on a big bitmap as buildpics, to thats out.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Well, 1.42 is out of the bag now, so I might as well divulge my accidental discovery.

If you compress your main mod file(s) as a sdz (ZIP rather than 7zip), with NO compression - as in, "Store" setting, you can then compress the resulting zip file much smaller when you put it in the distribution ultra-compressed zip.

So, for instance, inside the AA ZIP file (which is compressed to the maximum), you will find my readme, changelog, license, a few pimping links, plus the 5 AA data files:

AASpring142.sdz (20 mb)
AASpring142S.sdz (25 kb)
AASpring142F.sdz (35 kb)
AASpring142B.sdz (25kb)
AASpring142LT.sdz (25kb)

These last 5 files are completely free from compression - meaning that they are 1) quite large (20.5 mb in all) and 2) accessed by the game faster than any other possible compression.

If I compress each of the above 5 files as sd7 (7zip), the mod is 9.6 mb. If I compress them as normal-compression sdz (zip), the mod is 10.2 mb. If I do not compress them at all, the mod is 8.6 mb.

So, basically, the file itself is smaller, yet the game can access it faster. This almost certainly doesn't apply to map files, but I haven't tested it. Maybe it's something AA-specific, but I don't see why it would be. It's completely illogical, yet for some reason the mod is smaller when you don't compress it.

The only person who loses is the guy who can't spare some extra megabytes in his spring directory. IE, nobody, not even these low-polygon, low-detail-demanding freaks.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Wow.
Oh just wow.

You just noticed the wonders of solid compression. You could enable it just by setting the checkbox in 7zip directly
Welcome to 1995.

Have you ever seen a .tar.gz file? Wonder why they use "tar" to stick files together before they are zipped? Just the very same effect.

Here is the reason why this works that way and why its not even remotely unlogical:

When all files are storred together in a long block, intrafile redundency will also be eleminated. Also, it doesnt need a header segment for each file with the corresponding data. To understand this, remember that the default compression window for 7-zip, for example, is 4 or 8 Mbyte. Those 30kbyte pictures already end before the algorithms have "come to speed".

Also, if you already have those files lzw encoded, this process results in the entropy to skyrocket, thus resulting in 7-zip not being able to use the uniform features of the data (like those series of 96*96 bitmap blocks).

And here is the reason why you _shouldnt_ do it:

With solid compression (or your fake approach), you cannot decompress one file from the archive without decopressing the whole archive from the beginning to the point of the requested file. This doesnt hurt for sequenciel stuff, but for random access it can easily make it 50 times slower.
Post Reply

Return to “General Discussion”