EMG for Servers

Introduction

The EMG can also be used to automatically generate missions for a Multiplayer Server. It can do this both for Cooperative or Dogfight game modes. I have created a special executable ServerGenerator.exe for this. It basically does the same as the standard EMG, but it is driven by config files only, it can generate multiple missions at once and it will automatically adjust the IL2 server configuration file (.sds) with the correct mission names to load. This, together with some simple batch files and the windows Task Scheduler makes it possible to have a fully automated server that will generate missions every day or week and host them. Tip: It can also generate multiple single player missions.

WARNING: I created this tool for running the Syndicate server, I did not design it for others. Therefore things will not be very logical or transparent as I made things up as along the way :)

Installation

The server version uses the same config files and data folders as the EMG so the extra files should be installed in the same EMG folder.

The extra files can be downloaded here: Latest Server Generator zip file (v84, mar 2024). Always update together with EMG.

and will contain:

Configuration

When you run ServerGenerator.exe it will first look in server_config.json to find out where IL2 is installed, the name of the server and a number of default parameters:

{

"il2_path": "D:\\Program Files\\1C Game Studios\\IL-2 Sturmovik Great Battles",

"server_name": "Battle of the Channel by the SYNDICATE",

"mission_prefix": "syndicate",

"number_of_missions": 6,

"start_date": "01.03.1942",

"skip_days": 90,

"start_time": "dawn",

"missions_duration": 9000,

"map_name": "The Channel",

"front_name": "The Channel",

"game_type": "dogfight",

"flight_size": 4,

"plane_start": "on the ramp",

"target_distance": "close",

"lockPayloads": 1,

"objectives_amount": 4,

"ai_planes_count": 11,

"ai_density": "few",

"historical": "True",

"generate_missions": 1,

"msbin": 1,

"no_mission": 1,

"mission_rotation": "mission_rotation_christmas.json",

"mission_order": "default"

}

Most of these are self explanatory and are the same as in the EMG, but let's have a closer look:

il2-path is the path to your IL2 install, make sure to change this to match your installation.

server_name is the name as it will appear in the server list. You still need to edit the description in the .sds file

mission_prefix is used to find a folder where the missions should be generated (so in <il2 path>\data\multiplayer\dogfight or <il2 path>\data\multiplayer\cooperative) . This keeps them together so for a player that automatically downloads these mission they will be easy to identify. It is also used to find the Dserver config file that has to be changed; it will look for the following file: mission_prefix + "_" + game_type + .sds. Example: syndicate_dogfight.sds  Note that the folder and .sds file should already exist when generating or the program will fail! 

start_date, skip_days, map_name, front_name, objectives_amount are only used when no file name for mission_rotation is provided ("mission_rotation": ""). In that case the program will generate it's own random mission list. The first mission will start at start_date and the next mission will start at start_date + skip_days and so forth. start_time is not used at the moment as the time of day will be random.

flight_size determines how many planes there are in a flight, both for lead and escort flights. Only applicable for cooperative & single player game more.

plane_start sets the start location option, see EMG for possible values.

target_distance sets limits to target distance so flight times will not be too long. See EMG for possible values.

lockPayloads is used when payloads should be locked based on historically available payloads given the date. It affects the airfields in 'dogfight' mode where players can spawn. Which loadouts and mods are locked are defined in planes.json.

ai_planes_count is the same as in the EMG, but for "dogfight" missions it is important to understand how this number is used:

The first three of this number will be used for an AI bomber flight. In "dogfight" there will be as many AI bomber flights as there are targets (objectives). Each side will take turns to attack a target so there will only be one bomber flight in the air. The AI bombers are turned off by default in config.ini. Look for ai_bombers = False and change to True.
The rest will be divided over AI fighter flights. In the example this will come down to: 11-3 = 8, which will result in 2 flights of 2 planes, which will patrol in random areas at the same time.

ai_density is the same as in EMG, it controls the number of other AI: ambient vehicles, trains, ships...

historical determines if a historical planeset should be used, by default is "True". The historical plane set is derived from the theatre of war in combination with the mission date. If set to "False" the custom plane set will be used which can be managed in the EMG.

generate_missions can be set to 0 if only the .sds file should be updated and mission not generated. Used for testing.

msbin can be set to 0 if only .mission files should be generated and not the binary version. Used for testing as creating the binary version can take a long time.

no_mission is set to 1 by default. This means the generated .mission file is deleted after generation and only the binary version will remain. This is imported for a server as you don't want players to download the (much larger) text version of the mission.

mission_rotation will define which pre-defined mission rotation should be used. If empty, it will generate random missions (see above)

Finally mission_order determines the mission order. It will be random if this has value "random", otherwise the order as given in the mission rotation config file will be used.

Mission rotation

The mission rotation file (mission_rotation.json by default) defines a list of possible mission configurations of which a subset (or all) can be used to generate missions, depending on the number_of_missions parameter in the configuration file. Here is an example:

{

   "24.12.1944": {

        "name": "The Ardennes, 24 dec 1944 - Interdiction",

        "map": "Rhineland",

        "front": "The Ardennes",

        "scenario": ["interdiction", "interdiction"],

  "plane_set": "custom_planeset.json",

        "target": ["random", "random"],

        "target_amount": 4,

        "weather": "rain clouds",

        "time": "random"},

"25.12.1944": {

        "name": "Rhineland, 25 dec 1944 - Close Air Support",

        "map": "Rhineland",

        "front": "The Meuse",

        "scenario": ["close air support", "close air support"],

  "plane_set": "custom_planeset.json",

        "target": ["random", "random"],

        "target_amount": 4,

        "weather": "thunderclouds",

        "time": "random"},

   "26.12.1944": {

        "name": "Rhineland, 26 dec 1944 - Special Delivery",

        "map": "Rhineland",

        "front": "The Meuse",

        "scenario": ["airborne attack", "airborne attack"],

  "plane_set": "custom_planeset.json",

        "target": ["drop zone", "drop zone"],

        "target_amount": 3,

        "weather": "low cloud cover",

        "time": "random"}

}


The mission date is also the key for each entry so for now it is not possible to have multiple missions with the same date.

The mission name is used the same as in EMG (both filename and in-game mission name). If name is empty ("name": "") a name will be generated based on entries in dictionary.json

The map, front, scenario, target, target_amount, weather and time all have the same possible values as in EMG. This also means scenario, target, weather and time can have the value "random". Make sure there are no spelling mistakes or the program will fail!

Note that for scenario and target two values have to be entered, the first applies to the Allied faction and the Second to the Axis

NEW: In "plane_set" you can define the filename of the custom plane set you have created. This means you can use very specific plane types for that particular mission.  Be aware that:

1) Will only work if historical  in the server_config.json is set to "False"

2) By limiting the number of plane types you can accidently crash the generator if it can't find a suitable plane type for a given mission scenario. Example: If you delete transports from the plane set, then make sure no transport scenarios are being generated!

Use

If the configuration file and (optionally) the mission rotation file has been defined simply run ServerGenerator.exe and it will churn away, generating missions and creating all necessary files. This can take quite some time, depending on map size and number of missions. 

After the files have been created the program will alter the Dserver config file as defined by mission_prefix and game_type. It will change the following values, so all the other values can be changed at will:


It's now possible to start Dserver.exe!


It is also possible to use a different server configuration file by providing the file name as input argument as follows:

ServerGenerator.exe server_config_monday.json


This way, you can create different missions, using different mission rotation files depending on the day in the week for instance

 ServerGenerator.exe will write to the same mission_generator.log file, so look there if you run into problems.


Automating your server


Monitoring SPS

Community member Coconut has created a niftly little program that constantly measures SPS and when it falls below a threshold it will send a signal to the server using MCU_TR_ServerInput. EMG ServerGenerator is compatible with this tool: The missions generated will listen to the signals and based on the number of times the SPS drops below the threshold it will deactivate AI units as follows:

We have used this quite effectively with our server. It eliminates the dreaded "Erratic behavior detected..." message. By the time SPS drops significantly there are usually enough players that AI planes are not needed anymore.

Look here for download and instructions: https://forum.il2sturmovik.com/topic/20739-release-tools-for-overload-management/#comment-327229

SRS

Check this link on how to use SRS, a great voice comms application that integrates with the server by Ciribob for IL2: https://forum.il2sturmovik.com/topic/63326-installation-and-usage-of-srs-for-il-2-voice-comms-app/#comment-968960

EMG Radio Messages

I have created a small program that generates server voice messages based on certain events in the generated missions such as radar detection and when a target is under attack. Contact me if you would like to use this as well. I will not document the use of the tool as it is a very specific implementation.

IL2 Stats

Awesome stat parser and website for your server by =FB=Vaal and =FB=Isay: https://forum.il2sturmovik.com/topic/19083-il2-stats-statistics-system-for-a-dedicated-server-il2-battle-of-stalingrad/