I figured out the format of savegame world maps (WORLD900.DAT), but I'm too tired to do any programming. But I'll tell you how it works.
Code:
11 27 FF FF FF FF 00 00 00 00 00 01 00 01 38 62 00 00 34 34 FF 0A 34 FF 0A 34 FF 0A 34 FF 0A
- 11 27 = identifier
- FF FF FF FF = -1 = file uses short block header = each block is separated only by bytes to read
- 00 00 00 00 = always null
- 00 01 = 256 = width
- 00 01 = 256 = height
- 38 62 00 00 = 25144 = bytes to read = block is compressed if this is not width * height
The compression starts by telling a byte value that is used for data repetition information. I think it can be any byte value.
- 34 = data repetition marker
Then the data follows.
- 34 FF 0A = repeat value 10 (0x0A) for a total of 255 (0xFF) times
Any other bytes are just uncompressed data that you can use as it is.
If 34 is actual data, you'll see it appear as 34 01 34.
If anyone notices anything that might be wrong here or missing, let me know. I haven't written the file reader yet so this is all based on what I've just read off the file itself.
---
Settlers II.net admin