A New Dawn (Galaxy Game)/algorithm

A New Dawn Algorithm - STILL INCOMPLETE

Standard player warfare
Player vs player wars occur in two stages, a space battle followed by a planetary battle. If the attacker wins the space battle, he has two options. He can remain in orbit and bombard the world, or invade the planet. If he chooses to bombard, the world passes directly into the attacker's hands as a colony, though it cannot become annexed for fifteen turns, since it is now barren and environmentally destroyed.

However, if he chooses to invade the world, and he wins, it becomes a colony to be annexed in only three turns.

If the defender wins the space battle, the attacker is pushed back, and cannot attack that world for another five turns. If the defender loses the space battle, but wins the planetary battle, the attacker is pushed back, but remains in orbit, and can reinvade two turns later. If the defender wins a second time, the attacker is utterly vanquished, and cannot attack that world for another eight turns. If the defender loses the world, but takes it back within two turns, assuming it has not been bombarded, the world returns to the status of being an annexed world, since people and structures of the same culture will still be on the planet. If the defender loses the world and retakes it, but fails to do so in two turns, it must be recolonized for five turns before becoming an annexed world. If the attacker razes the world, and the defender retakes it, the time of re-annexation remains fifteen turns, due to environmental destruction.

In the event that one faction attacks an undefended colony of another and attempts a planetary invasion, the attacking faction with the army gets a walkover due to no armed resistance, and wins the battle automatically.

Conflicting colonization
If two powers attempt to colonize a world during the same turn, they enter into diplomatic negotiations. If they sign a treaty, they engage in joint colonization, and can both annex the world. If negotiations fall through, since they are both already on world, they engage in a planetary battle only, with the winner removing the loser from the world. The first player to attempt to colonize the world takes the role of defender, while the most recently arrived faction is the attacker.

Alliance modifiers
Alliances between allies play into both space and planetary conflicts. While any other player may support any side in a war between players, providing a small bonus, allies provide a higher bonus. Players in defensive alliances automatically provide each other with bonuses if they are attacked, while players in military alliances automatically provide each other with the highest bonuses if they either attack or suffer attacks themselves.

Algorithm
All Battles:
 * Location
 * Location Bonus
 * Motive
 * Motive Modifier
 * Tactical Bonus
 * Economy Bonus
 * Expansion
 * Concurrent Wars
 * Other Factions

Space Battles only:
 * Space Tactical Bonus

Planetary Battles only:
 * Planetary Environment Modifiers
 * Planetary Tactical Modifiers

Special (Used once, in either space or planetary battle)
 * Tier Level Bonus

Algorithm Explanation
Tier Levels
 * Tier 1: Twenty or more annexed worlds
 * Tier 2: Fifteen or more annexed worlds
 * Tier 3: Ten or more annexed worlds
 * Tier 4: Seven or more annexed worlds
 * Tier 5: Fewer than seven annexed worlds

All Battles
Location (applies to both space and planetary battles)
 * +7 if war is in home sector (i.e. +10 to Korriban if war is in sector R5)
 * +5 if war is in sector of an annexed world
 * Note: If homeworld is in same sector as annexed world, apply home sector modifier instead
 * +4 if war is in a neighboring sector (one of the 8 surrounding the closest annexed world sector.)
 * +3 if close to location of war (within 2 sectors of closest annexed world sector)
 * -1 if somewhat far from location of war (between 3 and 4 sectors from closest annexed world)
 * -2 if far from location of war (greater than 4 sectors but less than 6 from closest annexed world sector)
 * -3 if extremely far from location of the war. (greater than 6 sectors from closest annexed world sector)

Location Modifier (applies to both space and planetary battles)
 * +6 if war is on homeworld
 * +4 if war is on annexed world
 * +2 if war is on colony world (in the process of being annexed)
 * -1 if war is on unknown world
 * -2 if war is on a colony world of opponent
 * -3 if war is on an annexed world of opponent
 * -4 if war is on homeworld of opponent

Motive (applies to both space and planetary battles)
 * +2 Economic (Gains land, resources, etc)
 * +3 Aiding Ally
 * +3 Defending colonies
 * +3 Taking territory of similar culture/race but not part of faction
 * +4 Defending annexed worlds
 * +4 Taking back territory recently held by faction but since lost
 * +5 Defending homeworld from faction-ending attack

Motive Modifier (applies to both space and planetary battles)
 * +5 Government supported by people
 * -5 Government not supported by people
 * -2 War not supported by people
 * +2 Troop Morale High (requires motive over or equal to 3)
 * -2 Troop Morale Low (requires distance to be greater than 4 sectors from closest annexed world)
 * -2 (per defeat) Defeat suffered within the previous two years.

Tactical Bonus (applies to both space and planetary battles)
 * +3 Attacker’s advantage, +4 Defender’s advantage
 * +4 Surprise attack/invasion (Attackers)

Economic Modifiers (applies to both space and planetary battles)
 * +3 More annexed worlds+colony worlds than enemy
 * -3 Fewer annexed worlds+colony worlds than enemy
 * +3 if trade agreement with at least one player faction/world
 * +1 for every additional player trade partner
 * +1 for every world annexed

Expansion (within last three turns) (applies to both space and planetary battles)
 * +0 No recent expansion (no new colonies established)
 * -3 Minor recent expansion (one new colony)
 * -4 Major recent expansion (two to three new colonies)
 * -5 Huge recent expansion (four or more new colonies)

Concurrent Wars (applies to both space and planetary battles) * "Concurrent war" is defined as any war, either player-NPC or player-player
 * -3 for One war*
 * -5 for Two wars
 * -7 for Three or more

Other factions (applies to both space and planetary battles)
 * +3 for aid and support from non-ally faction/player planet
 * +4 for aid from defensive ally (Defensive allies automatically join wars when ally is attacked)
 * +5 for aid from military ally (Military allies automatically join wars when ally attacks or is attacked)

Tier Level Bonus (can only apply once to either space or planetary battle per war)
 * +5 if Tier 1 superpower
 * +3 if Tier 2 superpower
 * +1 if Tier 3 power

Space Battles
Space Tactical Modifiers
 * +1 for small fleets (1-10 capital ships)
 * +2 for medium fleets(11-30 capital ships)
 * +3 for large fleets (31-50 capital ships)
 * +2 for fleets with frigates/destroyers
 * +3 for fleets with battleships/dreadnaughts
 * +4 for fleets with carriers/capital ships
 * +3 for battlestations/orbital defense platforms (i.e. Korriban Gates above Korriban)
 * +3 if planetary energy shield (Defenders)

Planetary Battles
Planetary Environment Modifiers
 * +5 if world is environmentally similar to homeworld (Attackers/Defenders)
 * -5 if hostile wildlife (Attackers)
 * +3 World is island world (Defenders)
 * +4 defenders/-1 attackers if World is desert/arid world
 * +4 defenders/-2 attackers if World is jungle world
 * +3 defenders/-3 attackers World is ecumenopolis (city-world)
 * +2 defenders/-4 attackers if World is tundra/arctic world

Planetary Tactical Modifiers
 * +1 for small armies (militia groups, conscripted volunteers)
 * +3 for medium armies (garrison forces, several battalion-strength)
 * +5 for large armies (Invasion forces, multiple legions)
 * +3 defenders/-5 attackers if guerilla warfare (Defenders)
 * -3 defenders/-7 attackers if defenders employ total war (voluntary destruction of assets to hamper attackers)
 * +2 if attackers employ bombing runs (Attackers)
 * +7 if attackers employ single orbital bombardment (Attackers)
 * Modifier: Two additional turns for annexation if employed, due to environmental destruction
 * -10 attackers if reinvasion, due to losses/low morale (Attackers)*
 * +6 defenders if reinvasion, due to previous victory morale boost (Defenders)*
 * -5 defenders/ -3 attackers if attackers employ biological/chemical weapons

* Reinvasion being undertaken by an attacker who won the space battle, but lost the first planetary battle, and decided to attack again.