Twilight Imperium IV Edition Battle Calculator

Add and remove units to the battle by using '+' and '-' buttons.

Toggle unit upgrades with '△' buttons.

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.

Game aspects not taken into account by this calculator:

  • Nekro Virus gaining unit upgrade technology during a battle thereby changing participating units' battle value,
  • Nekro Virus obtaining race-specific unit upgrades
  • 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,
  • Yin Brotherhood Devotion, Indoctrination racial abilities and Impulse Core technology,
  • Mentak Salvage Operations technology,
  • Sardakk N'orr Exotrireme II "kamikaze" ability,
  • Ghosts of Creuss Dimensional Splicer technology,
  • Emirates of Hacan flagship ability of adding 1 to die result,
  • The Crown of Thanlos Agenda card.

Some other notes and limitations:

  • 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 Sardakk Flagships into the battle (in game there is maximum one, obviously), their +1 effects won't be stacked,
  • I consider Virus Flagship 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.
  • When defender has Magen Defense Grid Ω and attacker is Naalu with Fighters participating in the Ground Combat, Fighters are considered vulnerable to Magen Defence hit. When defender has no defending units there is no Ground Combat and Magen Defense Grid Ω is not applied.

Code and some more info could be found on GitHub.

Thanks to:

  • Ling Weak, Edward Nickson, and L0ft3r​ – for various improvements to the calculator for the third edition of the game. This calculator is heavily based on that one.
  • Joakim Andersson (j.ason a⁣t live.se) – invaluable contribution to finding subtle miscalculations in Duranium Armor, Letnev and Jol-Nar flagships handling. Other great suggestions.
  • Alex Grant – the UI you are looking at.
  • Dan Johnson – Naalu fleet cost calculation fix.

Any suggestions and bug reports are welcome at ivan.bachtin@gmail.com

Version {{appInfo.version}}. Released {{appInfo.date}}.

Attacker
{{displayName(name)}}
Cost: {{costs.attacker.cost}}. Count: {{costs.attacker.count}}.
Defender
{{displayName(name)}}
Cost: {{costs.defender.cost}}. Count: {{costs.defender.count}}.
Technologies
Action Cards
Agendas / Promissory / Racial
Go to classical version