In the terrain generator I created myself for my game I compressed my heightmap data as follows:
- I’d generate and store the heightmap data as raw 16bit height values (So, for a 1024*1024 title that’d be 2097152 (2Mb)).
- I’d then calculate the average height of tile and make all the other values as deltas from this average.
- If you look at the frequency of the deltas you will see that some numbers occur much more often than others. This makes it the perfect candidate for huffman encoding.
The net result is a big saving in disk space.
Also, for a game like mine where the terrain is so large that it has to be loaded in real time as needed, the smaller files sizes mean quiker load times (Even with the time it takes to decompress this in memory, its still much quicker than loading the original file).
Do you support anything like this now, or is this a prime candidate for a user add-on?
Thanks
Ben