Twilight Imperium IV Edition Battle Calculator

Select number of units already damaged before the battle from the corresponding drop-downs.

Switch battle type between Space Combat and Invasion.

Read the chart. Huge red and blue percent figures tell the probabilities of either side winning the
battle.

Characters below the horizontal axis designate units participating in the battle. Small case letters indicate
the use of sustain damage abilities.

X

Flagship - characteristics depend on selected race

W

War Sun

D

Dreadnought

C

Cruiser

V

Carrier

+

Destroyer

F

Fighter

G

Ground Force

=

Battle ends in a draw

Graph shows probabilities of battle outcomes. '=' represents a draw outcome.
Any other point represents an outcome in which units between this point and '=' sign survive.
Tooltips show probabilities that at least that many units will survive the battle.

Options allow calculator to take into account some Technologies, Action Cards, Agendas, and Promissory Notes.

Units are ordered in what I consider reasonable sequence of dying. Though this order could be questionable,
e.g sometimes War Suns are more valuable than Flagships. I was lazy to implement manual ordering.

Assault Cannon handling is questionable. Implemented preference for unit dying order is
Destroyer, Carrier, Cruiser, Dreadnought, War Sun, Flagship.
In real life depending on the situation I can imagine each of Destroyer, Carrier, Cruiser,
and Dreadnought being selected to fall victim to Assault Cannon,

Courageous to the End, Emergency Repairs and Shields Holding Action Cards.
I wasn't able to imagine any obvious way to algorithmically decide when to play these cards during the battle,

If defender activates Magen Defense Grid while Morale Boost is selected for the attacker,
the card effect is applied to the second round. Fire Team is handled the same way,

When "Risk Direct Hit" is selected, first all damageable units take damage then other units start to die.
When "Risk Direct Hit" is not selected, damageable units take hits only after all "cheaper" units are dead (except for upgraded Dreadnoughts which take damage before anything else).
This is questionable, but I don't know any better clear-cut approach,

When either Duranium Armor or L1Z1X Flagship or Letnev Flagship is active, Space Combats are calculated much slower, as another algorithm is used,

As it is implemented at the moment, when Graviton Laser is active, PDS might kill a
Carrier, because it's "less valuable" than other units. But if there are Fighters in this Carrier, they
participate in the battle, though according to the rules, they should have died before the battle,

Although you can send multiple SardakkFlagships into the battle
(in game there is maximum one, obviously), their +1 effects won't be stacked,

I consider VirusFlagship ability (let Ground Forces participate in the Space Combat)
interaction with Assault Cannon to be timing dependent. Each one of this abilities
could kick in first. If the attacker is Virus with Flagship, I count him to enlist Ground Forces into
combat first, and then absorb Assault Cannon hit into Ground Forces. If the Virus is the defender, then
I consider Assault cannon to activate first. Anyway, such fine-grained details are likely to be overwhelmed
by other simplifying assumptions (e.g. fixed units death order),

In similar vein if Mentak is an attacker, Mentak racial is applied before Assault Cannon,
otherwise Assault Cannon is executed first.