Terrain Development Guide
Chapter 4: Additional Resources
Terrain Compression Tool: Tool.exe
When you create your terrain maps you will find that they can be very large files, especially if your terrain is large or uses high resolution (small terrain grid spacings). Available from the Downloads section of the Targetware web site is a tool with the creative name "tool.exe". Tool is a program that compresses your TGA terrain maps using an algorithm specific to Targetware. Not only does it reduce the overall size of the terrain maps, it also helps speed loading and processing of your terrain within the simulation. It is recommended that you use this prior to distribution of your terrain. Tool is available for both Windows and Mac OS X.
On the PC:
Tool is accessed using the Command Line. To bring up the command line interface simply, go to start-programs-accessories-command prompt. When the command line window opens, navigate to the directory containing your terrain maps. To navigate use the cd <directory path> command (where <directory path> is the path to the directory containing the TGA files).

Tool is reversible. This means that it can compress TGA files to MAP files, and uncompress MAP files to TGA files. To compress a TGA file into a MAP file, type the following:

To uncompress a MAP file back to a TGA file, type the following:

If you ever forget the commands, just typing "tool" will give you the options:

On Mac OS X:
Using Tool on the Mac is basically the same as using it on the PC. Tool is a command line tool accessed through the Terminal. To bring up the Terminal, go to Applications>Utilities>Terminal, if you don't have a link for it in your Dock. To save yourself some typing work, you can move the tool program to the same directory as your terrain files. When the Terminal window opens, navigate to the directory containing your terrain maps. To navigate use the cd <directory path> command (where <directory path> is the path to the directory containing the TGA files). A shortcut for this is just to type "cd ", then drag the icon for the folder into the terminal window, the Terminal will type out the full path for you.
To compress a TGA file into a Targetware ".MAP" file, use this command:
./tool img2map filename.tga
To uncompress a MAP file back to a TGA file, type the following:
./tool map2tga filename.map
|