Interactive modeBy default the simulation runs in the so-called interactive mode. This allows to see what the individual units are doing and, most importantly, to command them. This is in contrast to the automatic mode in which a large number of iterations of the same battle can be run quickly to accumulate statistics which allow e.g. to see what effects a change of battle tactics has.
Using interactive modeUse the file example01.cfg (see also below) from the commandline of a shell via ./battle example01.cfg and you'll get to see the following:
This is a very simple representation of the battlefield in which every cell - as stated in the config file - represents 5 m distance and each unit is marked by its tag. Below the picture of the battlefield is a line Command: into which instructions can be typed. For reference, this is the complete config file that has been used in this instance - all elements should be familiar from the last section.
Now, unlike a game, the simulation is neither done in 'real time' (aka units move all the time) nor in a round-based approach - instead it is designed such that all units move (near) simultaneously, yet there is, as in a real battle, time to observe and think. Basically time runs only when commanded. This is done with the instruction advance 1 where the number represents the time in minutes to forward the simulation (if you find that tedious, you can also type go 1 to get the same effect...). So to see what the units are doing, we can forward for 30 seconds by go 0.5. Well, no change... That's because we didn't re-draw the battlefield, so type show_battlefield or sb and see that they have advanced some. That is because by default units placed on the battlefield are advancing into the direction they're looking, and if they get into contact with an enemy unit, they attack (sounds reasonable, doesn't it?). So try letting them walk forward a bit more, and re-draw the battlefield, and you'll see that they'll walk just past each other. That's again default behavior, useful if you want them e.g. to exploit a gap in the enemy formation, but not really if you want a fight. So restart the simulation by typing reset. We now will order the units, and that works by typing the sequence unit <tag> <order> (<parameter1>) (<parameter2>). One way to order troops to meet each other is to let them advance into a given direction. For instance unit P1 advance 330 will make the unit advance into compass direction 330, thus meeting the incoming G1. You'll see them close to each other for a while until eventually a winning report is given. If you do not want to guess the compass direction, you can for instance command a unit to find the nearest enemy with unit G1 seek_enemy. Alternatively you can change the behavior of 'just walk by' by commanding unit P1 guard - that will make the unit engage any enemy that moves within a pre-defined radius of 30 meters. If you want to change that radius to 50 m, you can command unit P1 engage_upon 50 . Basically there is a selection of direct movement commands like advance or seek_enemy that have an immediate effect and conditional commands like engage_upon that are triggered only when a certain condition is met. But it seems a bit tedious to deduce from the fact that units are close by that they're actually fighting - how can we know that easier? One way (that works under Linux, but I'm not sure about Windows) is to add the lines
to the config file - that displays units that are in fighting contact in boldface and units that have suffered damage in red. Another way is to add the line
to the config section - that will output internals of the engine to show that there's a battle happening. Finally, the command unit G1 report damage will provide a breakdown of casualties so far. Also, if you're tired of requesting to see the battlefield all the time,
added to the config section will show it after each timestep command. Once you're done with interactive mode, typing quit or simply q into the commandline will end the simulation.
List of direct and observational movement orders to unitsAll commands have to be prefixed by unit (tag).
Continue with Automatic 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. |