Terrain ElevationQuite often, battles have been fought (intentionally) on level fields that offer free room to maneuver for both parties (indeed, the field of Gaugamela has been actively leveled before to allow the use of war chariots).Sloped terrain in contrast is tactically more tricky - it restricts the movement and line of sight somewhat, tends to create choke-points in which numerical superiority might not matter much or killing fields in which high archers can mow down approaching units. All this can be used by a capable general, but more often than not the opposing party would not see reason to give battle under these conditions. After all, if the enemy is arrayed in a well-defensible position on a steep hill, it is stupid to attack that position, so a strategy different from a direct battle can be used to force more favourable conditions. Nevertheless, for one or the other reason, many historical battles have been fought in non-level terrain --- such as Issos or Thermopylae, and so there is clearly a need to consider terrain in the simulation. In this tutorial, we will investigate how to define a terrain model for the battlefield.
Interpolation pointsIt would seem straightforward to supply elevation data on a regular grid corresponding to the way the battlefield is defined, but doing so is not only tedious - good grid data is also not always easy to get (and not easily converted into the format needed). Thus while it is possible to define terrain elevation that way, there is an easier way in which just a few elevation points are defined and the elevation between is determined by interpolation.While this interpolation is done, it is of course possible to do other operations as well, so they too can be specified. Interpolation points are always specified for fractional coordinates of the battlefield, so an (x,y) of (0.5, 0.5) means that the point refers to the center of the field. All points and commands have to be specified in a dedicated definition file that is loaded by the main config file. An elevation file might start like this:
The keyword smoothing defines the inverse power of the interpolation function. If it is high, the terrain between interpolation points will tend to change in a series of terraces or steps, if lower transitions will be more smoothly, if it is lower still interpolation points will be isolated hills on average terrain. random adds a degree of noise to the interpolation points themselves, the higher the value the more random the points will be. jitter in contrast adds roughness to the grid that is produced. Finally multiply is applied on the final elevation grid to make all features more prominent (this can be used if you have elevations in ft that need to be converted to meters for instance). The table below is just a series of (x,y,elevation) triplets, where x and y are between 0 and 1 as they refer to fractions of the battlefield and the elevation is in meters.
Elevation grid workflowTo create an elevation grid, the config file needs to be instructed to load the file containing the interpolation points. This is done via an elevation_map statement:
When the simulation is now started, a terrain grid is generated and a gnuplot-suitable file named terrain_plot.dat is written. This can be used to visualize whether the terrain looks indeed as expected. Here is an example of the cliff with two different smoothing parameters:
A low smoothing parameter gives a gradual transition and generates 'wavy' terrain, whereas using a value of 6.5 leads to significantly more blocky appearance (note that in both cases the plot is not to scale and the height of the cliff appears much exaggerated):
When you're happy with the terrain, typing in interactive mode save elevation_grid filename.dat dumps the result into filename.dat - from there it can be loaded directly via
which is much faster than generating it from the interpolation (and of course freezes the randomness that may be defined).
Units and the elevation gridSince both in the definition of initial unit positions and during a battle it is not quite easy to see where units are with respect to the terrain, there are two ways of visualizing this information.First, any formation can be commanded via formation [name] plot position to dump its position information into a gnuplot-suitable file named [name].dat. In this way, formation positions can be visualized in 3d space on the terrain grid. Alternatively, if colors are active, the command color slope activates background coloring dependent on terrain slope. Where the background color changes to yellow, the slope can significantly affect a unit, where the color is red, the slope prohibits movement. At least for more extreme terrain, that allows to immediately see where units are placed relative to the steep slopes and ridges in the terrain. The example example12.cfg along with elevation_cliff.dat contains the example cliff terrain and places a few units to explore it.
Continue with Terrain Cover. Back to main index Back to science Back to historical battle simulation Created by Thorsten Renk 2023 - see the disclaimer, privacy statement and contact information. |