Thanks again to humordwarf for this info. This is what the devs need to be looking at most importantly to import geodata files to server. We can create the files, but we need to know how to make server read them.
Header (18 bytes)
BYTE MapX
BYTE MapY
WORD w0080
WORD w0010
DWORD dw1
DWORD dw2
DWORD dw3
w0080 and w0010 always same
dw1-dw3 counts blocks, you may not use it (but seems server use this values for allocating memory and/or for checking integrity)
Actual algorithm:
repeat 256x256 times
{
read WORD from file (starting after header)
compare if >00FF -> its error i think... means > 192 layers
compare to 0000 -> read next data as block0000
compare to 0040 -> read next data as block0040
compare if >0040 - > read next data as block0041
}
For block 0000 headers:
{
read SHORT z to z1
read SHORT z to z2
NSWE = (z as unsigned short) and 0x0F
actual z = as signed short((z as unsigned short) and 0x0FFF0)
set all 8x8 subcells to z1 (or z2, or average value... dunno)
}
For block 4000 headers:
repeat 64 times (for each 8x8 subcell)
{
read SHORT z to subcells
NSWE = (z as unsigned short) and 0x0F
actual z = as signed short((z as unsigned short) and 0x0FFF0) / 2
}
For block 4100 headers:
repeat 64 times (for each 8x8 subcell)
{
layer = 0
read SHORT to layercounter
repeat layercounter times
{
read SHORT z to subcell[layer]
layer = layer + 1
NSWE = (z as unsigned short) and 0x0F
actual z = as signed short((z as unsigned short) and 0x0FFF0) / 2
}
}