Algorithm (AltE)

Algorithm for the Alternate Europe Map Game

Algorithm Results (AltE)

Algorithm
Explanations in brackets

1. Casus Belli
(Only counts for the first attack.)
 * None -5 to attacker (ur lazy)
 * Fake/staged event -4 to attacker (at least you did something to justify the war)
 * Provoked -3 to attacker (people don't care who started first, they don't like war)
 * Defending country honor -2 to attacker (f*ck the honor, people will die)
 * Helping allies -1 to attacker (population: -y don't ya help'em with supplies instead of sending us to die?)
 * Political casus belli 0 (so that island is your? How'dya like my spear in yo head)
 * Reuniting lands and similar cultures +1 to attacker (hey, bro, wanna join?)
 * Defending your people +2 to attacker (did you just killed a bunch of my people? Come here mothe....)

2. Motives
Only one can be selected
 * Life or Death of country +5 to defender (fear of loosing all territory makes your men fight harder)
 * Independency +3 to defender (Nations don't usually want to loose freedom or live in vassal/puppet state)
 * Religion +3 to attacker (Crusade, Jihad and stuff)
 * Political +2 to attacker (To strenghten positions in some territories, to get influence there and etc.)
 * Social or moral +2 to attacker (Other culture is making humna sacrifices, and you don't like that, so you go and kill'em)
 * Economical +1 to attacker (You want iron or gold, dontchya?)
 * Expansion and influence gaining 0 to attacker (Triggers "Independency", but if you just want land or influence choose this to avoid bigger penalty for fake motives)
 * Fake motives +5 to defender.
 * If you fight Carthage for Sicily, you must conquer Sicily, not some distant region. Of course you can keep small portion of other conquered lands, but not too much.
 * If you go to war because of religion, you must mention that you destroy temples, forbid praying to some gods and etc.

3. Landscape and fortification
Landscape


 * Plains: 0.5 to defender*
 * (Arctic/Hot) Desert: 1 to defender (yes it is hard landscape but not only for attacker, also no resources for making field defences)
 * Forest: +1.5  to defender*
 * Swamps: +2 to defender*
 * Hills: +2.5 to defender*
 * Landing on beach: +3 to defender*
 * Island: +3.5 to defender*
 * Mountain: +4 to defender*
 * Mountainous island: +5 to defender (Not too much of theese will be inhabited and defended, but in case it happens, to fully capture this kind of island you need 2 turns, one for landing and one for taking mountains)
 * [*value is doubled if there is no fortification and defending army had one turn to prepare. Applied only to landscapes marked with a "*"]

Fortifications

[Both, Forts and Walls will be marked on the political map.]
 * Fortification: +7 to defender (+landscape factor)
 * To fortify something, you need to have Economy and Military at 1 or higher and it takes two turns.
 * Great Walls: +15 to defender (+landscape factor)
 * To build a wall you need to have Economy at 3 or higher. You can build 15-25 pixels every three turns (this also depends on your economy (max= economical power*5)) If you leave your walls with no soldiers they can be easily taken by enemy. Also, if wall is not too long, enemy (or you) can choose to bypass it, that will take one turn.

4. Battlefield and army factor
It is very important for your troops to be on terra firma when they are fighting. So choose the battlefield wisely. Superior tactics and rested army with high morale is also a important thing if you want to defeat your enemy.
 * Homeland +3 to defender.
 * Allied/vassal state +2 to defender.
 * Neighbour state +1 to defender.
 * Neutral lands 0.
 * Enemy allied state -1 to attacker.
 * Enemy homeland -2 to attacker.
 * Terra incognita -3 to attacker.
 * If surrounded -10 to surrounded army.
 * Face to face fight +1 to the superior army.
 * Enough of that c**p! -3 to army that has been fighting for 3 turns in a row.
 * Bad memories -3 to army that lost last turn (All the crazy stuff they did last turn, those would not be the best memories.(flop joke again))
 * If you fight on two or more fronts, your armies will be split equally on all of them, unless you mention how many you send to fight on each.
 * If you leave a front unguarded (no soldiers), no matter what bonuses you have, they don't count, and total score is 1, making it very easy for the opponent to take your lands.
 * Army score army size divided by 1000.

5. Economic and Military

 * Economical categories:
 * 5. Paradise
 * 4. Flourishing
 * 3. Stable economy
 * 2. Local trade power
 * 1. Collapsing/Rising
 * 0. Non existent


 * Military categories:
 * 5. World Superpower
 * 4. Great Power
 * 3. Regional power
 * 2. Defensive army
 * 1. Local garrison
 * 0. Non existent


 * defender gets both bonuses, attacker only gets bonus for military category.
 * military category is always equal or lower than economical category. (Cuz you can't feed everyone for five bucks)

6. Result
'''Count the scores for both sides. Find winning coeficient '''(loosing score/winning score)

Take portion* of loosing army. (represents loosing side casualties)


 * That number depends on what role do you play in battle:

Multiply loosing army casualties by winning coeficient (casualties*coef.), this represents winning side casualties.
 * Defender wins (if any of the sides is defending) - 50% of loosing army total and 0 battle role multip.
 * Attacker wins (if any of the sides is defending) - 75% of loosing army total and 0.5 battle role multip.
 * Face to face battle (no defence bonuses) - 100% of loosing army total and 1 battle role multip.

[Very important]  Even if you have better score, you can not loose all of your soldiers, otherwise you will be the loosing side. ''i.e. Sparta has 0.5 winning coef. in the face to face battle and 1000 men, Athens have 3000 men. If we count by the algorithm, Sparta will loose 1,500 men, so it will be declared the loosing side. Real Athenian casualties will be counted like this: Full size of spartan troops/coef.''

Winning side can take (expansion limit/coef*battle role multiplier)px of land.