Mission Generator
Functionality
The Mission Generator creates a pseudorandom mission based on user set group nodes and battle
templates. The Mission Generator places groups of ground and air units, as well as a player flight
on the map, and automatically creates route paths for these groups taking into account the goals
of each group and the topography of the terrain. There are several unit types supported: attack
planes, fighter planes, helicopters, ground vehicles (artillery, air defense, tanks and transport
units). In addition, the Mission Generator sets the weather options, starting time of the mission
and tasks for the player.
User Interface
The user interface consists of two primary parts: the Create Fast Mission menu for the player to
use to generate a mission and the Mission Generator editor for mission builders to view and edit
the Nodes and Templates used by the Mission Generator in the Mission Editor.
The Create Fast Mission menu is accessible from the launcher main menu , but can also be
accessed from within Mission Editor's task bar. Here we can change mission generation
preferences (like player country and weather conditions, etc.) and run the generator to generate
the mission using the set options.
The next part is for mission builders. Here, using the Mission Generator editing menus inside the
Mission Editor, we can perform deep changes to the missions created by the generator. This
requires editing generator Nodes and Templates. There are two primary dialog menus for this,
which are accessible from Mission Editor task bar.
Interface for mission builders:
How it works
The Generator is not fully autonomous and requires some user-defined data to work well. It’s
done this way, because it’s too difficult to analyze the ground surface automatically and place
units on it in a reasonable way.
Predefined data may vary for different types of missions, but currently we have only one mission
type: «ground battle». To create missions of this type, we need following:
1. List of Nodes. A Node is an area on map where a battle can be placed. A Node includes
positions of Red and Blue coalition forces and a list of unit Templates, which can be
placed in this Node. A Template can be used in multiple Nodes.
2. List of Templates. A Template defines the possible composition and placement area for
units on the map. It’s not connected to any specific point on the map. A Template
includes a list of unit groups, with a behavior pattern set for each group and their possible
placement. You can get various dispositions of units within the Template area every time
you use the same Template. So in a Template, you don’t set a placement of forces and
their exact composition, but set zones where forces can be placed and their possible
composition. For example, a single Template may produce in one case 2 tank platoons on
the south side of the Template position and in next case – 3 CRV platoons on the north
side.
3. The set of unit options, which defines the available types of units and their settings for
each Template. It consists of:
lists of platoons (of ground units, airplanes and helicopters)
formation of ground groups (column, wedge, chaos, etc)
payloads for aircraft
liveries (skins) for aircraft
weather presets, which are linked to the time of year
list of countries assigned to coalitions (coalitions are predefined in the generator as
well)
and some others
So the more Templates and Nodes we have, the better and more varied missions we can create.
Additionally, there are special tools in the Mission Editor to edit Nodes and Templates.
The automated algorithm of mission generation is fairly simple (leaving out the pathfinding logic
for ground units) and consists of the following:
1. Choosing a random Node on the map
2. Choosing a random Template for each coalition (from the possible Templates assigned
for this Node).
3. Placing forces on the map according to the Template
4. Setting weather conditions, time and player tasks
Here is an example of the mission generation process:
Nodes and Nodes Editor
As mentioned above, Nodes are points on map, where battles can take place. Predefined Nodes
are stored in the lua file:
MissionEditor\data\MissionGenerator\GeneratorData\nodes{TOW}.lua.
If you change the Nodes, the list it will be written to
DocumentsAndSettings\{UserName}\SavedGames\DCS
Warthog\MissionEditor\nodes{TOW}.lua
There is a special tool in Mission Editor for editing Nodes. You can use this to build battles
wherever you want. You can access the tool from Mission Generator menu:
With this tool you can add and remove Nodes, change positions of Red and Blue coalitions and
edit the list of compatible Templates. Drag and drop functionality is supported. Simulator co-
ordinates are used to display Node positions. From this tool you also can generate a mission
using the selected Node and Templates.
Templates and Template Editor
The Templates editor can a little scary at first sight, so we'll first discuss Templates in general,
then review the menus for editing Templates. A Template is a way to place units on the map. For
example, a template may be "mixed battalion in attack".
A Template defines the possible positions for ground forces, aircraft, helicopters and the starting
position for the player flight. The possible position is a rectangular area where a company (which
consists of several platoons) can be placed, using local coordinates. The Template is placed
relative to the center of the node and the axes are typical for simulators, as you can see on the
picture below. Platoons (groups of units) in a company will be randomly placed within the
company area independently of one another. Size of the rectangle doesn’t correlate with the
number of groups inside and only sets the borders of the zone, within which units could appear.
One Template can contain any number of companies. Possible zone for the player's flight is the
same rectangle as for companies.
Every Template belongs to either Red or Blue coalition, but is not linked with countries. So any
vehicles can be placed in any Template. For example, Russia can use the Apache or the A-10 and
the insurgents can use the Ka-50 if so desired. Coalitions are defined in a separate lua file.
Now let’s try to create a Template from the Template Editor. First of all we need to open the
Template Editor and select any node on map.
The Template Editor can be opened here:
Now we can create a new Template and add a ground company there. We can drag the company
area on map and change the size of the area, where units can appear. Also we should fill the
company with units and tell them what to do. We can do this in second part of the Templates
dialog window.
There is a “Company structure” list, which determines the possible structure of the company. For
example, a “tanks” company can consist of 4 “t-55” platoons or 3 “t-80” platoons and an air
defense vehicle or it can be empty (this is just an example). List of platoons in the groups can be
changed using the « platoons» menu of the dialog.
Also the company can be set for a specific “amount” level. You can change the company
structure depending on the desired difficulty level and overall number of forces, which the user
chooses when generating the mission. For instance, there can be two tank platoons on "min"
level and four platoons plus BRDM platoon on "max".
When we are finished editing the company with possible units, we need to set a behavior pattern
for the company. This will determine paths and tasks for groups in the company. Currently, the
following behavior types are available:
aAtackGround (air groups) – close air support
aAtackAir(air groups) – combat air patrol
aAWACS(air groups) – for AWACS plane (E-3A)
gAttack (ground groups)– move to the enemy and fire
gArtAtack (artillery groups) – move to the enemy, then stop about 4000 km from the
target and start fire
gMovingByRoad (transport columns) –move to a random point on the map using road
priority logic
gStay (ground groups) – do nothing, just stay and fire if conditions permit
gJTAC (ground groups)– one of the units is a JTAC
If we want enemy groups to attack our company, we need to set the “Is target” flag and “gStay”
behavior for it (if we don’t set “gStay” behavior, enemy tanks will be moved to a void location).
Others parts of the dialog are not very important. There are names for the company and start
position of units in the group (column, wedge, chaos, etc).
Templates are stored in lua file
MissionEditor\data\MissionGenerator\GeneratorData\templates
{TOW}.lua.
And user templates in DocumentsAndSettings\{UserName}\SavedGames\DCS
Warthog\MissionEditor\templates{TOW}.lua
Other Data
There is a lot of other data in a fairly simple tables (simpler than templates). This data should not
be necessary to change very often. But if you want to add a new platoon or a new starting
position for units in a group (for example for an air defense system) or change a default payload
set, you can do it there.
All files are stored in folder
MissionEditor\data\MissionGenerator\GeneratorData
File name Table name Definition
others.lua platoons All possible platoons
startPositions Start positions of ground units (formations)
pylons Pylons for aircraft
coalitions Links of countries and coalitions. There is also
a priority of each county in a coalition (how
often their units are created on the map)
scoreMessages Messages which are displayed by a trigger
when the player earns some scores
localizedStrings Strings from the briefing.
environment.lua season Determine temperature and artificial day time
by season
weather Determine a set of weather presets.