map.dat Format

Discussion in 'Maps, Textures, and Graphics' started by Lord Bozo, May 5, 2009.

Remove all ads!
  1. Lord Bozo

    Lord Bozo Member

    Joined:
    Apr 2, 2009
    Messages:
    7
    Likes Received:
    0
    I have been trying to puzzle out the Format of the map.dat files located in the \townmap\5XXX\ directories so I can try creating some custom map sizes.

    I have figured out a few things but need some help with the rest. Any assistance with the things that still remain a mystery will be greatly appreciated.

    Let's review map 5005 just to give us a specific example to look at:

    After opening the file in a hex editior we see the following:

    | 00F7 FFFF | 7027 0000 | 0014 0000 | 0018 0000 |

    I have determined the following seems to be true:

    | UNKNOWN | UNKNOWN | Y_AXIS_EXTENT | X_AXIS_EXTENT |

    Y_AXIS_EXTENT = Number of 4xScaled JPGs required to cover the Y_AXIS Extent Multiplied by 4.

    X_AXIS_EXTENT = Number of 4xScaled JPGs required to cover the X_AXIS Extent Multiplied by 4.

    We can see from the JPG files included in the same directory that we have a grand total of 30 4xScaled JPGs. Their extents range from:

    X_AXIS_FILES = 004 to 009 = 6 JPGs High
    Y_AXIS_FILES = 006 to 010 = 5 JPGs Wide

    Thus:

    X_AXIS_EXTENT = 6 JPGs Multiplied by 4 = 24 Decimal = 18 Hex.
    Y_AXIS_EXTENT = 5 JPGs Multiplied by 4 = 20 Decimal = 14 Hex.

    which corresponds to the hex codes in the map.dat file above.

    This portion seems correct as it works out correctly on all the maps I checked. I believe that by the multiply by 4 bit we are actually attempting to determine the equivalent number of 1xScaled JPGs that would be required to display the map properly and this is what is stored in the map.dat file. NOTE- this does not have to be equal to the actual number of 1xScaled JPGs located in the \art\ground\MAPNAME\ directory.

    I am getting lost when I try to decipher the first part of the file. My guess is it is some type of scaling factor to help display the maps appropriately but I have not been able to make heads or tails of the numbers yet.

    Does anyone know how to decipher the rest of the file?

    Thanks.

    Lord Bozo
     
  2. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Are you using WorldBuilder? It automatically deals with that file when you are splitting or recompiling maps. Agetian would be the one to ask re what it means.
     
  3. Lord Bozo

    Lord Bozo Member

    Joined:
    Apr 2, 2009
    Messages:
    7
    Likes Received:
    0
    I am having difficulty with the Splitter operation. I am running the split operation using World Builder.NET2 version 2.05 running on Windows 2000.

    The Split operation creates the correct number of splits based on the original map size - all 256x256 in size but the graphics from each section of the original map are resized into an 80x80 square located in the top left corner of each split section.

    Any ideas what is going wrong?

    BTW: It also does not seem to create map.dat files when I run the split operation.
     
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    [Massive rewrite] Ok, I just noticed you are talking about the townmaps. Are you aware that the townmaps only show in the small map areas (such as when you bring up the worldmap page) and are seperate to the larger background maps found in art/ground? Thats the one you want to be playing with to make a new map.

    (Sorry if you knew that).
     
  5. Lord Bozo

    Lord Bozo Member

    Joined:
    Apr 2, 2009
    Messages:
    7
    Likes Received:
    0
    I have actually been trying to properly load both types of maps: Townmaps and Background Maps.

    I have been starting with maps that were extracted from the *.dat files and Recombining these and Splitting these maps. That operation seems to work fine.

    I have puzzled out the following:

    For Townmaps to Split you seem to have to name the *.jpg file in the following formats for it to Split properly:

    For the 4x zoom you need to name your base file *_4.jpg
    For the 8x zoom you need to name your base file *_8.jpg

    For all maps you need to include a *.txt file named the same as your base file with two parameters included:
    X_axis_offset
    Y_axis_offset

    This will name the Split files appropriately for them to show up in the correct location.

    I have not been able to figure out the relationship between the offsets for the 1x vs the 4x and 8x maps. Any ideas?


    Where I am really running into problems when I am trying to either create a map from scratch to work with as a test map or am attempting to modify an existing map. The Split operation no longer seems to work correctly at this point.

    So here is what I was trying:

    Create a 2048x2048 test *.jpg map using base colors in a 64x64 grid/quilt pattern (just making something easy to look at for proper loading into the map).

    Create a corresponding *.txt file with some offsets assigned (also tried it with no *.txt file - same result)

    Opening World Builder and selecting the Split operation.


    I get my proper number of splits but the grid pattern does not transfer appropriately, it looks like each 256x256 section is getting scaled down into a 82x82 square in the upper left corner of the resultant *.jpgs.


    Any ideas where I am going wrong? Are there some particular reserved colors that are not allowed on a base *.jpg?
     
  6. Lord Bozo

    Lord Bozo Member

    Joined:
    Apr 2, 2009
    Messages:
    7
    Likes Received:
    0
    Ok, I think I figured out the problem. In addition to the base map file needing to be a *.jpg you need to make sure that its resolution is set to 96 pixels/inch. Then it will split properly.

    I knew it was going to be something silly....
     
  7. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Glad you worked it out :) What I do is just compile a similarly sized map and copy over it in Photoshop - it lets me sidestep all that stuff ;)
     
  8. Lord Bozo

    Lord Bozo Member

    Joined:
    Apr 2, 2009
    Messages:
    7
    Likes Received:
    0
    Yeah silly me, I like to understand the details of things. Thanks for all your assistance. I'm sure I'll run into further roadblocks in the future and now I know who the 'go to' guy is for quick answers.:yes:
     
Our Host!