Difference between revisions of "WORLD.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (Added category link)
(fleshed out structure)
Line 1: Line 1:
{{STUB}}
+
The original XCOM file is 13320 bytes long, while TFTD is 14660 bytes long. However, each uses the same 20-byte record length giving the original 666 entries and TFTD 733 entries. This file describes the terrain on the geoscape screen using quadrilateral polygons and  triangles.
13320 bytes. Each record seems to be 20 bytes, so that's 666 records.
 
  
Each record seems to consist of three or for values, presumably X/Y/Z co-ords on the world map. Presumably, these either define country borders, terrain borders, or both.
+
The first 16 bytes of file contain the points for the quad/triangle. 4 sets of 2 short (2-byte) integers, designating the 'X' and 'Y' coordinate (or latitude and longitude if you prefer). If the last set has an x value of -1 then it is to be rendered as a triangle, otherwise it is a quad.
 +
 
 +
The last 4 bytes in the record contain the terrain type. This could be a long integer or 2 short integers as the last 2 bytes in each record are 0.
 +
 
 +
== Structure ==
 +
{| {{StdDescTable}}
 +
|- {{StdDescTable_Heading}}
 +
! Offsets !! Meaning !! Values
 +
|-
 +
| 0-1  || First X coordinate || 0 - 2880
 +
|-
 +
| 1-2  || First Y coordinate || -720 - 720
 +
|-
 +
| 2-3  || Second X coordinate || 0 - 2880
 +
|-
 +
| 3-4  || Second Y coordinate || -720 - 720
 +
|-
 +
| 5-6  || Third X coordinate || 0 - 2880
 +
|-
 +
| 7-8  || Third Y coordinate || -720 - 720
 +
|-
 +
| 9-10  || Fourth* X coordinate || 0 - 2880
 +
|-
 +
| 11-12 || Fourth* Y coordinate || -720 - 720
 +
|-
 +
| 13-19 || Terrain Type || 0-10 and 12
 +
|}
 +
<small><nowiki>*</nowiki> As mentioned above, the fourth coordinate could be (-1, 0) denoting a triangle</small>
 +
 
 +
'''Note:''' The values were obtained only on the original XCOM. Presumably the same restrictions apply for TFTD except for maybe the terrain types. Also the X ranges are assumed to max at 2880 as this is a multiple of 360, the max observed in the file is actually 2877
 +
 
 +
== See Also ==
  
 
[[Saved Game Files]]
 
[[Saved Game Files]]
 
[[Category:Game Files]]
 
[[Category:Game Files]]

Revision as of 03:03, 6 April 2007

The original XCOM file is 13320 bytes long, while TFTD is 14660 bytes long. However, each uses the same 20-byte record length giving the original 666 entries and TFTD 733 entries. This file describes the terrain on the geoscape screen using quadrilateral polygons and triangles.

The first 16 bytes of file contain the points for the quad/triangle. 4 sets of 2 short (2-byte) integers, designating the 'X' and 'Y' coordinate (or latitude and longitude if you prefer). If the last set has an x value of -1 then it is to be rendered as a triangle, otherwise it is a quad.

The last 4 bytes in the record contain the terrain type. This could be a long integer or 2 short integers as the last 2 bytes in each record are 0.

Structure

Offsets Meaning Values
0-1 First X coordinate 0 - 2880
1-2 First Y coordinate -720 - 720
2-3 Second X coordinate 0 - 2880
3-4 Second Y coordinate -720 - 720
5-6 Third X coordinate 0 - 2880
7-8 Third Y coordinate -720 - 720
9-10 Fourth* X coordinate 0 - 2880
11-12 Fourth* Y coordinate -720 - 720
13-19 Terrain Type 0-10 and 12

* As mentioned above, the fourth coordinate could be (-1, 0) denoting a triangle

Note: The values were obtained only on the original XCOM. Presumably the same restrictions apply for TFTD except for maybe the terrain types. Also the X ranges are assumed to max at 2880 as this is a multiple of 360, the max observed in the file is actually 2877

See Also

Saved Game Files