Minecraft is \x47\x52\x45\x41\x54\n



  • As you know (or don't, but who cares) I am making a Minecraft server implementation. Today, it was finally able to read map files directly from Minecraft. Sort of.


    Here's a log of server output. I tried to post it inline, but CS ran out of memory or something.



  •  Interesting, I guess. Care to explain what the WTF is?



  • @pbean said:

     Interesting, I guess. Care to explain what the WTF is?

    		at struct field "\x03\x03\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x03\x03\x03\x01\x01\x01\x01\x01I\x01\x01I\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01I\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\r\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\r\rI\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\r\r\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x03\x03\x03\x03\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x03\x03\x03\x03\x01\x01\x01\x01\x01\x01\r\x01\x01\x01\x01\x01\x01\x03\x03\x03\x03\x01\x01\x01\x01\r\r\x01\x01\x01\x01\x01\x01\x0e\x03"
    

    That's a name. Of a field.



  • @Ben L. said:

    That's a name. Of a field.

    Oh NOW I get what you were trying to show me earlier.

    Yeah that's a WTF. But it takes that explanatory 2 sentences to make sense.



  • What the fucking fuck.. WHYYYY!?

    Is the field name the cordnate of the block in the "world" or what the hell is going on ?



  • Probably the result of obfuscation.



  • Are you sure it's not your NBT parser fucking up and parsing some binary data as a tag name? It definetly looks like that.



  • Explain to me what's going on here. It seems like your program is just reading the file incorrectly. Are Minecraft maps in XML or something or a proprietary format to MC? In that case, how do you know that the field names are supposed to be text strings and not arbitrary binary sequences?



  •  Minecraft uses Anvil files and NBT format.

     Both obfuscation and compression are mentioned in couple places, so it very well might be he's reading it wrongly.



  • @Shinhan7 said:

     Minecraft uses Anvil files and NBT format.

     Both obfuscation and compression are mentioned in couple places, so it very well might be he's reading it wrongly.

    There's no obfuscation in any saved NBT data, and the only compression is that the entire file is gzipped.


    More likely is that he's parsing lists wrongly, given that all the compound tags with broken names are directly inside list tags.


    (Also the correct name for tag 0x0A is "compound", not "struct")



  • @immibis said:

    that the entire file is gzipped.

    Nope, it's in 4096-byte segments that are zlib-compressed in arbitrarily sized groups.

    @immibis said:

    More likely is that he's parsing lists wrongly,

    Actually it was TAG_Byte_Array. I had only read one byte per array due to a weirdness in the language.

    @immibis said:

    (Also the correct name for tag 0x0A is "compound", not "struct")

    Which sounds better, "struct field" or "compound field"? Which one sounds like a field inside something as opposed to a description of the field?



  • @Shinhan7 said:

     Minecraft uses Anvil files and NBT format.

     Both obfuscation and compression are mentioned in couple places, so it very well might be he's reading it wrongly.

    Yeah, except neither of those appear to be open standards. It's like saying Microsoft Office implements .doc incorrectly*.

    (* Yeah .doc because .docx is an open standard, albeit not a very good one.)



  • @Ben L. said:

    @immibis said:
    that the entire file is gzipped.

    Nope, it's in 4096-byte segments that are zlib-compressed in arbitrarily sized groups.

    Oh yeah, region files. Because a different compression algorithm, and a contiguous region of a file instead of an entire file, makes so much difference.


    Not that region files aren't messed up in their own way. "Let's save disk space by storing chunks in 4kB-aligned blocks so they won't waste space when the FS rounds them up to 4kB!"



  • @immibis said:

    Let's save disk space by storing chunks in 4kB-aligned blocks so they won't waste space when the FS rounds them up to 4kB!"

    The filesystem only has to store data like permissions and names once for every 1024 chunks. But, you know, whatever.


  • Considered Harmful

    I am astounded by the whole genre. Voxel games have stagnated in the strangest way, it's as if conventional 3D had never considered using more, but smaller, triangles.


  • Notification Spam Recipient

    @Gribnit said in Minecraft is \x47\x52\x45\x41\x54\n:

    if conventional 3D had never considered using more, but smaller, triangles.

    Except it's the opposite, because they're using less, but larger, double-triangles (squares).


  • Considered Harmful

    @Tsaukpaetra said in Minecraft is \x47\x52\x45\x41\x54\n:

    @Gribnit said in Minecraft is \x47\x52\x45\x41\x54\n:

    if conventional 3D had never considered using more, but smaller, triangles.

    Except it's the opposite, because they're using less, but larger, double-triangles (squares).

    :um-pendant: dodeca-triangles



  • Whatever happened to DAMMIT FBMAC?

    Or does that kick in after 10 years?




Log in to reply