Alternative History

The Domesday Game is not like your typical map game. We strive for a revived level of realism and a commitment to immersing you in all of the intrigue, warfare, and excitement of 1066 and onwards. For this reason, we have made a few important changes to the traditional map game structure.

Basic Rules

  • Gameplay: Turns will be one-year long, with each turn being posted roughly 48 hours after the previous.
  • Be plausible. For something to be plausible, it simply means that there was a possible chance that the events described could have happened in the real world. This is the first rule, because implausibility can ruin the game for your neighbors, your successor in your nation, and lead to large arguments. You are not constrained entirely by OTL events, that’s why we play this map-game. But you are constrained by OTL reasoning and logic of the era in which we play.
  • Don’t metagame. Metagaming is using outside information to gain an advantage in-game. This could include taking preventive actions to overcome a prospective mod event that has been hinted at, but it also includes using friends in an implausible manner. Sockpuppeting (using multiple accounts) and meatpuppeting (using friends as a workaround to the sockpuppeting ban) are strictly prohibited.
  • Do research. There are bounteous resources available for you to do some preliminary research into your OTL-equivalent nation. What were its strengths? Its weaknesses? How did its troops fight, and how was the court structured? These are all important features that should come into play in your turns and you should use your research to ensure plausibility in your nation.
  • Don’t mix OOC and IG. In other words, don’t let issues spill-over. We all do this for entertainment, including the mods and your fellow players. If you are excessively rude or inappropriate, you will face punishments. And please, keep the inevitable arguing in the proper channels on Discord or on talk pages.
  • Don’t nation-hop. Once you pick a nation, stick with it. There have been instances in the past where nation-hopping has been abused, and it makes the game less enjoyable. If you want to change nations, you can apply to change nations on the main talk page, where you will need a majority of the mods to approve. This will be granted on the basis of a plausible record and what you leave behind.
  • Respect mod rulings. Yes, we know that you’ve likely done more research on your nation than any of the mods. Recognizing that, we still need to have some semblance of uniform and fair application of the rules. Mods will follow the Moderator Rules and treat each case with respect, but do not go complaining about negative mod events or begging for positive ones. We will monitor them.
  • Exploiting the rules and abuse: Don't abuse the game/rules to your advantage (ie requesting multiple assassination attempts in the same year to better your chances of getting a winning score). If you are caught, then you are banned.
  • Behaviour: If you're behaviour becomes a talking point of controversy, and is brought up by at least 3 players, the evidence of the behaviour will be reviewed and a punishment granted based on such. Given that most of these cases are circumstantial, punishment will be circumstantial as well. While there is no formal punishment for committing bad behaviour, to be rude is to discourage gameplay and therefore could likely result in the player being banned.
  • Additional notes: The final note is about vassals, tributaries, personal unions, and dynastic unions. Briefly, a vassal is a subject nation with a distinct ruler that owes fealty to the main nation. Vassals may not be controlled by the main nation’s player. A tributary is a nation that owes payment of tribute (hence the name) to the main nation, but also is not controllable. Both vassals and tributaries may revolt if it seems they might have a shot at independence, and if they aren’t given sufficient reason to remain within their current arrangement. A personal union occurs when two nations have the same ruler, but different governments. This arrangement, when the personal union nation is an NPC, can be played by the main nation. A dynastic union is when the same royal family rules in two nations; these two nations are not able to be controlled by the same person.

Algorithm documentation

This war algorithm for this map game is part of the ongoing effort to revolutionize the way map game wars are processed, working towards an optimization of efficiency and accuracy. This revolution began as the MdM War Algo in a previous map game, and this documentation represents the fourth installation of that effort. The basic philosophy of this model is full automation, where all the complex mathematics and simulations are conducted by a Java-based computer program, and outputs a result in Wiki formatted text. All the players have to worry about is writing the details of their strategy and tactics, and all the mods have to worry about is punching that strategy and tactics into the GUI.

In this phase, all the previous inputs that lasted throughout MdM's run are completely dispensed with, and replaced with entirely new inputs. These new inputs will ultimately factor in every single possible factor that could be construed as contributing to the war in one way or another. In addition, these inputs will be flexible enough to account for warfare in every possible time period, or even an asymmetric battle between two different civilizations. After all, whether you are fighting in the Bronze Age or the late 19th century, you will always run into situations of Hunter-Gatherers fighting some more advanced culture, or some mixture in between. 20th century warfare, however, are not included in this algo, including either air-force or nuclear weapons.

After introducing all these new inputs, the world is open to factor in a variety of new mechanics that were previously untenable. In this documentation, these new mechanics include diseases, supply lines, tactical maneuvers, customizable units, affect of battles on overall stability, and so much more!

The old system was plagued with annoying checkboxes required from the user: whether or not it is a naval algo, whether it is a siege, etc. These checkboxes are a thing of the past. Instead, this algo intelligently evaluates from context to decide whether to treat the situation as a siege, a naval invasion, or some mixture of different tactics. Other changes were made to the GUI itself, to make it as easy as possible to switch out or adjust different parameters as needed. Rather than being hard-coded, these parameters were moved to external JSON files, and logged in real-time in a separate text document.


Although quite a lot of this algorithm is overhauled from the previous installment, several basic components will remain the same:

  • Inputs are stored in an online database, categorized as "Nation", "Military", "Location" and "Leader"
  • This database is managed by the mods and is updated upon request from the players
  • The strategy is arranged as objects on a 2-D plane representing Flanks
  • Movement and attack of these flanks are updated on a loop
  • Casualties are calculated by a series of variables which are mapped to the input
  • New stability and occupation score are calculated as a result of the battle
  • Output is displayed as Wiki code on a receipt

The player's post by itself is sufficient to request a war algo, flagged with the word (Algo request) in bold. However, any additional details or considerations that the player adds to their request can only benefit them, and will have an affect on the war one way or another. Some of these kind of considerations may include:

  • Level of technology or organization of the nation (including writing, agriculture, medical technology, bureaucracy)
  • Types of units army composition (cavalry, cannons, ships, types of weapons)
  • Use of location or terrain (climate, high ground, coastal invasion, attacking the capital)
  • Tactics or strategy (arrangement of troops, specific compositions, special maneuvers)
  • Health or logistics (germ warfare, sieging, supply lines, staple diet)
  • etc.

Special customization of units or leaders are discussed in their appropriate sections. Submitting a custom terrain map is discussed in the last section.

On the other hand, if any or all of these things are too complicated, simply saying "send X troops to Y location" is also valid.

On the part of the mod, the order of operation should be fairly familiar from the previous version: ensure that the Input Database is up to date, then launch the application and select the appropriate combination of nations, militaries, and location, as well as information on the war's date and overall motive. On the Strategy tab, select the appropriate terrain map and arrange the flanks as needed. You can edit the composition of a flank by double-clicking on it. The outputted Wiki text is a summary of the result, but further details can be found in the generated log file, as well as updated on the Strategy tab. More detailed instructions on this can be found in the last section.

The general algorithm for processing the simulation is very similar to previous versions. Inputs are pulled from the database and are mapped to variables, as discussed in the next section. For details how to enter fields in the database, and how to handle required or optional fields, see the Input Database part of the last section. For the special calculation done to account for the "Local population" input, see the Attrition section. For details how the terrain map is read in as input, see the Terrain Map part of the last section. Each loop of the algorithm then represents one hour of a battle, assuming 12 hours per day. For details how the flanks approach and attack each other, see the Flank Mechanic section. Once all flanks for one side have been routed, the other side automatically wins, and the battle is over. For how occupation and stability scores are then calculated, see their appropriate sections. For details how output is interpreted from the battle, see the Output discussion in the last section.

Inputs overview

The new input database is divided into four sections: Nations, Militaries, Locations, and Leaders. Due to the complete overhaul of the database, it has been moved to a new URL entirely. A link to the new Map Game Database can be found here. Note that its title is changed from "War Score Database" to "Map Game Database". While this database is primarily used for the pre-war scores used in the war algo, it can also serve as a basic fact sheet for all nations and players across the Map Game. The most basic and useful information about each nation is listed at the front: name, ideology, ethnicity, religion, etc. However, while this basic information is very useful as a quick factsheet, they play very little role in the actual outcome of the war.

Most entries in the database have a corresponding default value that is hard-coded into the algo. As a result, they may be left blank whenever it is unknown or unimportant. Certain values for each tab are required, however, as will be indicated in their section. Note that there are no longer any separate tabs for "Navy" or "Sea Location". As mentioned earlier, the algo automatically decides from context whether or not to treat the battle as naval. Thus, as discussed in the military section below, both navies and armies are listed in the same tab, as well as amphibious units that use both.

For mods: if needed, you may add extra information on extra columns to the far right. Do not change the order of the columns or insert anything between columns, and please do not merge any cells. Error messages should gracefully inform the user whether the selected entries are invalid, and where the problem lies.

Each input value usually comes in three flavors: continuous value, ordered list, and unordered list. A continuous value is self explanatory. An ordered list is a hierarchy of values, where some values are better desired than others. However, note that even though an ordered list is always strictly increasing, they do not always have the same exact number. In the software invisible to the user, the same input value can be translated as different numbers in different situations. An unordered list does not imply any strict hierarchy, and can be listed in any order. For these inputs, whether or not there is a bonus depends entirely on context, usually in combination with another unordered list. For example, a Theocracy may be very beneficial for the Stability of a Muslim or Christian state, but very detrimental for a Secular or Atheist state.

The only input that is not read from the database is the motive, which is selected on the GUI itself. The motive represents the overarching reason for the war, which applies symmetrically to both sides. The motive by itself does not comprehensively describe the casus belli, but rather sets the tone for the war's paradigm. Working as an unordered list, the possible values for the motive can be:

  • Conquest - Functionally default, the act of one nation trying to assert direct control over another
  • Ideological - The war is driven by the National Ideology, whether that is religious, political, ethnic, etc.
  • Economic - The war seeks to assert some economic influence or financial dispute
  • Hegemony - The belligerents find themselves at war due to supporting mutual allies, but otherwise have no vendetta
  • Existential - Both sides claim a defensive motive, feeling as war will inevitably lead to mutual destruction. It is very rare, and gives the largest bonus

While the motive is symmetric to both sides, the National Ideology is relative to the belligerent. Thus, the combination of Motive with Ideology represents the proper casus belli for that specific nation. Combinations of motive with Ideology, Religion, Ethnicity, and Federal Government all result in minor bonuses to overall morale. Otherwise, motive has no other function in the algo itself.


The nation tab lists all the information relevant to the war that is associated with belligerents involved. In this phase, there are still only two belligerents allowed (one attacker and one defender). Thus, coalitions or alliances must either be listed under the leading nation, or added as a temporary new entry. Mods should keep the stability scores updated, especially for nations that go to war frequently. As stated above, this tab can be used as a quick reference on basic stats for individual nations, regardless of whether it is at war or not. Because of this, all information should be kept up to date as much as possible, at the very minimum once per algo.

Although the Nation tab has the most inputs, the majority of these are only used for determining the occupation score, stability loss, or very minor bonuses or penalties during the battle. The table summarizing the new inputs are shown here:

Name Type Range of values Default value or required Significance
Population Continuous value 1-8 billion Required Moderate
Ideology Unordered list Religious, Ethnic, Statist, Ethno-Nationalist, Ideological, Dynastic, Status Quo Statist Minor
Religion Unordered list Christianity, Islam, Buddhism, Abrahamic, Monotheism, Henotheism, Ethnic Traditional, Animist, Secular, Atheism, New Age, Sinic, Indic Christianity Minor
Ethnicity Unordered list Caucasian, Indo-Iranian, Sino-Tibetan, Niger-Congo, Hamito-Semetic, Austronesian, Dravidian, Turko-Mongolic, Japanese, Austro-Asiatic, Kai-Dai, Korean, Amerindian Caucasian Minor
Leader Complex Value See Leaders tab none Moderate
Federal Government Unordered list Feudal, Theocracy, Proletariat, Tribal, Republic, Monarchy, Dictatorship, Imperial, Governor Tribal Major/Minor
State Government Unordered list Unitary, Meritocracy, Nomadic, Republic, Feudal, Plutocracy Nomadic Major/Minor
Year Founded Continuous value -3500 - 2020 Required Major (Stability only)
Year Crisis Continuous value -3500 - 2020 Required Moderate
Capital Complex Object See Location tab none Moderate
Civilization Type Ordered list Hunter-Gatherer, Proto-Urban, Nomadic, Bronze Age, Iron Age, Medieval, Early Modern, Industrial, Post-Industrial Hunter-Gatherer Major (Occupation only)
Diet Complex Object Wheat, Rice, Corn, Sorghum, Sugar, Potatoes, Yams, Taro, none none Moderate
Arable land Continuous value 0-180 million 7000 Major
Age of Civilization Continuous value -10,000 - 1980 -2000 Major (Occupation only)
Domesticated animals Ordered list Herd animals, Hunting animals, Small animals, Rodents, none none Moderate
Endemic disease Complex object Smallpox, Plague, Influenza, Malaria, Tuberculosis, Cholera, none none Major
Medicine Ordered list Vaccinated, Germ Theory, Modern Medicine, Classical Medicine, none none Major
Writing Ordered list Internet, Wireless, Telegraph, Moveable Type, Block Printing, Paper, Alphabet, Hieroglyphs, Basic Glyphs, none none Major (Occupation only)
Trade Ordered list Owns entire trade route, Lucrative (buying), Lucrative (selling), Minor, War along route, Embargoed Minor Moderate
Revenue Ordered list High surplus, Mild surplus, Balanced, Deficit Balanced Major (Stability only)
GDP Continuous value 0-100 trillion 30 million Major (Economy only)
Urban population Continuous value 0-1 0.6 Moderate
Power consumption Continuous value 0-10 trillion 75 million Major (Occupation only)
Steel production Continuous value 0-1 billion 0 Moderate

Some specific notes for explaining each of these inputs:

  • Population - The total population of participating core nations. This is used for the occupation score, as well as a modifier for the maximum military size, which is used in stability loss and disease casualties.
  • Ideology - This represents the fundamental goal that the nation focuses on. For example, states in Medieval Europe heavily involved in the Crusades may have Religion as their ideology, while a mercantile republic or heavily capitalist nation may be Economic.
    • Religious - focus on religious motivation
    • Ideologic - focus on a secular ideology like Capitalism, Communism, Fascism, etc.
    • Dynastic - focus on one specific family, clan or tribe
    • Ethnic - preservation of ethnic-traditional language or values, applicable for native states or nomadic societies
    • Ethno-Nationalist - a modern, nationalist ideology advancing a modern-defined race or ethnicity
    • Statist - virtually default, the mere goal of preserving and advancing the state itself
    • Status quo - preservation of the current order, regardless of ideology or religion, even at the detriment of the state
  • Religion - The official religion of the state, or the de-facto religion that dominates society. Obviously, some religions on the list overlap, such as Christianity and Islam are both Abrahamic, as well as Monotheistic. In this case, choose the religion that best applies. This list was compiled based on religions that are used by a significant number of historical or althistorical nations, of which a lot if not the majority tend to be Christian, Muslim or Secular. Secular is chosen as religion for modern, multicultural states that no longer use religion as defining their identity. Atheism is chosen for nations like the Soviet Union or Republican France that outlaws all religions. Ethnic-Traditional is applicable for nations that have a formal, organized religious system for pagan polytheism, such as Greco-Roman religion, while animism is used for simpler religious beliefs of nomadic people, such as Amerindian beliefs or Tengri.
  • Ethnicity - The major ethno-linguistic that is shared by the majority of the population. This sampling is taken by the largest language families, with the addition of Amerindian for the Americas. Both religion and ethnicity only create bonuses in combination with other factors, with no actual hierarchy, and are minor bonuses or penalties. This is not to say that either quality has a direct affect on the war, but its used as a shorthand for the cultures that are historically often associated to certain climates, religions, or governments, which in OTL history remained mostly constant until the 20th century.
  • Leader - The national leader or monarch, selected from the Leader tab below. National leaders have bonuses to the algo just like military leaders do, but those bonuses are more limited to variables specifically related to the nation. A national leader cannot be killed during a battle. See the Leader tab for more details.
  • Federal Government - The general form of government used to organize the nation. This sampling is taken from the traditional list of forms of government organized by power source: Oligarchy, Democracy, and Autocracy. Of these, democracy is represented as Republic. Oligarchy is subdivided into four kinds: Feudal (oligarchy by nobility), Theocracy (oligarchy by clergy), Proletariat (oligarchy by a political party), and Tribal (oligarchy by clan leaders). Finally, autocracy is subdivided into three kinds: Monarchy, Imperial, and Dictatorship. The differences between these are proper legal titles, not informal titles, thus the historical Portuguese Empire would not count. Finally, Governor is added to accommodate players of colonial states. Combination of federal and state government is a major factor in stability, but any other affect from this input are minor bonuses only.
  • State Government - The organization of the nation outside of the federal government. This sampling was organized by asking the question "how did the state ministers obtain office?"
    • Unitary - "They were appointed" - use this for autocratic states or lacking any lower authority. Prone to instability.
    • Meritocracy - "They earned it"
    • Nomadic - "They were born into it" - clan-based or tribal politics
    • Republic - "They were elected"
    • Feudal - "They inherited it"
    • Plutocracy - "They bought it"
  • Founded Year - The year that the current government or dynasty was established. The age of the state is then used to acquire bonuses or penalties to Stability: 0-40 years (developing), 40-150 years (growth), 150-220 years (stagnation), 220-250 years (crisis), and beyond 250 years (depression). These are ranked from best to worst as: growth, stagnation, developing, depression, crisis. This is based on Turchin's Secular cycles of historical dynasties.
  • Crisis Year - The most recent existential conflict, essentially defining a period of cultural development along a single saeculum. The development within this saeculum then determines bonuses or penalties, which is also in the order of best to worst: 0-30 years (austerity), 30-60 years (awakening), 60-80 years (unraveling), and beyond 80 years (crisis). This is determined by the Strass-Howe Generation Cycle.
  • Capital Region - The Location object corresponding to the region of the nation's center of power. In this phase, this is only a factor in determining whether the capital was captured after losing a battle.
  • Civilization Type - The phase of socio-cultural and technological development for the nation as a whole. This is very important for occupation score, and some minor bonuses in other places.
    • Hunter-Gatherer - Tribal, non-permanent settlements at subsistence level, with no metallurgy. Also applies to Lithic Amerindians
    • Proto-Urban - Basic metallurgy and semi-permanent settlements, usually advanced Neolithic or Copper Age. Also applies to Formative Amerindians.
    • Nomadic - Advanced metallurgy and no permanent settlements, such as Eurasian steppe empires or Khanates.
    • Bronze Age - Advanced metallurgy and city-state organization, typically between 3500-1200 BC. Also includes Classical Mesoamericans and Peruvians.
    • Iron Age - Centralized nation-states and complex societies and economies, such as standard currency and religion, typically between 1200 BC-300 AD. Also includes Post-Classical Mesoamericans and Inca.
    • Medieval - Agrarian-based, typically feudal nation-states with steel production. Typically between 300-1500 AD.
    • Early Modern - Growing middle class from mercantilism, embracing early modern technology such as moveable type, mobile artillery and ocean-going ships. This is known in Europe as the "Renaissance" but also includes Ming China and Mughal India. Typically between 1500-1700 AD.
    • Industrial - The definition of an industrial society should be self-explanatory. Typically between 1700-1950 AD. By the 20th century, pretty much every civilization on earth is either Early Modern or Industrial.
    • Post-Industrial - While technically the contemporary era is still industrial, this extra category is added to distinguish the modern day from the 18th-19th centuries. This includes the Information Age and globalist, international societies.
  • Diet - The base staple crop that is grown to sustain agriculture, usually determined by geography. The sampling here is based on the staple crops from each of the earliest food-producing civilizations, alternating between grain or roots: wheat (Mesopotamia), rice (China), sorghum (West Africa), corn (Mesoamerica), potatoes (Peru), sugar (India), yams (Papua), and taro (Australia). These values of diet are not a single number, but an object containing multiple different values, which are used in combination to calculate Occupation and Economy scores. These values include:
    • Protein - Total calorie intake from a single cup
    • Population - Total yield output from one acre
    • Domestication - Rating 0-1 on ease of domestication, presuming wheat = 1
    • Diversity - Number of species, to rate its resistance to blight
    • Worth - General monetary value outside of food
  • Arable land - Total acres of land use for farming, which is applied to values from diet to come up with total value of agriculture.
  • Age of civilization - Year when crops were first domesticated, which is used as a coefficient against the domestication rate.
  • Domesticated animals - The level of development in domesticating animals for burden or food. Unlike diet, there is no good stratification that accounts for animals in different regions, as almost all the most common domesticated animals are indigenous to the Middle East. Rather, this value is captured as a general progression of domestication that can be applied to any region: rodents (like the Peruvian guinea pig, or the Papuan rats), small animals (like chickens, or dogs for food), hunting animals (for dogs, or cats), and herd animals (the advanced civilizations that use cows, sheep, horses etc.).
  • Endemic disease - The most endemic disease known to that region. This stratification chose some diseases known to have the highest R-constant, but also some that have historical significance. This becomes majorly significant for calculating casualties of diseases (see Attrition section for more information). Like diet, this is broken out into an object of multiple values, not one single value. These values are the following:
    • Outbreak: Probability of a random outbreak of the disease, which here was based on its prevalence worldwide
    • Reproduction: R-Constant
    • Deadliness: Mortality rate
    • Infectivity: Constant coefficient to adjust disease affects
    • Power: Affect the disease has on the Occupation score. Typically, this will be used to lower the score as the occupation becomes more difficult
  • Medicine - Level of technology that is relevant for medical science. This is used to offset the affects of disease on both the Occupation score and Attrition. These values are rather generic:
    • none - fully vulnerable, can create a "virgin soil" situation where the civilization is totally wiped out, such as Native Americans or Polynesians
    • Classical Medicine - Generic endemic diseases somewhat improves immunity, preventing a total collapse but still permitting pervasive disaster, such as the Black Death or Justinian Plague.
    • Modern Medicine - Natural immunity mostly prevents any widespread disaster, but devastating outbreaks are still prevalent, such as 17th century Bubonic Plague
    • Germ Theory - Primitive forms of vaccination or immunity theories partially immunizes the population.
    • Vaccinated - Contemporary medicine totally prevents any affects from diseases
  • Writing - Level of technology related to communication, mainly used as a general gauge of technological level next to Civilization Type.
    • Basic Glyphs - Primitive writing system that is an incomplete language or proto-language, or numerical only
    • Hieroglyphs - Fully complete language based on pictograms or ideograms. Typically from 3000-1000 BC
    • Alphabet - Phonetic, syllabic or tonal language based on a finite number of individual symbols. Typically from 1000 BC-1 AD
    • Paper - Knowledge spread by standardized paper or leather parchment. Typically from 1-1000 AD
    • Block Printing - Early form of printing press using pre-arranged words. Typically from 1000-1450 AD
    • Moveable Type - Fairly self-explanatory. Typically from 1450-1830 AD
    • Telegraph - Early electronic communication via wired transmission. Typically 1830-1900 AD
    • Wireless - Advanced electronic communication over radio, typically 1900-1990 AD
    • Internet - Fully digitalized communication in a global network, typically after 1990 AD
  • Trade - Level of foreign trade used to define the economy, which is used as a modifier against the GDP and Stability.
    • Owns entire trade route - Reserved for large-scale empires that monopolize an entire economic system like the Mongols
    • Lucrative (buying) - Mercantile systems without much resources of their own, but lucrative trade from buying and selling other resources
    • Lucrative (selling) - Rich in natural resources that are sold out to other nations, moreso than imports
    • Minor - Default value of trade without significant profit
    • War along route - Trade is temporarily disrupted by a recent conflict
    • Embargoed - The nation is forced into isolation by outside powers
  • Revenue - Current state of financial resources. A nation shouldn't be able to go on an offensive war while in debt.
  • GDP - Total GDP of the nation in US dollars. Used as the primary indicator of Economy.
  • Urban population - Proportion of total population that lives in cities or otherwise non-rural. The importance of this is derived from the Correlates of War.
  • Power consumption - Annual consumption of power measured in Kw*hr/year, as derived from the Correlates of War. This is converted into a measurement of civilization for the Occupation score based on the Kardashev Scale.
  • Steel production - Annual output of steel in tons / year, derived from the Correlates of War.


The Military tab lists the individual military units associated with each nation. The first column lists the nation associated with that military; however, if the military is available to multiple nations then it can specify by an ordered list, using any delimitation except a comma.

There are many different ways you can customize the composition of the entry. At the minimum, you must specify the name and size of the military, and doing this alone is completely valid. If you want the composition to be more specific, you can add up to three different unit types in the next few columns: one infantry, one cavalry, and one artillery. Each unit type has a fraction in the next column that indicates what proportion of the military is made up by that kind of unit. If no unit types are specified, then they are assumed to all be infantry. For information how to create a custom unit type, see the Unit section below.

In the Transport column, you may specify the type of ship that is associated with that military. As indicated below, ships are also treated as a custom unit type, which includes their own defenses, attacks, speed, and capacity. If you have a military entry with both ships and land units, then both types of units will be utilized at the same time as long as the military is on water, combining their firepower together where possible. This essentially acts as an amphibious unit, boarding their ships while at sea and then disembarking while on land. If you want to create a navy-only entry, then you can set all three unit types as zero. In this case, the size of the military represents the combined crew of the ships.

A table of variables in the military tab are shown below:

Name Type Range of values Default value or required Significance
Size Continuous value 1-15 million Required Major
Leader Complex object See Leader tab none Moderate
Infantry type Complex object See Unit section null (Soldier if all units are blank) Major
Infantry proportion Continuous value 0-1 0 (1 if all units are blank) Major
Cavalry type Complex object See Unit section null Major
Cavalry proportion Continuous value 0-1 0 Major
Artillery type Complex object See Unit section null Major
Artillery proportion Continuous value 0-1 0 Major
Transport Complex object See Unit section Barges Major (if applicable)
Ship number Continuous value 0-500 0 (but can vary) Major (if applicable)
Mobile defenses Ordered list Gabions, Trenches, Earthenworks, Wooden stakes, Cavalry ditch, none none Major (Defense only)
Budget Continuous value 0-1 trillion 1 million Moderate

Specific notes on each entry:

  • Size - Total personnel of the military. Please note that exaggerated military sizes can become detrimental towards Limitation, Stability, and Attrition
  • Leader - The military leader of this group. His stats provide direct bonuses towards a variety of values in the algo. See the leader tab for more information. Military leaders can be killed during the battle. If the military leader is the same as the national leader, and is killed in battle, it will take severe affect on stability (see Stability section).
  • Infantry type - Custom unit if needed. If no custom units are specified, then the entire military is assumed to be Soldier infantry with a proportion of 1.
  • Transport - Custom unit for naval transport. If no naval units are specified, the transport is assumed to be basic makeshift barges. This default is to ensure that an army placed on water is not instantly killed.
  • Ship number - The size of naval units involved. If this number is not specified, then it is calculated by dividing the total military by the ship capacity. The maximum number of ships is determined from the largest naval battles in history (not counting river battles), that are historically confirmed.
  • Mobile defenses - Basic defense systems that move with the military from one position to another. This is used for determining Defense only.
  • Budget - The total spending used for this military unit. Its significance is derived from the Correlates of War.


The location represents the place where the battle occurs. Its function works exactly as in the previous algo: each location can be reused as often as needed, and each represents a total of 10,000 sq km. Due to their large area, it is frequent that one location spans multiple nations, such as Ireland. There are no sea locations in this phase, but instead a location can be marked as oceanic climate or sea-based terrain. Naval battles can also take place in terrain maps that are partially land, such as coast, river, lake, or island.

The location doesn't have many parameters, but it contributes to the algo in multiple ways. First, it provides information that is used to gauge supply lines and carrying capacity, and consequently attrition. Secondly, it contains a terrain map that is used to define the layout of strategy information, as will be explained later. Thirdly, the location helps determine whether or not the capital has been captured, which affects stability. The Capital entry from the Nation tab is filtered from this list, for this purpose.

Inputs related to location are explained here:

Name Type Range of values Default value or required Significance
Local population Continuous value 0-200 million 0 (but can vary) Major
Climate Unordered list Ocean, Temperate, Tropical, Continental, Arid, Arctic Temperate Moderate
Terrain Complex object Plain, Hill, Hillcountry, Mountain Pass, Mountain, Sea, Normal Coast, Hard Coast, Normal River, Channel, River with Bridge, Island Plain Major
Urbanization Ordered list City (Modern), City (Pre-Modern), Rural, Nomadic, none none Major
Attrition Ordered list none, At Sea, Hostile Natives, Mountains, Jungle, Desert, Tundra, Radiation none Moderate
Fortifications Ordered list Bunker, Star Fort, Bastion Fort, Curtain Walls, Great Wall, Castle, Motte and Bailey, Palisade, Hillfort, none none Major (Defense only)
Road system Ordered list Highways, Locomotives, Railways, Modern roads, Waterways, Basic roads, none none Major (Occupation only)

Notes on specific entries are listed here:

  • Local population - The total population living in this specific region. This population is instrumental in determining the carrying capacity, and from there Attrition. This is because the number of people living in a region is typically an indicator of how much population the local resources can support. If the value is not specified, or if the given population is too small, then the value is determined based on the value of Climate. More detail on this calculation is found in the Attrition section.
  • Climate - The basic family of climate that this region belongs to, based on the Koppen Classification System. Despite some values are listed as "Tropical" or "Arctic", these are very generic labels that do not imply natural attrition in and of themselves. As a result, outside of determining the default local population, there are no significant penalties from climate in the algo.
  • Terrain - This specifies the default terrain map used for the algo, which can also be changed on the fly. As discussed in the Terrain map section, this map appears as a drawing visually, which is then read into the software as a 2D list of terrain features. Each coordinate on the map specifies a certain type of terrain feature, that has significant impact on the nature of the battle and bonuses to Efficiency and Limitation. These types of terrain features are:
    • Plain - Default value, with no significant feature. Examples include desert, plains, savannah, and plateaus. Shown as white
    • Water - Forces units to move in naval units (see the end of Flank Mechanics). Examples include ocean, seas, rivers, or lakes. Shown as blue
    • Forest - Can apply to woodlands, forests, or jungles. Shown as green
    • Cliffs - Represents a steep edge that is difficult to traverse or climb. Could either apply to the edge of a steep coast or the side of a mountain. Shown as grey
    • High ground - Represents a traversable raised area like a hill, island, or coast. This could either be a benefit or detriment depending on the situation. Shown as brown.
  • Urbanization - How densely populated the region is, which has a major affect on the limitation and carrying capacity.
    • City (Modern) - An industrial inhabitated region, or more technology.
    • City (Pre-Modern) - A pre-industrial inhabited region, but still urbanized
    • Rural - Farmlands or villages
    • Nomadic - The only indigenous population do not live in cities
    • none - Uninhabited
  • Attrition - Where applicable, this specifies the type of natural disasters that could cause casualties to be felt outside of combat. This is mainly used as the constant of proportionality whenever attrition is being applied, but is also used in other areas as well. As stated earlier, the mere presence of a tropical climate does not automatically require a jungle attrition, nor does an artic climate automatically require a tundra attrition; the Attrition input should be very specific. Use Hostile natives whenever there is a rogue faction that isn't on either side, but could fight both attacker or defender indiscriminately. This can be applied to either guerrilla warfare, agitated tribes, rogue mercenaries, or discontent civilians. Radiation is meant for the fallout of nuclear weapons, which are not implemented in this phase.
  • Fortifications - The kind of fixed defense systems used by the defender of this region. Rather than specifying exactly where on the map this fortification is located, it is just assumed that the defender is able to utilize the defenses in every situation, adding to their Defense score. It is also used for the Occupation score of the defender, but not the attacker. Note that "Great Wall" applies to the Chinese Wall style of forts, but can also be applied for similar fortifications or the Great Wall of China itself. Bunkers, the highest defense system, is used by contemporary military such as Cheyenne Mountain. Fortifications can be changed or removed by whoever occupies the region.
  • Road System - Basic transportation system native to the region, which can be utilized by the attacker to facilitate supply lines and transport. This can be used for the occupation score of the attacker, but not defender.
    • Highways - Contemporary asphalt automobile highways
    • Locomotives - Steam or electric powered rail transport
    • Railways - Rail systems that are not self-powered
    • Modern roads - Sophisticated urbanized road systems typically seen from the Renaissance onward
    • Waterways - Rivers or canal systems which make conventional roads unnecessary
    • Basic roads - Road systems of antiquity through the Middle Ages
    • none - No road system or any similar technology


A leader is a single individual who contributes to the success of a war by virtue of his personal skills or abilities. The exact process of creating and evaluating leaders is virtually unchanged from the previous version. Each leader is associated with a nation in the database. In order to add multiple nations for the same leader, list the nations in the same column with any delamination except a comma.

Each leader has a specific birth year and a set of seven skills, each of which is rated from 0-10 just like in the previous version. If no birth year is given, or is entered incorrectly, then the leader is assumed to be 30 years old by default. One skill is typically rated very high as his "most impressive trait", and all other skills are then set to random numbers.

In order to request a new leader, you must send the following information to a mod: Name, nation, age, and most impressive trait.

Each side is allowed up to two leaders per algo: one as the national leader, and the other as the military leader. Both of these leaders can be the same person, but this runs a risk of Stability loss if the leader gets killed. The exact values that are given bonuses from the leader's stats have been heavily revised from the previous version, as given in the list below. Note that a military leader has more of an impact on the battle's result, while the national leader only has affects on the nation itself.

Leader stat Bonus from military leader Bonus from national leader
Attack Effectiveness [* (attack + 1)] Occupation [* (attack + 0.1) * 10]
Defense Defense [+ defense/10] none
Siege Added to siege rate (See Attrition section) none
Authority Capacity [+ authority/10] Innate stability [+ authority/10]
Cunning Limitation [+ cunning/10] Economy [+ cunning/10]
Zeal Morale bonus [+ (zeal+1)/10] none
Martial Efficiency [+ martial/10] none

The algorithm for determining if the leader survived the battle is very similar to the previous version. The main difference is that the value of "battle score" is replaced with the weighted average of the unit's training values.

P = (Random[0-10] - Martial*10 + Training/2 + Leader Age/10)/100 + (Final military size / Original military size)

And then check if a random number between 0-1 is above or below P. In this way, the survival of the leader depends on his personal abilities, his age, the average skills of the units near him, and the proportion of casualties.


A unit type is a data type that is unique to this phase of the algorithm. A unit type represents a single soldier on the battlefield, and is associated with a set of characteristics that uniquely defines it. These characteristics are used as the backbone of the battle, defining how much the military is able to attack, defend, and maneuver. This same set of characteristics can be applied to any type of military in play, regardless whether they are an infantry, cavalry, artillery, or even a ship. Due to this flexibility, some units can be freely moved between being treated as infantry or cavalry, etc., where necessary.

After all, a ship can still be defined in the same terminology as any other unit. They have a kind of defense or shielding, a kind of short, medium, and long range weapons (where applicable), a kind of speed, etc. The only difference is that a ship has an extra parameter for capacity, indicating the maximum crew that the ship can support. This capacity becomes important in terms of attrition and gauging the size or weight class the ship represents.

In the spirit of giving the algo flexibility to represent any time period, the four types of units can be loosely interpreted given the situation. To one degree or another, some version of each unit type can be found in most time periods from antiquity until the 20th century. For example:

  • Historical infantry: Braves, Jaguars, Hoplites, Janissaries, Regulars, Waffen-SS (etc.)
  • Historical cavalry: Chariots, Knights, Sipahi, Hussars, modern cavalry, tanks (etc.)
  • Historical artillery: Catapults, Ballista, Elephants, Trebuchet, Hwacha, Falconet, Bombards, Mortars (etc.)
  • Historical ships: Barges, Canoes, Triremes, Galleys, Caravels, Treasure ships, Dreadnoughts, Submarines (etc.)

This phase does not have any way of representing airforce.

The unit type that is selected is then applied to whatever portion of your military is made up by that type. For example, if the military entry lists hussars as cavalry with proportion of 0.4, then the hussar unit type is applied to 40% of the total military. If no unit type is selected, then the default type used is Soldier.

The unit type is not represented in the online database. Instead, you must request a custom unit to be added to the database by submitting its list of characteristics to the mods. If you are on Discord, the Discord channel has a template form you can use to fill in the information. These values are also listed in the table below (Default values are pulled from the Soldier type):

Name Type Range of values Default value Significance
Speed Continuous value 1-500 3 Major
Rebound Continuous value 0-10 0 Major
Shock Continuous value 0-1 0 Major
Long Range Continuous value 0-500 0.1 Major
Medium Range Continuous value 0-500 0.1 Major
Short Range Continuous value 0-500 0.1 Major
Power Numeric list 0-10 (for each range) 0.5,0.5,0.5 Major
Psychology Continuous value 1-20 1 Major
Defense Continuous value 0-1 0 Major
Tactical Training Continuous value 0-10 5 Major
Logistics Ordered list Basic, Uses roads, Advanced caches, Foraging, Personally supplied Basic Major
Soldier type Ordered list Regular, Elite, Traditional Regular Major/Minor
Military type Unordered list Professional, Holy Order, Mercenary, Drafted, Tribal, Militia Militia Minor
Capacity Continuous value 0-10,000 0 Moderate

Notes related to each of these values:

  • Speed - The average speed of the unit in Km/hr. This speed represents how fast the unit moves in the battlefield, not its long-distance travel or speed of attack. Both speed and range are capped at 500 as this is already larger than the size of the battlefield. This speed is used literally for the movement of flanks, as discussed in the Flank Mechanics.
  • Rebound - The number of rounds needed to rest between attacks. This essentially represents the attack speed. For most pre-gunpowder weapons this will always be zero, except for siege equipment. Post gunpowder, this value can account for the speed of reloading arms and cannons, or volley tactics. There technically is no upper limit but out of convention is capped at 10.
  • Shock - The probability of deciding to charge in battle when applicable. This value is instrumental in deciding whether to attack an enemy immediately when he comes in range, or to move in closer and utilize more short-range weapons.
  • Range - The maximum effective distance for this weapon, in meters. Each military unit can have up to three weapons: one short range, one medium range, and one long range. In each attack, only one weapon will be used at a time, corresponding to that range. If you want to disable one weapon, set its corresponding power to zero. If a weapon is disabled, then its range is used as the minimum effective range for the next weapon higher up. For example, if a Falconet unit has a long and medium range weapon but no short range, then he is incapable of attacking the enemy at short range.
  • Power - The number of enemy units that each weapon is able to kill on average in one hit, assuming 100% accuracy. This is given as a list of three numbers instead of one, as each weapon likely has different capabilities, and the unit as a whole may be more effective at one range than another. This is used as the basic premise of the unit's ability to attack, as discussed in Flank Mechanics. As can be seen in the default value, decimals are permitted.
  • Psychology - This value represents the relative difference between the unit's physical verses psychological damage to the enemy. This is instrumental in determining the affect of morale depletion during each attack. For example, say psychology is set to 2. Thus, for every enemy unit that is killed in an attack, another enemy unit is demoralized in the same attack, but not killed. If psychology is 3, then two enemy units are demoralized each attack for every one killed, etc.
  • Defense - Percentage of enemy attack that is repelled by personal defenses, such as shields, armor, Kevlar, etc. For example, if defense is 0.1, then 10% of all enemy attacks do no damage.
  • Tactical Training - This rating from 0-10 gives a general score for the unit's overall combat capability, based on concepts like professionalism, discipline, and accuracy. A five represents an average score, and values above or below 5 indicate being above or below average. This is instrumental for their Efficiency value.
  • Logistics - The mechanism used for supply lines by this unit, used for determining carrying capacity for attrition, as well as how easily their supply lines can be severed. Its effectiveness depends on the combination between logistics and urbanization. As discussed in the Attrition section, each logistic type has a value of "Resilience" that measures how difficult it is to cut their supply lines.
    • Basic - constantly requires direct contact with a major city or fort
    • Uses roads - takes advantage of advanced road networks for more modern supply trains
    • Advanced caches - weapons and supply caches are strategically organized beforehand
    • Foraging - soldiers supply themselves extracting resources from the surrounding area
    • Personally supplied - every individual soldier manages their own rations
  • Soldier type - The generic archetype that this soldier represents. This gives a significant bonus to Efficiency, but otherwise has minor affects only.
    • Regular - Ordinary foot soldier, considered generic relative to his society
    • Elite - The most highly-paid special forces of this military, considered very exceptional for his society. Their training and abilities have made an impact on history
    • Traditional - A noble warrior class of society, where soldiers begin their training from an early age.
  • Military type - The overall organization style the unit is drawn from. This only has bonuses relative to combinations with other values.
    • Professional - Voluntary military service as a professional career
    • Mercenary - Career military, but in service of private companies than a nation. Going over maximum military size does not automatically constitute mercenaries.
    • Militia - Voluntary military service, but temporarily adopted rather than a professional career. Essentially applies to peasant levies.
    • Holy Order - Military service as a religious obligation
    • Tribal - Military service by loyalty to a dominate clan or family, which are allied or vassalized to the nation
    • Drafted - Involuntary military service, typically only seen in industrial societies, but can also apply to slave armies
  • Capacity - The total number of soldiers that can be carried in one ship, only applicable for naval units. This is used to determine carrying capacity while at sea, as well as a general gauge of how large or significant the ship should be.

Mapping inputs to outputs

Having processed all the inputs from the database, the next step is to translate these inputs into intermediate variables that defines the state of the simulation. These intermediate variables are similar to those from the previous version, but quite a bit has been moved around. These intermediate variables are listed as follows (hyphenated inputs represent a combination of two ordered or unordered lists):

Name Range Dependent on Description
Occupation Base Unlimited, logarithmic Population, Urban population, Power consumption, Age of civilization, Arable land, Diet, Civilization type, Domesticated animals, Writing technology, Medicine, Fortifications, Road system Base value for Occupation score
Innate Stability 0-1 Revenue, Trade, Year Founded, Year Crisis, Federal Gov-State Gov, Federal Gov-Civilization, State Gov-Civilization, Federal Gov-Religion, Federal Gov-Ethnicity, State Gov-Religion, State Gov-Ethnicity Major modifier in Stability
Economy 0-1 GDP, Trade, Urban Population, Diet, Arable Land, Domesticated Animals, Year Crisis State of economy during the war
Efficiency 0-1 Tactical Training, Budget, Soldier Type, Steel Production, Power, Attrition, Military Type-Soldier Type, Federal Gov-Military Type, Military Type-Religion, Military Type-Ethnicity Rate of attacks that succeed their maximum power
Limitation 0-1 Tactical Training, Budget, GDP, Urbanization, Military Type-Religion, Military Type-Ethnicity, Climate-Religion, Climate-Ethnicity Fraction of military that are able to organize an attack
Defense 0-1 Defense, Tactical Training, Mobile Defenses, Fortifications Fraction of enemy attacks that fail to do damage
Effectiveness Unlimited, linear Shock, Soldier Type Additional bonus to the unit's power
Carrying Capacity 0-1 Attrition, Fortifications, Road System, Urbanization-Logistics, Climate-Religion, Climate-Ethnicity Maximum military sustainable at this location as a ratio of native population
Morale Bonus 0-2 Attrition, Motive-Ideology, Federal Gov-Motive, Federal Gov-Ideology, Motive-Religion, Motive-Ethnicity, Ideology-Religion, Ideology-Ethnicity, Federal Gov-Religion, Federal Gov-Ethnicity Multiplier against the base morale of the military
Siege Rate 0-1 Power, Attrition Rate at which carrying capacity decreases during a siege

As stated previously, input values generally come in three flavors, either as continuous values, ordered lists, or unordered lists. Values from ordered and unordered lists are read from external JSON files that are located in the JSON directory of the algo software, where unordered lists are stored as a list of lists. Because these JSON files are not hard-coded, then they can be easily modified if any parameter requires some kind of tweaking.

Several of these intermediate variables are calculated by a weighted average of the inputs. The weights of this average are determined based on whether the input is a major, moderate, or minor contribution to the end result. This weighted average is not always applied linearly, however, but sometimes will have special calculations that combine multiple inputs together.

While this information is being processed, a log file is generated in real-time that records all the inputs that contribute to each variable, to allow for curating of the data after the fact. Because the log is generated in real-time, then a log file will still exist even if the algo crashes.

A sub-list of variables are given below which summarizes the contribution of each input to the end result, noting special calculations where relevant:

Name Major inputs Moderate inputs Minor inputs
Innate Stability Revenue, Federal Gov-State Gov Trade, Year Founded, Year Crisis Federal Gov-Civ, State Gov-Civ, Federal Gov-Religion, Federal Gov-Ethnicity, State Gov-Religion, State Gov-Ethnicity
Economy log(GDP*Trade/Urban*Pop)/6 log(Arable Land*Diet Yield*Diet Worth)/7, log(Animals*Arable Land)/7 Year Crisis
Efficiency Tactical Training/10, Attrition Steel Prod/(Military Size*Soldier Type*Power*10), Budget/(Military Size*Soldier Type*1000), Military Type-Soldier Type, Federal Gov-Military Type Military Type-Religion, Military Type-Ethnicity
Limitation sqrt(Tactical Training/10), Urbanization Budget*2.5/GDP Military Type-Religion, Military Type-Ethnicity, Climate-Religion, Climate-Ethnicity
Defense Mobile Defenses, Fortifications Defense, Tactical Training/10 none
Carrying Capacity Attrition, Fortifications, Road System, Urbanization-Logistics none Climate-Religion, Climate-Ethnicity
Morale Bonus Attrition none Motive-Ideology, Federal Gov-Motive, Federal Gov-Ideology, Motive-Religion, Motive-Ethnicity, Ideology-Religion, Ideology-Ethnicity, Federal Gov-Religion, Federal Gov-Ethnicity

For the Occupation Base, the inputs are multiplied together instead of a weighted average. This also comes with a number of special calculations, as given below:



Urban Population^(1/log(8))*10

log((Power Consumption/8760)+1)

log(Arable land*Diet Protein*Diet Yield/Urban*Population)*2

log(Diet Yield*Diet Protein*(1-1/Diet Diversity)*Diet Domestication*(Age/3700))

In spite of total population being so prominent in a nation's basic statistics, it's direct contribution to the final calculation is found here only: proportional to the cubed root. The calculation for Power Consumption comes from the Kardashev Scale, converting from Watts to Joules.

Effectiveness is calculated simply as (1+Shock)*Soldier Type

Siege Rate is simply calculated as Artillery Power+Attrition. Note that it only applies if there is some artillery unit type.

With all the inputs and intermediate variables combined, the final output values can be determined through the simulation. A final table mapping inputs to the output values is shown below:

Name Range Dependent on Description
Occupation Unlimited, linear Occupation Base, Efficiency, Limitation, Diseases Value of power the winning belligerent has over the loser
Stability 0-200 Economy, Innate Stability, Capital Region, National Leader, Military Maximum General health of the nation's integrity
Military Casualties Unlimited, linear Limitation, Effectiveness, Efficiency, Defense, Terrain Total personnel that are killed in action or captured
Attrition Unlimited, logistic Carrying Capacity, Diseases, Siege Rate, Attrition, Climate, Local Population, Maneuvers, Resilience Total personnel that die by natural causes

Further details how each of these values are calculated are discussed in their respective sections.

Flank Mechanics

Just as in the previous version, the military is distributed across multiple autonomous agents, called Flanks. By default, there are three flanks per side of any algo: left, center, and right flank. Also by default, the flanks will move towards enemy flanks at all times, and attack once they are in range. The original starting positions of the flanks, arranged on a 2D space, represents the overall strategy being used by each side.

However, there are many fundamental changes to the flank system that enrich this strategy component of the simulation. The exact size and composition of each flank can be customized, allowing different flanks on the same side to have different sizes and different sets of unit types (as an example, setting one flank as 1000 infantry plus 500 cavalry, while another flank is set to 12 cannons and 20 cavalry). Each flank can also be assigned a special maneuver, causing it to behave differently than the default. The terrain map also permits for unique strategies given the different terrain, including switching between land or sea battles, or a combination of the two.

When a flank is attacked, the algo is able to judge from context whether the troops were killed, or (more rarely) captured alive. Once an flank has been depleted of morale, it starts to retreat before it is routed completely. Once all flanks of one side have been routed, the battle is over. The generated log file keeps a record in real-time for each major action during the battle. For more information how the strategy tab is set up, see the last section.


By default, the total military of one side is evenly divided across the respective flanks. Each flank also inherits the military's unit types, proportions, transport and ship number. As discussed in the last section, the total size and proportions of the unit types within each flank can be changed at any point. Therefore, just like the overall military the flank has up to three different unit types: one infantry, one cavalry, and one artillery. While the unit types themselves cannot be changed at this point, you are able to set a proportion as low as zero if necessary. For example, you can set one flank to all infantry, and one to all cavalry, and one as a mixture of the two, but you can't change what kind of cavalry or what kind of infantry it is. If a unit type is not specified in the online database, then it is completely disabled in the strategy tab.

Just like in previous versions, every individual soldier starts with 20 morale at start, thus the total morale of the military is always 20 times Military Size. This is then multiplied against the value of Morale Bonus.

For navy, the ship number is evenly divided across the flanks, and inherits the ship unit type from the overall military. If you have more flanks than ships, then some of them may appear to be set to zero ships, due to rounding. If no transport is specified in the online database, then the ship type is set to basic barges, and is disabled from the GUI. This ensures that if the military runs into a body of water like a lake or river, and has no ship, they can still get across with some kind of transport.

All mechanics related to the flank system work out some harmony of these four unit types. The speed of a unit is equal to the speed of its slowest member, and the same is true for shock. The maximum range of a flank is taken from the unit type with the highest long range. Defense of a flank is taken from the unit with the highest defense. The resilience of supply lines is set to the resilience of the unit type with the most advanced logistics.

Whenever a flank attacks, or is deciding whether to attack, some units may be able to participate while others cannot, and these have to be tracked separately. Whenever a flank sustains casualties, the unit type proportions always remain the same, as it is assumed that any individual soldier is equally likely to get hit. While on water, values of speed and shock from the ship overrides all other units, and their defense and attack are added in.


The general algorithm for processing the simulation has been heavily systemized from the previous version. The main loop for processing the algo represents one hour per iteration. The basic pseudocode for the system is given below:

  • identify where the nearest enemy flank is
  • identify what type of terrain we are on
  • decide whether to move or attack:
    • if move, then move based on current maneuvers and health
    • if attack, then attack and update casualties and morale
  • check for additional casualties from attrition

A few important points to take note from this algorithm. First, that combat can be asymmetric, in that one flank may be be trying to move while being attacked at the same time. Second, note that attrition casualties might still apply even when not in combat. All other mechanics and parameters related to flanks are somehow encapsulated in these six actions.

First, the flank must decide whether or not to move. In this case, movement simply means any action that isn't attacking, which can include advancing, retreating, withdrawing, charging, or even holding position. Thus, at this stage it is not important exactly how we should move, all that matters is knowing whether it is appropriate to attack or not. If a flank is already routing, completely routed, or cannot find any enemy to attack, then it will decide to move unconditionally. As a result, all flanks are incapable of attacking anymore once they start to rout.

At this point, the flank decides whether to move based on how many units are able to attack. For each unit type, it checks whether the enemy is in range, and which weapon is appropriate at that range. Even if the enemy is in range, however, the unit type may still not be able to attack, due to needing time to reload or reposition (as determined by the Rebound input). Whether the enemy is in range also depends on the size of the enemy flank. If the flank is larger, then they are also a larger target. Thus, the enemy range is decreased by the square root of its size, accounting for the portion of the enemy flank that is closer than its center.

If no units are capable of attacking, then the flank will decide to move. If all units are able to attack, then the flank will decide to attack. However, there may be situations where some units are able to attack, but doing so would be disadvantageous. For example, if a small proportion of the military has a very long range, then it doesn't make sense to only attack the enemy when they are at maximum range, as most of the army is being unused. To handle this situation, the flank will use an RNG to decide whether to move when some of the units are able to attack, but others aren't. If it decides to move against the enemy despite some units being ready to attack, this is called charging. The probability of deciding to charge is calculated as (1-(units ready to attack/total size of flank))/2+shock. This value is then compared against a random number between 0-1, where a higher number will continue an attack, and a lower number will decide to charge.

Having determined to move, the next step is determining how the flank should move. First, the speed of the flank can be affected by terrain. Most forms of terrain will slow the flank down in some way, except being on higher ground which makes it go faster. Being on water depends on the speed of the ship. If the flank is routing, then it will attempt to get away from the enemy at half its normal speed. If it is fully routed, the flank will stop entirely.

The maneuver for the flank is most instrumental to decide how its movement should behave, and each flank can be set to any maneuver individually. Currently, there are five types of maneuvers possible:

  • Normal - Move in the direction of the enemy at normal speed, which is default for all flanks. Charging may apply.
  • Position - No movement (speed is set to zero). This may be used for defending a key strategic position such as a hill or pass. Charging does not apply.
  • Feigned Retreat - Move in the opposite direction of the enemy at normal speed. This may be used to lure enemy units in a specific direction, to allow other flanks to attack from a different direction. Charging does not apply.
  • Hit and run - Attack for only two rounds, then retreat for three rounds, then return to normal and repeat. As long as flanks are fast enough, this could be used to strike at the enemy in small doses without sustaining much losses. Charging only applies when not retreating.
  • Pillaging - Functionally the same as normal, but will use RNG to decide whether to attack or cut enemy supplies. More information found in Attacking and Attrition.

After processing the maneuver, the rest of movement depends on how close the enemy is. Because the main loop of the algo operates on an hourly basis, then the distance the flank moves is equal to its speed times one hour (for example, moving 3 km/hr will move the flank 3 km per round). However, sometimes this might not make sense if the enemy is already closer than this distance. In that case, the flank will move such that the enemy comes within optimal attacking range (if charging in this scenario, then instead move such that the enemy distance is halved). Otherwise, charging will double the current speed. Finally, movement may not land exactly in the same place each time, but has a random factor with a range of +/-10 meters.


Once we have decided to attack, the attack function is called to calculate the military casualties exacted from the enemy flank. Once again, this is tracked separately between different unit types, and casualties are calculated for each unit type separately before being totaled at the end. The algo calls the attack function from each unit type that reported as ready to fight in the previous section.

The first step in this attack function is to adjust efficiency and limitation values based on the terrain. Most forms of terrain have some penalty on both limitation and efficiency, as tactical situations like cliffs, forests or fording will naturally make both organizing and executing an attack more difficult. The only exception is higher ground, which makes both of these easier.

Just like in the previous version, only one portion of the available military will actually participate in this attack, known as a battalion. However, the exact calculation of this battalion has changed. The size of the battalion is proportional to the square root of the unit's size, because when a military is roughly arranged like a square then only one side of the square will actually see combat. According to Leicester's Equations for military power, this principle applies to almost all military conflicts prior to the World Wars. However, this principle is waved if the military size is less than 100, as at that point the square root is functionally meaningless. For militaries larger than 100, the formula calculating a battalion looks like this: battalion = sqrt(Military Size*Unit Proportion*Limitation) (assuming that limitation is already adjusted for terrain).

The final calculation of the casualties, after all the preparation, is then given by this equation:

Casualties = Battalion*Effectiveness*Power*Efficiency*Random Number*Mercy*(1-Enemy Defense)

Some notes on the values in this equation:

  • Power depends on which range is being used for this unit type
  • Efficiency is adjusted for terrain
  • The Random Number ranges from 0-5
  • Mercy is a value to ensure that the enemy isn't massacred while they are routing. It is typically assigned as 1, but if the enemy is routing then it is set to 0.1
  • Enemy Defense refers to the defense variable for the enemy flank

Depletion of morale is calculated by a very similar formula but slightly adjusted:

Casualties = Battalion*Effectiveness*Psychology*Power*(1+(flanking-1)/10)*Efficiency*Random Number*(1-Enemy Defense)

Some additional notes on this equation:

  • Psychology is a parameter of units as mentioned earlier
  • Flanking indicates the number of flanks that are attacking the same enemy. If multiple flanks are combining their attack, it takes additional damage to the enemy's morale
  • Mercy is not used in this equation

Just like in the previous version, the morale of a dead soldier is zero. Therefore, the morale depletion calculated above is in addition to loss of morale from every soldier killed. If morale of a flank is less than 30% of its original size, then they start to rout. Being in a routing state means they can no longer attack the enemy, and attempt to retreat. If a routing flank succeeds to reach the edge of the map without being fully routed, then they are considered routed automatically. Once a flank's morale is less than 10% its original size, then they drop out of the battle entirely.

Once a flank is fully routed, then it can no longer be attacked. Therefore, if a flank has multiple enemy flanks attacking in the same round, and they are fully routed part way through the round, then all other flanks forfeit their attack. Technically, a flank can never be "wiped out" in the sense that all their personnel are killed in the same round. If a flank is going to be wiped out by military casualties, then all remaining personnel is treated as "captured" instead of "killed in action". This is how captured troops are determined.

If maneuver is set to pillaging, then the flank will have a 50% chance of forfeiting their attack in order to cut the enemy flank's supply lines, which lasts for the rest of the battle. If all enemy flanks have their supply lines cut, then the belligerent as a whole takes a sever penalty to their carrying capacity. See the next section for more information.


Due to the fact every flank has a default infantry type (Soldier) and a default transport type (Barges), then it is equally possible for any flank to fight on either land or sea. However, if you want to arrange a battle specifically designed for land or sea, or some sort of amphibious operation, that is also possible as well. In either case, the algo is able to determine whether to treat the flank as either naval or land military based on whether or not the current terrain is water. An algo can be specifically designed as naval-focus by doing the following:

  • In Military tab of the online database:
    • Set the transport to whatever type of ship is being used
    • Set the ship number to the size of the navy
    • Set the size of the military to the ship capacity times the ship number
    • Leave all other unit types blank, unless you want to add additional artillery to the ship, which goes in the artillery column
  • In the Location tab of the online database:
    • Either set the climate to ocean, or set the terrain to some terrain map that includes a body of water (river, lake, island, or sea)
  • In the strategy tab of the GUI:
    • Set the initial position of the flanks on bodies of water (blue on the map)

When deciding whether to move, the ship type is added as a fourth unit, to check if the enemy is within range of their attack. Obviously, if the ship is a barge or similar transport, it has no weapons to speak of, and thus will always be treated as "out of range". When calculating the total number of units that are ready to attack, the size of the ship unit is given as the capacity times the ship number. Also, the value of shock is overwritten with the ship's shock.

When moving, the ship's speed is used as the speed of the flank. All other modifiers to movement due to charging, maneuvers, and routing still apply.

When attacking, the ship is added as a fourth unit type that has an opportunity to attack with their own weapons, if they have any. The battalion for the ship is calculated based on capacity and ship number, coming out as the following formula: Battalion = sqrt(Capacity*Ship Number*Limitation). Terrain basically does not apply while at sea, because water doesn't have any limitations that forests or cliffs do. This calculation of battalion applies the same to casualties and morale loss.

If a single round wipes out a flank by military casualties, then all ships in that flank are treated as "sunk". This is essentially the same mechanic that determines captured troops, except at sea it counts towards ships sunk instead of troops captured.


Attrition refers to casualties that are inflicted by natural forces outside of military activity. Attrition can come from a variety of different sources: diseases, starvation, hostile terrain, inhospitable climate, agitated local population, etc. Despite this, it is entirely possible for a military to not experience any casualties from attrition at all, as long as they practice basic precautions with sufficiently-advanced infrastructure. These kind of precautions include medicine, logistics, and limiting the size of active military. Attrition can be felt at any time during the battle, even when not in combat, but do not apply on a unit that is already fully routed. Given a bad enough situation, it is possible for a flank to be entirely wiped out by attrition, but this should be rare.

Attrition is calculated in two parts that are added together. The first part checks whether the total military size exceeds the carrying capacity of the location. This carrying capacity is calculated as a ratio of the local population, among other factors. Any military exceeding this capacity is susceptible to attrition, while military under that threshold is unaffected. Mechanics related to supply lines and siege warfare have an affect on reducing this carrying capacity, thus indirectly causing attrition to become more likely. Once attrition does take place, it is calculated from a logistic curve proportional to how severe attrition is for this location.

There is no simple checkbox to say that a battle is treated as a siege. Rather, the algo determines intelligently whether or not to treat it as a siege, which then activates its affects on carrying capacity.

The second part of attrition calculates deaths from diseases. The exact calculation of disease mortality is a very tricky process, and requires a careful balance from a variety of factors. The likelihood of a plague outbreak depends on exposure to the disease, size of the military, and the nation's infrastructure. The casualties from the disease, given an outbreak, depend on medical technology.

Carrying capacity

A carrying capacity is the maximum amount of troops that can be comfortably sustained in a given region. No matter how inhospitable a climate may be, as long as total military size does not exceed this number, it cannot experience any attrition besides diseases. Conventional wisdom before the First World War is that military should not exceed 10% of the local population. By this convention, we would calculate the carrying capacity as Local Population*0.1.

This value of 0.1, the coefficient of the local population, is referred to as Capacity in the Intermediate Variable section above. As can be inferred from that section, there are a few inputs that can cause this value to vary, such as:

  • Sophistication of fortifications (for defenders only)
  • Road systems
  • Urbanization
  • Logistic practices
  • Acclamation to the climate (inferred from ethnicity)

All of these things above can cause the Capacity value to change from 0.1, but will always remain fairly low. As will be seen in the next few sections, this Capacity variable is always used to represent the current capability of the military to sustain and supply their troops. As the Capacity variable is tied to the military, then it can be different between belligerents. If one side has a larger army and poorer logistics, it can be expected that their capacity value will be somewhat lower, even though the local population is the same for both. Similarly, if the defenders are being sieged by attackers from the outside, we would expect the people being sieged has worse problem of attrition than the siegers.

That being said, there are a few major problems that come from this conventional wisdom, such as in the cases where:

  • The local population is unknown
  • The region could theoretically support a larger population, but happens to be sparsely settled
  • Naval battles, as the sea has no native population

For the first two cases, the local population can be estimated using the value of climate. First determine the number of people in the world who live in each type of climate, then divide each of these numbers by the size of the battlefield, or 100,000 sq km. The result of this calculation is shown below:

  • Temperate: 1.3 million
  • Tropical: 600,000
  • Continental: 400,000
  • Arid: 300,000
  • Arctic: 11,000

Thus, we can take a simplifying assumption that any region of a certain climate is able to support a total population based on the table above, on average. If a local population is provided in the online database, then that value takes precedence. However, if that value is less than 10,000 people or is not provided at all, then the table above is deferred to instead.

This system fails to satisfy the condition of an oceanic climate, as obviously nobody lives on the ocean. Rather, the carrying capacity at sea is determined by the total capacity of the ships involved, i.e. as Ship Number*Ship Capacity. Unfortunately, this would result in the value of Local Population being different between each belligerent, as each side has different numbers of ships. The way to rectify this is to set the local population with the side that comes out as a larger value, and then the Capacity of the smaller value is then changed to Capacity = Capacity*Ship Number*Ship Capacity/Local Population.

The actual loss by attrition itself is calculated by a logistic equation. The key feature of a logistic equation is that it forces any initial value towards the carrying capacity. In this case, the carrying capacity is Local Population*Capacity, while the principle is the Military Size, which is therefore compared by the ratio Military Size/(Local Population*Capacity) = L. If the value of L is less than one, then no attrition is felt. Otherwise, the value of L is capped at two, as any more attrition than that would end up with ridiculous results.

Because the algo works on discreate increments of time, we convert the logistic equation into a differential equation. In the differential logistic equation, the "Constant of Proportionality" is represented by the type of attrition we are actually dealing with. That is, whether the attrition is from desert, mountains, jungle, etc. The equation we finally come up with is:

Casualties = (Attrition+Random Number)*Military Size*(1-L)


  • Attrition is the type of attrition from the location tab (Jungle, Mountain, Desert, etc.). The default value, when attrition is set to "none", is 0.01
  • Random Number can vary from 0 to 0.05

Supply lines

Supply lines refer to the mechanism that the military uses to maintain the logistics of the troops, including both basic necessities and equipment. In actual military strategy, maintaining and operating supply lines is an extremely complicated process. In this phase, simplifying assumptions are taken to identify just the basic mechanics that are relevant.

The method used to maintain supply lines for each flank is specified by the value of Logistics from the unit type. As discussed in the unit section, the flank's overall logistics defers to the unit whose logistic value is best. Under normal circumstances, the algo assumes that these supply lines for each flank are always being maintained.

The supply lines of an enemy flank can be cut by specifying a flank with the "Pillaging" maneuver. Once two or more pillaging flanks are close enough to an enemy to attack, it will also look for an opportunity to cut the supply lines for this opposing flank. Sometimes it requires two or three rounds to actually cut the supplies, as some logistics are much more resilient than others. Finally, even after all that prerequisite, a pillaging flank has a 50% chance of deciding to simply attack, rather than forfeiting an attack to cut supply lines.

In summary, a flank will cut the supplies of an enemy flank if the following conditions are met:

  • It is in a position to be able to attack the enemy
  • The enemy supplies hasn't been already cut
  • There is at least one other flank attacking the same enemy at the same time
  • Maneuver is set to Pillaging
  • It has been attacking the enemy for sufficient number of rounds (see Resilience table below)
  • A random number from 0-1 is equal to or less than 0.5

The resilience associated with each logistic type is given here:

  • Personally Supplied: three rounds
  • Foraging: three rounds
  • Advanced caches: two rounds
  • Uses roads: one round
  • Basic: one round

Cutting the supplies of one flank does not cause an immediate affect, as he will resort to relying on his compatriot flanks instead. If all enemy flanks are cut off from supplies, then the situation is more dire. In this case, the variable of Capacity is reduced by 90%. Thus, cutting the supply lines of the enemy does not cause them direct harm. Indirectly, however, the enemy will become much more likely to start suffering from natural attrition, as explained in the previous section, if the carrying capacity ends up being less than his total military size. Once a flank's supply lines are cut, it cannot be undone for the rest of the battle.


A siege is a specific type of military engagement that focuses on slowly wearing down the enemy defenses, rather than fighting in the open. Previous phases relied on some checkbox or flag to specify a battle is a siege, which sometimes fell to arbitrary decisions of what counted as a siege and what didn't. In this phase, the algo determines intelligently whether to activate the sieging mechanics or not. In particular, the conditions for a siege that the algo checks are:

  • All flanks are set to the Position maneuver (thereby not moving)
  • All flanks are located on either higher ground or cliffs (an advantageous tactical position)
  • Some kind of fortifications exist (any value for Fortifications besides "none")

If all three of these conditions are true, then the battle is treated as a siege.

During a siege, the supplies for the defenders will slowly diminish over time, thereby decreasing the value of Capacity. The rate that the capacity decays, called the Siege Rate, is used to gauge how effective the attackers are at sieging. As such, the siege rate is dependent on three things: the power of artillery units (i.e., siege weapons), the leader's siege ability, and the attrition of the location. This is then calculated as: Siege Rate = Location Attrition+Artillery Power+Leader Siege.

As long as a siege is in effect, the value of Capacity is decreased once per round exponentially, using the following formula: Capacity = Capacity*(1-Siege Rate/10). The state of being in siege will continue the entire battle, even if the initial conditions change. Once the carrying capacity falls below the Military Size, the defenders will start to experience attrition casualties, as discussed in the first section.


Historically speaking, diseases have made a profound impact in the outcomes of military conflicts. This is especially true in the history of colonialism. For the conquests of America or Oceania, the unfamiliarity with European diseases contributed towards armies from the Old World to rout native militaries several times their size. In the colonization of Africa or Indonesia, however, diseases helped in a more defensive measure, as the persistence of malaria helped maintain independence of nations far smaller and less military power than Europe's empires. Due to this exceptional historical importance, casualty by diseases are tracked separately from any other type of attrition.

Diseases are endemic to specific nations, and these diseases are carried with the nation's military into the battle. The disease carried by one military has the chance of infecting the enemy (as in the case of biological warfare), but there is also a chance for the military to suffer casualties from their own disease, especially in pre-modern battles. To account for this, the algo reads the disease from both sides, and then applies both diseases to each side once every round. The disease is not a single value, but an object that is associated with several different values, as discussed in the Nation section.

Diseases in warfare are a very delicate balance of different factors, such that their affect on the battle is significant but doesn't overwhelm the importance of tactics and strategy. Historically, there are instances of diseases being favorable to the attacker, and instances of being favorable to the defender, and instances of being detrimental to both sides, as well as instances of having no affect at all. The algo has to strike the balance of parameters such that all four of these cases are possible, and come up often enough to be considered plausible.

First, we have to determine the probability that a disease outbreak will occur. This may depend on the type of disease, as some are more prevalent than others. It can also depend on the size of the military, as larger militaries are more likely to be inflicted with diseases than smaller ones. It also depends on familiarity, that is whether this disease is already endemic to the nation, or if it is unfamiliar. Finally, nations that are facing a low point in their history tend to be more susceptible to plague than a nation that is on the rise, such as Late Medieval Europe. The final calculation for the probability of outbreak is given here:

P = Outbreak*(Military Size/Maximum Military)/(Generation*Secular Cycle*Familiarity*6)

Notes on this equation:

  • Outbreak is a parameter of Disease, as said in the Nation section
  • Maximum Military size is discussed in the next section
  • Generation and Secular Cycle are determined from the age of the nation, as said in the Nation section. It gives a sense of whether the nation should be growing or not, and their multiplication varies between 0.5 and 2.
  • Familiarity is a value that depends on whether this disease is already endemic to the nation. If it is, then Familiarity = 10, and otherwise it equals 1

At this point, a random number is checked to be above or below P, and that decides whether the disease breaks out in the military this round. When that occurs, the following equation is used to calculate the final casualties:

Casualties = Log2(Infectivity*Reproduction*Deadliness+1)*(Military Size/500)*Medicine*Random Number

Notes on this equation:

  • This is the only equation in the algo using log base 2 instead of base 10
  • Infectivity, Reproduction, and Deadliness are all parameters of Diseases as explained in the Nation section
  • Medicine refers to medical technology, which is inversely proportional to civilization. For example, Vaccination has a value here of 0.
  • The Random number can vary from 0-5

As every battle uses the disease native to both sides, then each army has not one but two chances for a disease outbreak every round. However, as at least one disease is endemic to their side already, then it is comparatively rare.

Stability and Occupation changes

The basic principle of calculating occupation and stability remains the same from the previous version. The occupation phase begins as soon as the battle phase ends, which determines the capability the winner of the battle has to enforce their control over the contested region. The occupation base is the ratio of the winning belligerent over the loser. Each round during the occupation phase, this value is then increased exponentially, using the Efficiency variable as the rate. The Efficiency value is gradually diminished, until the occupation value terminates at some asymptote. The final value of occupation, as a logarithm, is taken as the final occupation result.

Stability, on a scale from 0-200, is the overall health of the nation. It is decreased once a battle, depending on such values as occupation, economy, and military casualties. Both occupation and stability calculation are heavily revised, due to the fact that the input values used to generate them has been totally overhauled.

Occupation score

Occupation score is a measurement of how much one side imposes control over the contested region, once the battle phase is over. As stated above, the occupation phase is calculated in a main loop, which starts with an occupation base that grows exponentially based on the value on efficiency. This occupation base is calculated as a ratio of the winner's occupation base to the loser's. However, in this phase we can also take advantage of including one extra factor, the presence of diseases. Once one side loses the battle, their last resort is repulsing the occupiers by the use of potentially unfamiliar diseases, just like the European colonization in Africa or Indonesia. This factor can be put together to calculate the occupation base like this:

Occupation Base = (Winner Occupation Base/Loser Occupation Base)/(Loser Disease Power*Winner Medicine)

So in this equation, the occupation score is much lower if the endemic disease is more potent, but this can be compensated with more modern medicine.

During the occupation phase, the values of efficiency and limitation are taken from whichever unit has the highest efficiency value. However, if climate is set to Ocean, then the efficiency and limitation values are taken from the ship unit unconditionally.

Calculation of occupation change is identical to the previous phase, and won't be repeated here. However, the depletion of morale and efficiency has to be revised, because the calculation of attrition is now much more complicated. Instead of using attrition, the depletion of the occupation morale is used from the current ratio of morale from the starting morale from before the battle started. This is given, per round, in the equation below:

Morale = Morale - Morale^2/(Starting Military*20*Morale Bonus)

Then efficiency is reduced by the current loss of morale:

Efficiency = Efficiency*Morale/Morale at battle end

This equation is guaranteed to always be decreasing. Because every battle will always inflict some loss of morale, however small, then the ratio of Morale/Starting Morale will always be less than one. The ratio of Morale/Morale at battle end will always start as equaling one, and then gradually decrease. The process of occupying a region is exhausting to the military, and becomes more exhausting over time, causing their ability to maintain efficiency to fall off. Although the occupation could theoretically go on indefinitely, there comes a point where it is not possible to increase the score any further.

That being said, the occupation military is still susceptible to attrition, just the same as during the battle. If the occupation military exceeds the carrying capacity of the region, then they will continue to suffer natural attrition of the surrounding region. However, this attrition will only affect the occupation morale, and not inflict any additional casualties. In addition, diseases still wear down the morale of the occupier, but only taken from the disease of the losing army. The probability of a disease outbreak during each occupation round is given as:

Outbreak/(Generation*Secular Cycle*Familiarity*4)

The significance of these values are explained in the disease section above. Then, in the event of a disease outbreak, the morale loss from that disease is given by this equation:

Log2(Infectivity*Reproduction*Deadliness+1)*Winner Medicine*Random Number*200

In this case, the random number can vary from 0-3. Once the change of the occupation score is less than 0.01, then it is assumed to have reached an asymptote, and the occupation ends. The final occupation result from this value is identical to previous versions and won't be restated.

Maximum military

Ordinarily, the maximum military is not a factor that should be strictly managed in a map game. The maximum military a nation can field, realistically, can be based on a huge variety of factors that can't always be quantified, tied to cultural obligations, organization structure, and economics. On a regular basis in a map game, the players and mods who have any familiarity with military history should already know what rough estimate of military should be considered "plausible" for that time period. Having a flat formula for calculating military maximum runs into two problems: 1) gaming the system by always using the maximum military, at all times, and 2) arbitrarily cutting nations short who historically had military large for their size.

That being said, for the purposes of this algo we do require some means of making a rough estimate of a maximum military, in order to calculate the strain that war puts on the nation as a whole. Within reason, a government may be able to force their nation to field military far beyond their historical limitations, but doing so poses an increasing risk to the stability of that government.

Remarkably, across recorded history there are some heuristics that is capable of making a rough estimate of military maximum, which works the majority of the time. These heuristics essentially rely on population size, federal government, and civilization type. Fortunately, we have all three of these pieces of information at our fingertips. The historical conventions go as follows:

  • Pre-Urban societies that exist in Hunter-Gatherer or Nomadic civilizations are able to field their entire population, or 100%. This is due to cultural obligations training every abled male to fight
  • Dictatorships or similar totalitarian states are able to force people into military service without civil liberties, historically achieving a military population of 20%. This figure largely comes from the Soviet Union and North Korea.
  • Modern societies since the end of feudalism vary quite a bit in their military, but are roughly approximated to 10-15% of their population, usually around 12%
  • Feudal or any other pre modern society are historically known to field 1/15th of their population, or roughly 7%.

Using the values we have read from the Nation tab, we can summarize the correlation as follows:

Hunter-Gatherer, Proto-Urban, Nomadic Bronze Age, Iron Age, Medieval Early Modern, Industrial, Post-Industrial
Proletariat, Dictatorship 100% of population 7% of population 20% of population
All other governments 100% of population 7% of population 10% of population

Stability reduction

As stated previously, the basic principle of stability score remains the same. It gauges the overall health of the government of the nation, on a scale from 0-200, where 0 is in total anarchy and 200 is fully stable. This value is reduced once per battle, determined by a combination of occupation, military casualties, and economy. The main difference in this phase is the introduction of Innate Stability as an extra variable. The Innate Stability is the tendency of the nation towards becoming less stable over time, and is basically factored in as a coefficient of the overall Stability score. The lower that Innate Stability is, the lower that the final Stability score ends up being.

This value of Innate Stability can be further reduced based on the final outcome of the battle:

  • If the nation lost the battle, and the location is equal to the nation's capital, then Innate Stability is reduced by 40%
  • If the national leader is killed, and the government is dictatorship or proletariat, then Innate Stability is reduced by 45%
  • If the national leader is killed in all other circumstances, Innate Stability is reduced by 30%

Note that the death of the leader does not depend on losing the battle.

The final calculation of stability loss can be constructed piece by piece. First, it is directly proportional to the final occupation result, which is the logarithm of the occupation score. Stability can also be affected by military casualties, due to the loss of manpower. These casualties are given as a ratio to the military maximum. If the casualties remain below the maximum, then that compensates for the occupation score. If the casualties are above the maximum (which is possible by having exaggerated military sizes to begin with) then it will add to the occupation score. That being said, it is possible for a nation to support a higher military than their maximum with a more robust economy. Therefore, the Economic score is used to offset the ratio of military casualties. The final calculation of stability loss is given here:

Stability = (Stability*Innate Stability) - ((Military Casualties/Maximum Military)/(Economy*2))*log(Occupation+1)*3 + Random Number

Some additional notes on this calculation:

  • Ratio of casualties is capped at 2
  • Economy has a minimum value of 0.1
  • log(Occupation+1) is dropped for the winner
  • Random number varies from 0-5


One will find the interface to be overall very similar to the previous version. It has input fields for the war name and date on one side, and buttons on the other side for running the war, switching sides or committing stability scores. The main part of the GUI is a tabbed interface, consisting of three tabs: Tactics, Strategy, and Output. The Tactics tab is where the nations, military and location are selected, giving the basic outline of tactical information. The Strategy tab has a 2D plane of interactable squares, representing the initial positions of each flank. Finally, the Output tab displays the final receipt in Wikia markup code, once the algo is run. It also contains lists for explaining the different kinds of possible occupation and stability results.

However, there are substantial changes to the GUI that are enriched with many possible features, which are outlined in this section. The algo makes use of external resources found in its folder structure: JSON, Logs, and Maps. These folders can be used for updating the modifiers, terrain maps, and output logs of the algo without touching the original source code. In the GUI, the Strategy tab gives the ability to freely modify the flank composition, size and maneuvers. Due to this extra feature, many other features were added to make that editing easier, such as the ability to restore a previous strategy and to copy, cut and paste flanks.

The Strategy tab also includes a terrain map, that can be selected from a list of terrains stored as PNG files in the Maps folder. This map shows up as a picture, but also has real affects on the strategy during the battle, as explained in the flank mechanics section. The user is also able to add new terrain maps very easily. On the Output tab, there is a third list added that acts as the legend for the terrain map. Finally, the naval checkbox is entirely removed, and replaced with a dropdown to select the overall motive for the war.

The receipt for the output appears to be a lot more terse, since it only gives the nations and results and none of the database information. All this extra information is printed through a detailed log that is generated every time a battle is run. The log file has all the extra details not given in the Wiki receipt. In addition to this, the Flank editor window will also have information on the status of each flank both before and after the battle. Thus, in this phase there are three different sources for output, instead of one


The installation folder of the GUI has four subfolders: JSON, Logs, Maps, and tokens. Tokens is generated automatically by accessing the database, and so should not be touched at all. The JSON folder stores the JSON files that are used for the numeric values associated with the database inputs. For more information on the JSON files, see the Unit stats section. The Maps folder stores the PNG files used to render all the terrain maps in the GUI. For more information on storing and reading maps, see the Terrain map section. The Logs folder contains the text files constituting automated logs from the algo software. For information on how to interpret log files, see the Output section. Please do not move any files out of their folders, especially the jar file.

Double-click on the jar file to launch the GUI. Defer to the README file for typical troubleshooting issues related to launching the application. The upper left hand corner has a text field for the war name. This can be any name, including special characters, Unicode and Wiki markup. In this same corner is a spinner for the war date. This date can be any integer from 3500 BC to 2020 AD, BC negative. This date has significant affect on the algo itself, including the age of all leaders, the age of the nation, generation, and civilization of each side.

Below both of these inputs is the motive dropdown menu, which selects what the overall reason for the war should be. This is the paradigm of the war that is applicable to both sides, not just one. Although more than one motive may be relevant, choose whichever best fits. Every war must be associated with some motive, even though the motive itself has very little impact on the result of the battle. Defer to the Input section for more information on selecting the Motive.

The upper right hand corner has buttons for controlling the war, and the functions of these buttons have not changed at all from the previous version. One button will run the war and print the result. The second button will switch the attacking and defending belligerents, while clearing the result. The third button will write the new stability to update the database Nations tab. This third button will only work after a battle has been run. The space between these two corners is where most error messages will appear.

The rest of the GUI features are arranged along three tabs: Tactics, Strategy, and Output. The Tactics tab selects the attacking and defending nations, as well as their respective armies and the battle location. The Strategy tab arranges the initial positions of the flanks for each army, selects the terrain map, and customizes the size and composition of each flank. The Output tab displays the Wiki markup text giving a final summary for the battle, as well as notes how to interpret different Stability, Occupation, and colors on the terrain map. Once an algo is run, the flanks position and composition on the Strategy tab are updated to display the final result, which can be reset or restored on command. More detailed information on the output can also be found in the log files.

Online database

In order to run the battle, you must first access the online database, called the Map Game Database, and ensure that the belligerents, militaries and location are both present and updated in their respective tabs. Each war may only have two belligerents, one army per belligerent, one location, and between zero to four leaders. As explained in the Inputs section, not all entries in this database need to be filled, as a blank entry will be substituted by a default value automatically. The vast majority of inputs have a corresponding default value, which are all listed earlier. However, if any of the required entries in the database are not filled in, it will result in an error message. These required fields are listed as follows:

  • Nation - Population, Year Founded, Year Crisis
  • Military - Size
  • Location - none

Additionally, if a military is given any unit type that does not exist, it will also result in an error message.

On the GUI, use the Tactics tab to load these values into the algo, using five drop-down menus. The attacker, defender, and location drop-down menus are automatically populated whenever the algo is restarted. Once a nation is selected, its corresponding military drop-down menu is automatically filtered to only list the militaries associated with that nation. All five menus will always have an extra option called "default" available. The default entry is to be used whenever the user wants to select a generic nation, military, or location without selecting anything specific. This can be useful when warring in a region with many nations or militaries that are very similar to each other, and often become redundant.

Once any of these five menus are selected, it is automatically checked for errors. An algo cannot be run if any error is present. Once a military is selected, it will display quick information on the total size and current leaders for that military. In addition, when a military is selected it will automatically assign that military to the flanks in the Strategy tab, overwriting any military that is already there. By default, the selected military is evenly distributed across the current flanks, as are the number of ships, rounded to the nearest integer. Once a location is selected, it will update the Strategy tab to select the appropriate terrain map for this location. Once the algo is run, the information is again pulled from the database, and these inputs are mapped to the intermediate variables used for the simulation. For more information, see "Mapping inputs to outputs".

Unit stats

The JSON folder has all the JSON files used for the algo software. After the input values are pulled from the database, the software needs to determine what numeric values are associated with each input, in order to map the inputs to intermediate variables. As explained in the inputs section, each input can be associated with different values in different contexts. For example, a value for Military Type could translate to one number to calculate Efficiency, but a different number when calculating Limitation. The JSON structure lists out all the numeric values associated with every possible value for every input. These JSON files should not be changed the vast majority of the time. In general, the values for these inputs should only be adjusted as part of maintenance work.

The most important JSON file to keep track of is Soldier.json. This file contains all the input values associated with every custom unit type, including every type of infantry, cavalry, artillery, and ship. Each unit type is listed as a separate JSON object, with the input values listed as members of that object. Once a new custom unit type is submitted to the mod, the mod must then add the unit type to the Soldier.json. The syntax must follow the same syntax as the rest of the JSON file, or it will result in an error. The unit type in Soldier.json must be written exactly the same spelling and capitalization as the unit type in the online database, or it will result in an error message saying "unit type not found". Every time Soldier.json is updated, a copy of the file must be kept in the Google Drive. Because of this, please make sure your JSON folder has the latest version of Soldier.json before running the algo. For more information on the input values associated with a custom unit type, see the Unit section.

Flank editor

The flank composition editor is a separate window that is used for viewing and editing the properties of one specific flank. It displays information for the selected unit types, size, morale, and overall status, and allow the user to change the unit composition and maneuver. The editor will always display the information for whatever flank is currently selected. In order to select a flank, go to the Strategy tab and double click on any of them. The flank editor will open up for that flank. Only one editor window can be opened at a time. The editor can be opened at any point, either before or after a battle. Every time a military is selected on the Tactics tab, any military stored in the flanks will be erased and replaced with the new military.

The top left hand corner displays the total size of that flank. By default, this size is always equal to the size of the military divided by the number of flanks on that side, rounded to the nearest integer. This value cannot be edited, but will update automatically as the composition is changed. The top right hand corner is the current total morale. This will always be equal to the total size times twenty. Both of these values will be updated automatically after the battle ends.

Just under this value is the current status. The status gives a quick insight as to where the flank currently stands in the battle. Before the battle, this will always be "Idle". After the battle, this value will be updated to whatever is appropriate at the moment the battle ends. The possible results for the status are:

  • Inactive (black) - The flank no longer exists (size is zero), this is usually interpreted as the remaining troops were captured
  • Routed (red) - The flank has been defeated. On the Strategy tab, the flank is shown with a darker color as well
  • Retreating (orange) - The flank is no longer able to fight and is starting to rout
  • Ready (green) - The flank is in the middle of attacking the enemy
  • Idle (blue) - Default state

The left-hand side shows the composition of the flank across its three unit types: Infantry, Cavalry, and Artillery. The type of unit cannot be changed, but pulls whatever unit types there are in the database. The spinner next to each unit type is pre-populated with the size of that unit within the flank (calculated by multiplying the total military by the proportion, pulled from the database). Whenever any of these spinners are changed, then the total size updates automatically. If any unit is disabled, then it will be listed as "<none selected>", and the corresponding spinner is disabled. The fourth row of this side displays the Ship unit type. The spinner next to the ship type is pre-populated with the ship number pulled from the database. If the ship type is disabled, it is shown as "Barge" (the default value for ship type) and the spinner is disabled.

The right-hand side chooses the type of maneuvers for this specific flank. The drop-down menu selects from the list of maneuvers described in the Movement section: Normal, Feigned Retreat, Hit-and-run, Position, and Pillaging. The maneuver selected will change the movement behavior for this flank, and only this flank specifically. The text field under this drop-down menu displays a quick summary of what each maneuver does once selected.

The four buttons below have functions that are fairly intuitive. Apply will take the values for composition, size and maneuvers that are currently displayed, and commit them to the selected flank, replacing whatever values that flank previously had. Save will perform the same action, but also close the editor. The changes to the flank will not be committed until either Apply or Save are selected. Cancel will close the editor without saving any changes, and this is the same result if the window is closed manually. Finally, Delete will remove the flank from the Strategy tab completely, and close the editor. As explained in the next section, deleting a flank does not have any affect on the composition of the other flanks, and results in the total size going down.

Terrain map

The terrain map is a 2D multi-colored map, spanning 400x400 pixels, that represents the landscape where the battle takes place. The map consists of five colors, each color representing a different kind of terrain feature. There is a map legend on the Output tab, but you can find more information on these map features in the Locations section. The attacker flanks are represented as cyan squares, and defenders are represented as red squares. These flanks can be moved by clicking and dragging, to set the initial positions before the battle begins. At the top of the Strategy tab, the drop-down menu selects the type of terrain map. The names of the terrain maps are rather descriptive, and represent generic landscapes that could be applied in a variety of situations.

The terrain map is read from a PNG file located in the Maps folder. The drop-down menu is automatically populated with a list of all PNG files found in that folder. By default, the selected terrain map is the terrain read from the Location tab of the online database, but this can be changed at any time. If you want to add a custom terrain map to the algo, simply place the image as a PNG file into the Maps folder, and restart the application. The file is now available in the list of terrain maps on the Strategy tab. If the file is larger than 400 pixels, then it will be clipped off. If it is smaller, then the extra space is interpreted as Plains.

Every time a terrain map is selected, it is read into the software as a matrix of terrain features, translating the color of each pixel into the map legend. If the map contains a color that does not exist in the legend, then the software will interpret it as a feature whose color most closely resembles it. For example, cyan is treated as water because it is closer to blue than any other color in the legend. For this reason, almost any PNG image can potentially be used as a terrain map, without resulting in any error.

The large numbers in the top right and left hand corners of the Strategy tab indicates the number of flanks for each side currently in play. The plus button will generate a new flank for that respective side. New flanks created this way will always have a size of zero, and listed as Inactive. There can be a maximum of 99 flanks per side. In order to remove a flank, there is a button in the top-middle of the strategy tab labeled "Remove". This button will delete whichever flank is currently selected, removing any military in that flank with it. After a battle is run, each flank will indicate that it is routed by having a darker color, and further nuance of their status can be found by opening its flank composition editor.

There are also hotkeys that can be used to make the creation of strategy even faster. Pressing the delete key while focusing on the Strategy tab will cause the currently-selected flank to be deleted, just as if the Remove button was selected. Flanks can also be copied and pasted, using the key combination of CTRL+C and CTRL+V. A copied flank will have the exact same composition and size of military, and the same value for maneuver and status. This, copying and pasting a flank will cause the total size of the military to increase. Only one flank can be selected at a time.

The attacking and defending sides respectively have a status message that indicates if the current composition of troops is valid. Since the total military, as a whole, has a set size and composition taken from the database, then the military used in the battle cannot exceed this number, nor can it have troops left over. This can also apply to the size of individual units. For example, say a military has a total size of 10,000, and its composition is 50% infantry and 50% cavalry. Therefore, the total size of cavalry in the battle cannot exceed 5,000, because that is the total cavalry specified in the database.

Once a military is selected on the Tactics tab, this status message will be initialized as Good (X/Y). The X in this case indicates the total military calculated by adding all the flanks together, and the Y indicates the total size of the military pulled from the database. Due to the affect of rounding, these two numbers may not be exactly equal, although they will be very close. In order to account for this rounding, the status will still say "Good" as long as the difference between X and Y are no more than 10 soldiers. If you demand an in-universe explanation for this discrepancy, then consider the leftover military as officers who are not engaged in combat.

If the number of troops of one specific unit is not valid, either by being more or less than the number of troops for that unit in the total military, then this status message will say it is "Invalid", and indicate which unit type is causing issue. For example, having more infantry than exists in the total military will result in the message saying Invalid Inf (X/Y). In this case, the X and Y values don't refer to the total size of the military, but the total size for that specific unit type, in this case the infantry. This message will show up as red if the size of the unit type is too large, and orange if the size is too small. The same message can be given for the Navy, which is checked against the value of Ship Number pulled from the database. As individual ships have a larger impact on the battle, their check is more severe: the military is considered invalid if the total navy in the flanks is more than one ship off from the number in the database.

In order to reset the Strategy tab back to default, select the "Reset" button. This will restore the strategy back to three flanks per side, and evenly distribute the military across the three flanks. Selecting reset only changes the values of the flanks and does not affect the terrain map. If you want to restore the strategy back to the way it was before the battle started, select the "Restore" button. If the Restore button is selected twice, then it will restore the Strategy tab to the situation immediately after the battle ended. Repeatedly selecting the Restore button will cycle back and forth between the strategy before and after the battle.


Just like in the previous version, the output tab displays a receipt of the algo formatted in Wiki markup code. This will only show up after the war is run. Unlike previous versions, this receipt is heavily simplified, only giving the basic facts of the war beginning and end, while not giving any information on the input values or intermediate variables. A summary of how this receipt looks like is shown here:

  • Name of war and start date
  • Values of Motive and Location
  • Per belligerent
    • Stability value and result
    • Military result, broken down as: Killed in action (military casualties), died (attrition casualties), and captured (the last troops in any dying flank). If naval fighting was involved, also includes "ships sunk"
    • Leader status
  • Occupation score and result
  • Time interval

The final result of the algo also causes the Strategy tab to update, displaying the final positions of each of the flanks at the battle end. Any routed flanks will have a darker color than before. Opening the flank editor at this point reveals the state of that flank at the end of the battle, including the final size and morale. The status message is also updated to indicate the flank's current status, as explained in the previous section.

All remaining details on the algo's calculations and results can be found in the Logs folder. Every run of the algo generates a text file, including the name "Autoalgo log" and a timestamp. This log contains information on how all the input values were mapped to intermediate variables, as well as description of the major events of the battle step-by-step. The first section of the log displays the input values and how each of them contributes towards the intermediate variables, first for the attacker and then the defender. For each unit type for this belligerent, it lists out the input values that contribute towards Efficiency, Limitation, Defense, and Effectiveness, which it displays for all four unit types including ships. Next, for each belligerent it lists out the input values contributing towards Occupation base, Capacity, Economy, Innate Stability, and Morale Bonus. Finally, it gives the ratio for the maximum military for each side as well.

The second section of the algo gives a general timeline of events that occurred during the course of the battle. Each entry of the timeline is given a timestamp, or a raw number of hours since the battle started. Many different types of events can cause event logs to be generated, such as:

  • One flank attacking another
  • A flank decides to commit to a charge
  • One flank has a higher ground than another
  • A flank is starting to route
  • A flank is fully routed
  • All remaining troops of a flank have been captured / ships sunk
  • Losing troops to natural attrition
  • Disease outbreaks
  • A flank is wiped out completely by attrition
  • A flank's supply lines are cut
  • One belligerent's supply lines have been completely cut off

This information is given across the timeline for both the battle and occupation phases. The log is generated automatically during the runtime of the algo. Thus, if the software crashes due to some unforeseen error, the log would still exist up to that point. These logs should be used primarily for two reasons: one, to know exactly how the battle went and what contributed to its result, and two, to know the biggest factors contributing to the algo's result. This latter reason can help for future maintenance, which can decide to change the values in the JSON files to get a more plausible result in the algo, if necessary.

The Wiki-formatted output should be the receipt to post on the Map Game talk page in all scenarios. The information from the Strategy tab and the Logs folder should be used to replace the auto-generated Occupation result, giving more information as to how the battle went and why one side won.