FTD-files



All terraindata files are 20128 bytes
The first 38 bytes containes:"FST Terrain Data V01. SIZE=100 GAP=500"
The following 90 bytes seems to be empty. This gives us the following 
head of the file in hex:

46 53 54 20 54 65 72 72 61 69 6e 20 44 61 74 61
20 56 30 31 2e 20 53 49 5a 45 3d 31 30 30 20 47
41 50 3d 35 30 30 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

The rest of the file is the terraindata starting from the lower left corner
going from left to right. The height is written
in bytepairs. For example, if you have a byte pair in hex: e8 03. This 
would be 3e8 giving you a hight in dec of 1000 meters.  88 13 is 1388=5000
meters. This means that the highest you can get is ffff=65 535 meters. But
there is no mountains that high on earth so there will probably not be
any problem with that. (byte1 in dec + (byte2 in dec *256))
Every terrain field is 100*100 squares and one square is 500*500 meters.
This means that if make vertical line whit one hight, this heigth will
be every 200 byte (100 bytepairs). The possition of an object is written
in WORLD.FST in whole meters. Starting with 00000, 00000 in the lower left
corner in the T000000.FTD with possitive number upwards and to the riht.

The terraindatas possition is determined by the files name. The possition
00000, 00000 is allways as close to the center of the world as possible.
That means that the file T000000.FTD is the center square if the number
of fields is uneven, and possitioned over and to the right if the number
of fields is even. The other FTP-files is named according to their 
possition relative to T000000.FTD. The first three figure is tells you
if the position is negativ(_) or positive(0) followed by the Y possition.
The next three figures are the same but with the X possition. 
For example the file T_01_01.FTD is possitioned  one under and one right 
of the T000000.FTD.

The hight is not realy the hight of the square but the lower left corner
of the square. To get a flat square every corner of the square has to have
the same hight, meaning that the square, the square to the right, the 
above and the square above to the right should have the same hight.

