Current Version: 1.3.2

Make Terrain

This tool was made to be used with a Falcon 4.0 theater installer. The main purpose is to rebuild all terrain files from the minimum information required. It was tested on OF setup on both 64 and 128 Segments terrains. It might work (maybe with limitations) on other Falcon setups (AF, RV) but this is yet to be tested. It will NOT work on 2-bytes terrains, only on 4-bytes. The program will NOT test for a 4-byte terrain before start working, so most probably you'll end up with messed terrain files If you try that. If there is interest for a 2-byte version, get in touch with me to create one. For more info on various terrain elements and creating some of the required files to use with this program, see the ModTerrain program. The general functions that MakeTerrain will perform are the following:

  • Create all Lx and Ox files.
  • Create theater.mea file.
  • Calculate all normals.
  • Merge a TARGA file in all Lx as Palette Offset information and put the TARGA palette in Theater.map file.
  • Create the fartiles.dds (both normal and night) from the actual DDS files (no more PCX files with restrictions in color, or restriction in one palette per set). This is done by distributing two files (one for day and one for night DDSs) with your theater installer, which contain all DDSs resized. During install, the program will compress all fartile dds from these files. You don't need the texture.zip anymore.
  • Finally, this tool can create the two “Master” Fartile files (one for day and one for night) from the actual DDS images.

Usage

MakeTerrain is a command line tool, which makes it ideal for installers. All the command-line arguments start with a special character, different for the usage of the argument. Some general rules are:

  • All the arguments are separated by whitespace (spaces or tabs).
  • All arguments must be declared once. If something is declared more than once, the first instance will be used.
  • Every argument has a unique special character that must be typed before it, in order for the program to recognize it.
  • Double quotes should be used to enclose paths and filenames, especially if there are spaces in-between. The special character can be inside the double quotes or outside.
  • The order in which you put the arguments doesn't matter.
  • All paths specified, must NOT end on “\”.

The general argument list is as follows:

      MakeTerrain.exe -[TERRDATA_PATH] +[ELV_FILE] %[TILEOFF_FILE] *[IN_FT]     
                /[IN_NFT] $[IN_TGA] @[ELV_METHOD] #[MIN_NORMAL_ANGLE] ![MAX_NORMAL_ANGLE] 
                      M[M_TILE_SIZE] L[L_TILE_SIZE] F[FIXED_ELV_FILE] NOFAR AF BMS
      MakeTerrain.exe c -[DDS_FOLDER] +[TEXBIN_FILE] *[OUT_FT] /[OUT_NFT]

The first use will build the terrain from the specified basic components. These are:

  • -[TERRDATA_PATH] That's the path of your theater's terrdata folder (the one that contains the terrain and texture folders).
  • +[ELV_FILE] That's a raw file containing the elevation data (type short - 2 bytes) of L0 starting from low-left corner of the theater working towards upper-right. This file can be produced by ModTerrain (using -x #0 =e see the ModTerrain program for more information).
  • %[TILEOFF_FILE] This is the file containing the tiling information of L2. This can be produced by ModTerrain (using -x #2 =t see the ModTerrain program for more information).
  • *[IN_FT] /[IN_NFT] The two “Master” fartile files which contain the resized DDS images for the fartiles. These files can be produced by this tool (see below).
  • $[IN_TGA] The TARGA image that contains the Palette offset information and the palette to be stored in theater.map. This can be produced by ModTerrain (using -t #2 see ModTerrain program for more information) and it must have the same dimension as L2.
  • @[ELV_METHOD] This specifies the elevation calculation method (1: RMS 2: Simple Mean 3:Max). This argument is optional and the default value is 1 (RMS). See ModTerrain program for more info.
  • ![MAX_NORMAL_ANGLE] This specifies the max angle value for the range of angles for calculation of Normals. For more information on this see ModTerrain program. This argument is optional and the default value is 78.5 (0.785 rads or 45 deg). For AF is recommended to be 152.
  • #[MIN_NORMAL_ANGLE] This specifies the min angle value for the range of angles for calculation of Normals. For more information on this see ModTerrain program. This argument is optional and the default value is 0 (0.0 rads or 0 deg). For AF it is recommended to be 61.
  • M[M_TILE_SIZE] L[L_TILE_SIZE] These are the sizes of the M and L tiles respectively in pixels (width and height). These are optional and if omitted (or set to 0) the M value will be the half of the H tile and the L value will be the half of M value. The lowercase letters m and l can be used as well.
  • F[FIXED_ELV_FILE] This is a file that specifies a set of tiles in L0 mode that should maintain their elevation value in all Lxs. This is useful for keeping large objectives, e.g. airports, on the ground when Lxs are alternating. This file can be produced by TerrainEditor.
  • NOFAR When this parameter is present, the program will only process and create the L0,L1 and L2 files. Use it when you want to test something without creating fartiles that takes time.
  • AF When this parameter is present, the program will calculate the phi value in normals in the range 0-255, instead the 0-63, which is the default for OF/FF.
  • BMS When this parameter is present, the program will create only L0and L2 files and no fartiles will be created. Moreover, there will be no check for M and L terrain tiles.

The second use is defined by the letter c as an argument and creates the “Master” fartile files (one for day and one for night). The arguments that must be supplied are:

  • -[DDS_FOLDER] The path to where your theater DDS images are. All DDS images must be in this folder, not only custom ones. Only H*.dds images are required by this tool.
  • +[TEXBIN_FILE] The texture.bin file that is to be used by your theater.
  • *[OUT_FT] /[OUT_NFT] The filenames of the “Master” fartile files that are going to be created by the program. If these files exist they will be overwritten.
manuals/make_terrain/home.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