0 Members and 1 Guest are viewing this topic.
I should suggest RLE encoding for storing maps. It's quite easy, but if your level looks like swiss cheese, you'll risk space loss. You could calculate how much a compressed and a non-compressed map take place, and take the lightest one.
I don't think size is a big deal honestly.
Also Hayleia I will be using separate maps for above and underground.
And when you have one tile, you do that: type_of_tile_with_first_bit_set_at_oneThis way, you don't waste space when you have a single tile and you save space when you have more than one.
What about instead of storing the ores themselves in the map data, simply storing a 1-bit dirt or no dirt map? Then, you have a function that determines what's there based on a formula. (row * column * seed value, truncated to 256, where 0x10, 0x20, 0x30, 0x40 etc. are ores, and everything else is dirt, for example)in other words, the map never changes, but you don't need to store 16 tiles for 14 ores, air, dirt.