Map image data and file names

  • I did some experimenting and I wanted you to confirm a few things for me @red51 if you can.


    1)
    each gunzip decompressed mt_* file consists of 262144bytes.
    Now each image pixel takes up 3 bytes of space (hex colour) and a 4th FF byte defining the end of the hex colour code correct?
    If yes then that means that each image consists of 65536 pixels, which is nothing else that a 256x256 pixel image.


    2)
    how does the game know which square goes next to which? I assume it has to do with the way they are named, since looking inside the files there are no "excess" bytes to hold map position data, but could you provide some more information please?
    My thought was something like the following (i.e. the first number means left/right position and the second number top/bottom with positive numbers towards top and right and negative towards bottom and left) but could you confirm it if I am correct or correct me if I am wrong?



    mt_-2_2mt_-1_2mt_0_2mt_1_2mt_2_2
    mt_-2_1mt_-1_1mt_0_1mt_1_1mt_2_1
    mt_-2_0mt_-1_0mt_0_0mt_1_0mt_2_0
    mt_-2_-1mt_-1_-1mt_0_-1mt_1_-1mt_2_-1
    mt_-2_-2mt_-1_-2mt_0_-2mt_1_-2mt_2_-2
  • As @Miwarre suspected, the 4th byte is the alpha value. These are 256x256 8 bit RGBA images (i.e. 1 byte per color value [red, green, blue, alpha]). Maybe we will discard the alpha value in the future. Although this barely has an impact on the compressed image size, the uncompressed image will only have ~ 196.000 bytes then (so maybe it's a good idea to keep this in mind [e.g. before processing the image data, check the total amount of bytes after decompressing or something like that]).


    About the coordinates, the first value is the X coordinate (horizontally), the second value the Z coordinate (vertically). Since the game uses a right-handed coordinate system (Z is forward, Y is up, X is left), you have to swap your X coordinates, so the map tiles would be arranged like that:


    mt_1_1mt_0_1mt_-1_1
    mt_1_0mt_0_0mt_-1_0
    mt_1_-1mt_0_-1mt_-1_-1


    Every map tile represents 3x3 chunks btw ;)

  • The last reply was more than 365 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.

    • :)
    • ;)
    • :(
    • :P
    • ^^
    • :D
    • :verysad:
    • ;(
    • X(
    • :*
    • :|
    • :crazy:
    • :lol:
    • :dizzy:
    • =O
    • <X
    • ||
    • :thinking:
    • :wacko:
    • :/
    • 8)
    • :wat:
    • :huh:
    • :silenced:
    • :wow:
    • 8|
    • :angry:
    • :thumbdown:
    • :thumbup:
    • :sleeping:
    • :hushed:
    • :nerd:
    • :saint:
    • :drooling:
    • :love:
    • :monocle:
    • :poo:
    • :party:
    • :drunk:
    • <3
    • :!:
    • :?:
    The maximum number of attachments: 10
    Maximum File Size: 1 MB
    Allowed extensions: 7z, asset, avi, bmp, dds, gif, jpeg, jpg, json, log, lua, mp3, mp4, ogg, pdf, permissions, png, properties, rar, txt, unitypackage, xml, zip

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!