Mad Dash (Map Game)/War algorithm

The following is the war algorithm for the Mad Dash map game. This page includes the template for the algorithm, the algorithm explanation, and all conflicts which have been and are to be solved by the algorithm.

Attacker
Total:
 * Location:
 * Location bonus:
 * Tactical advantage:
 * Supporting nations:
 * Military development:
 * Economic development:
 * Technological development:
 * Recent expansion:
 * Motive:
 * Modifiers:
 * Chance:
 * Edit count:
 * Turns:
 * (Edit count ÷ Turns) * π = Chance
 * Nation age:
 * Nation size:
 * Participation:
 * Troops: TroopsAttacker ÷ TroopsDefender * 100
 * Theatres of war:
 * Concurrent wars:
 * Recent wars:

Defender
Total:
 * Location:
 * Location bonus:
 * Tactical advantage:
 * Supporting nations:
 * Military development:
 * Economic development:
 * Technological development:
 * Infrastructure
 * Recent expansion:
 * Motive:
 * Modifiers:
 * Chance:
 * Edit count:
 * Turns:
 * (Edit count ÷ Turns) * π = Chance
 * Nation age:
 * Nation size:
 * Participation:
 * Troops: TroopsDefender ÷ TroopsAttacker * 100
 * Theatres of war:
 * Concurrent wars:
 * Recent wars:

Result
% = (TotalAttacker ÷ TotalDefender) * 100

No. turns = % * (1 - (1 ÷ (2*(TotalAttacker + TotalDefender))))

Algorithm explanation
This value is derived directly from the military tier level of the nation. This value is derived directly from the economic tier level of the nation. This value is derived directly from the technological tier level of the nation. The size of the nation in area. Participation of the user controlling the nation. This is a factor only if the forces on both sides are known. If the forces of both sides or one side is unknown, disregard this factor. The total is derived from the sum of all final values.
 * Location
 * +15 if war is in home country
 * +10 if war is in a neighbouring country
 * +7 close to location of war
 * -5 far from location of war
 * -7 extremely far from location of the war.
 * Location bonus:
 * +4 if war is in well known land
 * +2 if war is in a fairly known land
 * -2 if little is known about the land
 * -3 if war takes place in a land with no prior knowledge.
 * Tactical advantage:
 * +2 Attacker’s advantage
 * +5 Defender’s advantage
 * +6 Surprise attack (Attackers)
 * +4 Home is island (Defenders)
 * +5 Home is desert (Defenders)
 * +8 Home is jungle/tropical (Defenders)
 * +10 (in winter), +12 (in spring) Home is tundra/arctic (Defenders)
 * +6 Amphibious landing (Defenders).
 * +2 Defender Scorched Earth policy enforced, -2 for attackers
 * Supporting nations
 * +3 for every nation actively participating (ie. forces are physically in battle)
 * +2 for every nation providing any two of financial, technical and/or advisory support
 * +1 for every nation providing any one of financial, technical or advisory support
 * +0.5 for every nation providing limited support
 * Military development
 * Economic development
 * Technological development
 * Recent expansion
 * 0 No expansion in the past five years
 * -1 Insignificant expansion in the past five years
 * -2 Minor expansion in the past five years
 * -3 Some expansion in the past five years
 * -4 Major expansion in the past five years
 * -5 Huge expansion in the past five years
 * Motive
 * +3 Economic gain (land, money, resources, etc)
 * +2 Aiding Ally
 * +2 Defending territory not held for more than 10 years
 * +4 Defending territory not part of heartland but held for more than 20 years
 * +3 Taking territory of similar culture but not part of nation
 * +4 Pre-emptive strike
 * +5 Taking back territory recently held by nation but since lost
 * +6 Aiding Social/Moral/Ideological/Religious Kinsmen who are being oppressed
 * +6 Attacking to enforce political hegemony
 * +5 Defending Heartland from attack that will not cripple/ destroy nation
 * +9 Defending Core/heartland from possibly fatal attack
 * +10 Defending from attack that will wipe out nation and culture.
 * Modifiers
 * -2 Non-democratic Government
 * +3 Democratic government
 * -9 Government not supported by people
 * -3 War not supported by people (Democratic)
 * -2 War not supported by people (Non-Democratic)
 * +5 Troop Morale High (requires motive over or equal to 5, chance over 4, and larger strength)
 * -5 Troop Morale Low (any of the following: chance below 1, srength less or equal to 50% of opponents, recent war penalty over 5)
 * -5 (Attacker) +1 (Defender) Fighting Guerrilla War
 * -10 Multiple concurrent wars
 * -2 (per defeat) Defeat suffered within the previous two years.
 * Chance
 * Edit count — The edit count of the user controlling the nation. If the nation is mod controlled, this value is equal to 0.
 * Turns — Length of time the user has participated in the map as this nation, measured in turns. Again, if the nation is mod controlled, this value is equal to 0.
 * Nation age
 * -10 Newborn nation (less than 5 years since gov change; 3 years if popular revolt)
 * -5 Young nation (5–25 years since government change)
 * +0 Maturing nation (25–75 years)
 * +5 Mature nation (75–200 years)
 * +0 Old nation (200–300 years)
 * -5 Ancient nation (300–500 years)
 * -15 Antique nation (more than 500 years).
 * Nation size
 * -10 Very small (eg. OTL Fiji)
 * -5 Small (eg. OTL New Zealand)
 * 0 Medium (eg. OTL Spain)
 * +5 Modest (eg. OTL Sweden)
 * +10 Large (eg. OTL United States)
 * +15 Very large (eg. OTL Roman Empire)
 * -10 Extremely large (eg. OTL Russia)
 * Participation
 * -5 User not active (no action in past 4 turns)
 * 0 User moderately active (no action in past 2 turns or mod-controlled
 * +5 User active (action every turn on average)
 * Troops
 * Theatres of war
 * +2 One front
 * -5 Two fronts
 * -7 Three or more fronts
 * Concurrent wars
 * 0 None
 * -2 One concurrent war
 * -5 Two concurrent wars
 * -7 Three or more concurrent wars
 * Recent wars
 * 0 None in the past 10 years
 * -2 Conflict(s) in the past 10 years in which victory was achieved
 * -5 Conflict(s) in the past 10 years in which this nation was defeated
 * Total