Compression tools

Started by
7 comments, last by DividedByZero 12 years, 6 months ago
What compression library are you used to compress your game? Any compression code good for in-game data compression? Is this a common way to save online traffic? Thank you so much for your kindly help in advance.
Advertisement
For offline (build-time) compression, there's LZMA and ZLIB.

I'm not sure about in-game compression -- the above algorithms are slow at compression but fast at decompression -- for in-game, you need one that is also fast at compression. Check out this list: http://altdevblogada...orithms-part-1/
What kind of "online traffic" savings are you talking about? People downloading the game data, or people playing a network game? These are two very different problems.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


What compression library are you used to compress your game? Any compression code good for in-game data compression? Is this a common way to save online traffic? Thank you so much for your kindly help in advance.


I'm not a game programmer but I like the library here -- http://quicklz.com . The price is based on the size of your company. Over the years I've seen many silly ways to price things. It's nice to come across a product where the pricing makes sense.

Brian Wood
Ebenezer Enterprises
http://webEbenezer.net

What compression library are you used to compress your game? Any compression code good for in-game data compression? Is this a common way to save online traffic? Thank you so much for your kindly help in advance.



For live game update data, the best compression is to not send anything! Use the right networking model. Send commands instead of state. Send nothing (and interpolate) instead of commands.


Then, make sure you're not using a protocol with lots of overhead (such as remoting, or XMLRPC, etc), but instead an efficient protocol that understands that both ends are tightly integrated and already know how to frame/de-frame packets.


Finally, for bulk transfer, use something like 7-zip for things that can be pre-compressed (installers, level files, meshes, etc), and use gzip/deflate for anything that's "real-time" (typically used by web servers for compressing outgoing HTML etc).
enum Bool { True, False, FileNotFound };
Thank you so much for all your replies. I am actually looking for a compression code in two ways, which can enhance network efficiency.

[quote name='lioil' timestamp='1316479247' post='4863614']
What compression library are you used to compress your game? Any compression code good for in-game data compression? Is this a common way to save online traffic? Thank you so much for your kindly help in advance.



For live game update data, the best compression is to not send anything! Use the right networking model. Send commands instead of state. Send nothing (and interpolate) instead of commands.


Then, make sure you're not using a protocol with lots of overhead (such as remoting, or XMLRPC, etc), but instead an efficient protocol that understands that both ends are tightly integrated and already know how to frame/de-frame packets.


Finally, for bulk transfer, use something like 7-zip for things that can be pre-compressed (installers, level files, meshes, etc), and use gzip/deflate for anything that's "real-time" (typically used by web servers for compressing outgoing HTML etc).
[/quote]

Very nice and detailed explains. Thank you.


For game on low-power devices, such as cellphones, i recommend LZ4.
It's free, it is BSD, you can embed it into your application without any restriction :
http://code.google.com/p/lz4/

There are 2 compressors version,
one is very fast, so you can use it for any "real-time" traffic scenario
one is very strong (LZ4-HC), so you can compress your typical game resource "offline", and just decode them at run time.
The decoder is the same for both, and incredibly fast. So fast that it's cheaper and faster to decode compressed data from flash memory than uncompressed one :)
I use 7-zip.

This topic is closed to new replies.

Advertisement