Thanks, that helped me make a bunch of progress. Unfortunately I'm still missing a step...
Here's what I've been able to gather:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
- map-version: 25
- flags: 1 (appears that per-bit operators would be needed to parse these,
might come back to that.)
- content-width: 2
- parameters-width: 2
- Unknown u8: 120
- Unknown u8: 156
If I pull those two bytes from the data (I don't see them documented) I can run a gzip-based decompressor on the next chunk of the stream, and get:
- param0: A list of 16 bit 0's containing 4096 elements. I'm guessing those mean "air node."
- param1: A list of 8 bit 15's containing 4096 elements. I'm guessing that those mean 15 is the highest possible light level.
- param2: A list of 8 bit 0's containing 4096 elements. I'm guessing those mean that air nodes have no extra parameters.
After that, the world format says I should expect:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
zlib-compressed node metadata list
- content:
if map format version <= 22:
....
if map format version >= 23:
u8 version (=1) -- Note the type is u8, while for map format version <= 22
it's u16
u16 count of metadata
foreach count:
u16 position (p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X)
u32 num_vars
foreach num_vars:
u16 key_len
u8[key_len] key
u32 val_len
u8[val_len] value
serialized inventory
Unfortunately, trying to decompress the remaining bytes generates an error, and I can't seem to match what's left with the description. I've also tried looking at the C++ code in node_metadata.cpp, but it's my first look at C++ and there's a fair bit that is beyond me.
Any tips on how to parse out the remaining bytes? If I spit them out from my REPL I get:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
\t\236\360\1x\234c\0\0\0\1\0\1\0\0\0\0\0\2\266\0\0\1\0\0\0\3air\n\0\0