L3DT users' wiki
Large 3D terrain generator

Exporting TER and MegaTerrain for TGEA

Author Aaron
Date 1 Sept. 2009

Before we start

Disclaimer

This plugin is still experimental, so you may experience bugs or other odd behaviour. Please report any bugs to aaron@bundysoft.com.

Heightfield size and scale

TER files must be 256×256 pixels in size if exporting a single TER file, and 512×512 pixels if exporting MegaTerrain. This means that when you generate your heightfield in L3DT, you must set the heightfield width and height to the above sizes. L3DT was designed to generate very much larger heightfields than this, and the user interface may be a little clumsy when dealing with such small maps. In particular, if you are using a 'designable map', you are strongly recommended to use a small design map / heightfield ratio (e.g. 16) so that you have finer-grained control when designing such a tiny map.

The current TER exporter for TGEA requires a horizontal scale of 2 metres. If you intend to use a different horizontal scale, you will accordingly need to edit the 'SquareSize' setting in the terrain block object within the mission file.

Generating alpha maps

TER files for TGEA do not include a pre-calculated texture map such as those generated by L3DT. Instead, the files contain alpha masks so that Torque can blend the textures at render time. To generate these alpha masks in L3DT, you should first generate the water map, and then you must generate the attributes map. You may subsequently edit the attributes maps to add roads, etc.

Once the attributes map is ready, you may generate the alpha maps using the 'Operations→Alpha maps→Generate alpha maps' menu option. In the alpha mapping wizard, you should use the following settings:

  • The number of layers is less than or equal to 8. If the layer count is greater than this, use the 'Combine alpha layers' wizard to combine alpha layers.
  • The alpha map resolution must be set to 1. This is the default setting.

Exporting the file(s)

To export the terrain as a single Torque TER file, select the 'File→Export→Torque TGEA→Export Torque TER (v5)' menu option, or to export as Torque MegaTerrain files, select the 'File→Export→Torque TGEA→Export Torque MegaTerrain (v5)' menu option. Either option will open the 'Export Torque TER' window, shown below:

:plugins:fileio:l3dtio_torqueter:userguide:exporttorqueterdlg.png

The options are as follows:

TER file name

To select the TER filename, press the browse ('…') button. The file should be exported into your game folder, or a subdirectory thereof. For example, for the 'Stronghold' demo in TGEA 1.7.1, the proper directory for saving TER files is:

C:\Torque\TGEA_1_7_1\GameExamples\Stronghold\game\scriptsAndAssets\data\missions

Texture path

The 'Tex path' field is the relative path from the terrain file to the folder in which the textures/materials for the terrain will be stored. By default, this setting is automatically generated (using the 'auto' checkbox) such that if you save the TER file in the 'game\scriptsAndAssets\data\missions' folder, your textures will be stored in the 'game\scriptsAndAssets\data\terrains\[project name]\' folder.

After you set the TER file name, the 'tex. path' field will be updated automatically, like so:

:plugins:fileio:l3dtio_torqueter:userguide:exporttorqueterdlg2.png

Example

For example, if I save a TER file here:

C:\Torque\TGEA_1_7_1\GameExamples\Stronghold\game\scriptsAndAssets\data\missions\MyExample.ter

…the automatically-generated texture path will be:

..\terrains\MyExample\

…which means the textures will be saved in this folder:

C:\Torque\TGEA_1_7_1\GameExamples\Stronghold\game\scriptsAndAssets\data\terrains\MyExample\

Game folder

Before L3DTio_TorqueTER can export your TER file, it must know the path to your game's root folder. Please enter this path into the 'Game folder' edit box or select the folder using the '…' browse button.

For example, for the 'Stronghold' demo in TGEA 1.7.1, the correct game folder is:

C:\Torque\TGEA_1_7_1\GameExamples\Stronghold\game

Aside for the curious: In TGEA, the game folder is only strictly needed to set the correct relative path references for neighbouring files in MegaTerrain TER files. However, for simplicity's sake, the 'Export Torque TER' window behaves in the same way when exporting both single TER and MegaTerrain TER; either way, you need to set the game folder. Fortunately, you should only need to do this once, as for subsequent exports the plugin will recall the last-used game folder.

Export mission file

If you enable the 'Export mission file' checkbox, the L3DTio_TorqueTER plugin will also create a stub TGEA mission file (.mis) that includes the correct settings for the terrain and water blocks.

The mission files generated by this plugin are configured to work with a default TGEA game configuration. If you have changed game resource paths or other settings, you may need to edit some of these mission settings manually.

Output

After you click OK, the L3DTio_TorqueTER plugin will export the TER file(s), material textures and mission file.

Results

Some examples of L3DT terrain in TGEA v1.7.1 are given below:

www.bundysoft.com_coppermine_albums_userpics_torqueterdemo2.jpg
Single TER from L3DT rendering in Stronghold demo.
www.bundysoft.com_coppermine_albums_userpics_torquemegaterrain.jpg
MegaTerrain from L3DT rendering in T3D demo.

 
plugins/fileio/l3dtio_torqueter/userguide/tgea.txt · Last modified: 2017/08/31 06:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki