Has anyone ever made a decent file compression library work with GLB?

Previous topic - Next topic

Wampus

Has anyone ever got a decent lossless compression library working with GLB arrays?

I'm trying to reduce disk space used by large tile maps. For games that use procedural generation and create potentially very large worlds this is very useful for small devices.

I wrote a simple run-length encoding compression algorithm with sequence recognition. It works a little but is nowhere near as good as zip style compression. I figure, why re-invent the wheel? zlib is free and available, so maybe someone out there has already created a wrapper or whatnot.

Marmor

RLE is better than nothing .
Show us your Routine in the Code Section please  :P

Marmor


Kitty Hello


Wampus

Quote from: Marmor on 2012-Jan-14
RLE is better than nothing .
Show us your Routine in the Code Section please  :P

Oh, ok. I'll tidy it up a bit and post it when I have a moment. It really isn't very good though. If a map is quite complex it ends up increasing the file size.

Quote from: Kitty Hello on 2012-Jan-16
Shoebox uses gz compression.

That is great for already existing files. The trouble is that files created by an app, for example, procedural generation of large maps, take up a lot of space unless they can somehow be compressed.

If you can imagine how much disk space and bandwidth Minecraft would take up if it didn't use zlib (zip) compression then you can see the issue. On mobile devices I want to use as little memory as possible. The trouble is getting zlib to work with GLBasic, and work on all platforms, is well beyond my paltry C++ skills.

Kitty Hello

zlib is statically linked. You can use import "C" for the functions