Export / Import Terrain Files

I used some custom formats for files used to import or export tile data. Generally, there are three file formats used for exporting/importing L2 terrain data and only one for exporting elevation data while in L0/ELV mode.

The way the data are read at all cases is the same and can be seen in the following picture:

While the map's lower-left point is the starting point (0,0), the X axis is horizontally and Y axis is vertically. In an export/import area the data order starts from the lower-left tile of this area (depicted with a dot in the picture) and the order the data are stored is row by row (represented by the arrows).

L2 Export/Import Files

The file types available are:

  • (*.exp): This contains only tile offset values (tile numbering) of the exported/importing tiles.
  • (*.xpe): This contains tile offset values (tile numbering) and elevation data of the exported/importing tiles.
  • (*.xpf): This contains all tile values (tile offset, elevation, PAL offset, X1 and X2) of the exported/importing tiles.

The format of these files are:

(*.exp)

Byte # Length Type Value
0 1 byte ASCII value 84 (letter T)
1 1 byte ASCII value 69 (letter E)
2 1 byte ASCII value 80 (letter P)
3 4 long Lower-left X coordinate of export area (LLX)
7 4 long Lower-left Y coordinate of export area (LLY)
11 1 byte ASCII value 101 (letter e)
12 1 byte ASCII value 120 (letter x)
13 1 byte ASCII value 112 (letter p)
14 4 long Size of X dimension (number of columns)
18 4 long Size of Y dimension (number of rows)
22 4 long Tile Offset record #1
26 4 long Tile Offset record #2
4*(n-1)+22 4 long Tile Offset record #n

File size: 4*Rows*Columns+22

(*.xpe)

Byte # Length Type Value
0 1 byte ASCII value 84 (letter T)
1 1 byte ASCII value 69 (letter E)
2 1 byte ASCII value 80 (letter P)
3 4 long Lower-left X coordinate of export area (LLX)
7 4 long Lower-left Y coordinate of export area (LLY)
11 1 byte ASCII value 120 (letter x)
12 1 byte ASCII value 112 (letter p)
13 1 byte ASCII value 101 (letter e)
14 4 long Size of X dimension (number of columns)
18 4 long Size of Y dimension (number of rows)
22 4 long Tile Offset record #1
26 2 short Elevation record #1
28 4 long Tile Offset record #2
32 2 short Elevation record #2
6*(n-1)+22 4 long Tile Offset record #n
6*(n-1)+26 2 short Elevation record #n

File size: 6*Rows*Columns+22

(*.xpf)

Byte # Length Type Value
0 1 byte ASCII value 84 (letter T)
1 1 byte ASCII value 69 (letter E)
2 1 byte ASCII value 80 (letter P)
3 4 long Lower-left X coordinate of export area (LLX)
7 4 long Lower-left Y coordinate of export area (LLY)
11 1 byte ASCII value 120 (letter x)
12 1 byte ASCII value 112 (letter p)
13 1 byte ASCII value 102 (letter f)
14 4 long Size of X dimension (number of columns)
18 4 long Size of Y dimension (number of rows)
22 4 long Tile Offset record #1
26 2 short Elevation record #1
28 1 byte PAL Offset record #1
29 1 byte X1 record #1
30 1 byte X2 record #1
31 4 long Tile Offset record #2
35 2 short Elevation record #2
37 1 byte PAL Offset record #2
38 1 byte X1 record #2
39 1 byte X2 record #2
9*(n-1)+22 4 long Tile Offset record #n
9*(n-1)+26 2 short Elevation record #n
9*(n-1)+28 1 byte PAL Offset record #n
9*(n-1)+29 1 byte X1 record #n
9*(n-1)+30 1 byte X2 record #n

File size: 9*Rows*Columns+22

L0/ELV Export/Import File

The only availiable file format is:

(*.xlv)

Byte # Length Type Value
0 1 byte ASCII value 84 (letter T)
1 1 byte ASCII value 69 (letter E)
2 1 byte ASCII value 80 (letter P)
3 4 long Lower-left X coordinate of export area (LLX)
7 4 long Lower-left Y coordinate of export area (LLY)
11 1 byte ASCII value 120 (letter x)
12 1 byte ASCII value 108 (letter l)
13 1 byte ASCII value 118 (letter v)
14 4 long Size of X dimension (number of columns)
18 4 long Size of Y dimension (number of rows)
22 2 short Elevation record #1
24 2 short Elevation record #2
2*(n-1)+22 2 short Elevation record #n

File size: 2*Rows*Columns+22

manuals/terraineditor/reference/file_formats_reference/export_import_terrain_files.txt · Last modified: 18/08/2023 17:18 by 127.0.0.1
GNU Free Documentation License 1.3
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0