Defining units

The first step in setting up a virtual battlefield is to define the units which will fight on it. By units we usually mean something the size of a Roman centuria (some 80-100 soldiers) up to a cohors (some 480 soldiers). Generally the engine does not care much if you define much larger (or smaller units), but the considerations in the background reading imply that doing so alters the balance of randomness, so if you introduce substantially different unit size prepare to see side effects.

Layout of the config file

The primary device to control the simulation is the config file in which the army, the battlefield and the rules according to which the battle is simulated are specified. You'll need a text editor to create such a config file.

The config file is divided into various blocks. Each block is initiated by a keyword. Inside each block, there are pairs of key/value pass variables, and the file is always started by the keyword input and terminated by the keyword end.

First, we need a virtual battlefield. That is a rectangular area of which we define the size in x (horizontal) and y (vertical) in number of cells as size_x and size_y, after which the size of each cell is specified in meters.

battlefield
size_x 100
size_y 40
scale 5.0

Thus, the above battlefield has a horizontal size of 100 cells of 5 meters each, so 500 m in total (and 200 m in y direction).

Unit and unit type definitions

Units are defined in two steps - first a unit_type is specified and then the individual units are derived from these types. Below is an enomotia of a classical Greek phalanx as an example:

unit_type name Phalanx
speed 60.0
attack 40
armour 6
damage 4
num_ranks 8
num_files 10

What do these values mean? Let's cover the easier ones first: The name allows to assign an actual unit (to be defined later) to this type. speed is the movement speed in meters per minute (if the above number seems low to you, read movement in the background section). num_ranks and num_files together give the number of soldiers (if the unit isn't standing in rank and file, num_soldiers can be used instead).

Now to the more tricky values: attack defines the combat-capability of the unit - how well do the soldiers fight, how well do they interact as a unit, how well are they equipped and trained to use that equipment (think of a Roman centuria doing a testudo-formation - it's simply not enough to have large shields, soldiers also have to train how to use them and move around in such a formation)?

damage describes how much damage the unit's weapons can inflict on another. Inflicting damage is not the same as fighting ability - a sledgehammer for instance is a weapon that does a lot of damage, but it is a very poor and unwieldy fighting weapon. On the other hand, a quarterstaff is an excellent fighting weapon, but hardly as dangerous as the sledgehammer.

Conversely, armour (the code recognizes also the spelling armor) is the ability to resist damage - a plate armour is better at defeating blades and arrows than a linthothorax.

Note that these numbers per se are meaningless - they acquire meaning only in comparison with those of another unit and with the range of random numbers they are modified with. So if we say that a Phalanx with bronze helmets, linthothorax and shield has an armour value of 6, we would have to place that of a Roman Legion somewhat higher and that of light infantry somewhat lower. From other unit type definitions encountered in this tutorial, you'll quickly pick up what the idea is and how each value affects the battle, and if you disagree with my ideas about these numbers, you'll be able to use your own.

A minimal definition for the actual unit is as follows:

unit
name Greek_1
type Phalanx
tag G1
army 1
pos_x 130.0
pos_y 20.0
dir_x 0.0
dir_y 1.0

The unit gets a name as well as a type (which must match a type name defined before) and a tag - a two letter combination used to command it and to display it on the battlefield. Then we need to know what army it fights for, numbered as 1 or 2, as well as where to put it on the battlefield and what direction it is facing initially.

Important note: The software automatically gathers units that by chance leave the battlefield after crossing the enemy line and sends them back into the fray - for this to work army 1 must be in the lower half of the battlefield and face upward. If you need a different arrangement for whatever reason, you must switch range checking off.

These are the basic steps to put units onto the virtual battlefield, and we'll look at how to get them to do something there next.

Continue with Interactive mode.


Back to main index     Back to science     Back to historical battle simulation

Created by Thorsten Renk 2017-2020 - see the disclaimer, privacy statement and contact information.