Lord Bozo
May 4th, 2009, 07:59 PM
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
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