So I have two projects at the moment. I'd like to talk about both of them, because I'm dealing with map compression in both of them.
My first game involves a large RPG map like that of Final Fantasy 1. This map is 256x256 metatiles(2x2) large, so I can't have it without compression. The compression method is very similar to Final Fantasy 1's, where the map has a header that is a list of 256 pointers. They point to the location of the start of each 256 tile row. The reason they have this is because the game uses RLE, and the rows vary in byte size.
My other game involves a very large map (64x60 screens) which uses 8x8 metatiles. The tiles are compressed like this:
2x2 metatile - composed of 4 1x1 tiles
4x4 metatile - composed of 4 2x2 metatiles
8x8 metatile - composed of 4 4x4 metatiles
So each 8x8 metatile has 4 predefined 4x4 metatiles. The map points to screens which are composed of these metatiles.
Almost every game uses compression for their levels, and I don't think it usually takes them 1000 years to work through it. If I need to find a specific metatile ID, for collision/updating and whatnot, I'll have to be able to do a decompression on the fly.
What I don't know is how to do this in an efficient manner. My current decompression method for the RPG map would take an extremely long time to do what I need to have done. I need to look through 15 rows to get 15 metatile IDs for each column that's updated. Do games usually struggle with decompression? How do most games handle it? Both of my games are 4-way scrolling. My RPG map engine can decompress a lot more slowly than the other engine, which is for a platformer. My platformer can decompress based on math, since every byte represents the same number of tiles. But my other engine will require working with every byte and doing lots of counting/looping, which worries me. Any comments/suggestions?
My first game involves a large RPG map like that of Final Fantasy 1. This map is 256x256 metatiles(2x2) large, so I can't have it without compression. The compression method is very similar to Final Fantasy 1's, where the map has a header that is a list of 256 pointers. They point to the location of the start of each 256 tile row. The reason they have this is because the game uses RLE, and the rows vary in byte size.
My other game involves a very large map (64x60 screens) which uses 8x8 metatiles. The tiles are compressed like this:
2x2 metatile - composed of 4 1x1 tiles
4x4 metatile - composed of 4 2x2 metatiles
8x8 metatile - composed of 4 4x4 metatiles
So each 8x8 metatile has 4 predefined 4x4 metatiles. The map points to screens which are composed of these metatiles.
Almost every game uses compression for their levels, and I don't think it usually takes them 1000 years to work through it. If I need to find a specific metatile ID, for collision/updating and whatnot, I'll have to be able to do a decompression on the fly.
What I don't know is how to do this in an efficient manner. My current decompression method for the RPG map would take an extremely long time to do what I need to have done. I need to look through 15 rows to get 15 metatile IDs for each column that's updated. Do games usually struggle with decompression? How do most games handle it? Both of my games are 4-way scrolling. My RPG map engine can decompress a lot more slowly than the other engine, which is for a platformer. My platformer can decompress based on math, since every byte represents the same number of tiles. But my other engine will require working with every byte and doing lots of counting/looping, which worries me. Any comments/suggestions?