XCOM Kill Probability Calculator

Calculates the probability of killing an enemy in the video game XCOM: Enemy Within.
269 Downloads
Updated 7 Aug 2014

View License

kill_prob = xcom_kill_probability(enemycurrenthp,weapon,phit,pcrit,haveip3,issectopod)
A handy calculator for use with the video game XCOM: Enemy Within.
Calculates the probability of killing a given enemy based upon the enemy's
current health, your soldier's current weapon, hit and critical probabilites, and other
information.
enemycurrenthp = the enemy's current health. The actual enemy type is
irrelevant, except for the Sectopod and the Ethereal.

weapon = a string, specifying the weapon your soldier currently has
equipped. All weapon names are the same as written in the game, with a
capital letter beginning each distinct word, and no spaces. For example:
'PlasmaSniperRifle'
'HeavyLaser'
'PlasmaPistol'
'LMG'
'ParticleCannon'
The program accepts all primary weapons, including MEC weapons; explosives
and rocket launchers are not accepted.
(See the xcom_weapon_data.m file if you aren't sure how to enter a
particular weapon name.)

phit = the probability to hit the targeted enemy; the game tells you this
at the bottom of the screen when targeting enemies.

pcrit = the probability of scoring a critical hit on the targeted enemy.
The game tells you what pcrit is at the bottom of the screen.

haveip3 is "Have Improved Pistol III?". Improved Pistol III adds 1 damage
on to all pistol shots, so if you have it and are using a pistol for the
weapon, put true; otherwise put false.

issectopod = true if the enemy you are attacking is a Sectopod.
Sectopods have a special buff in Enemy Within called "Reinforced Armor",
which halves all incoming damage, rounded up.

The only other relevant enemy type is the Ethereal, who has a chance to
reflect incoming attacks back at your soldier. Unfortunately, I could not
find hard numbers on how much this reduces the damage dealt to the
Ethereal, or the probability of reflection.

How about an example? Let's say I am targeting a Sectoid with an Assault
Rifle, and he is at full health on Classic difficulty. What are my odds of
killing him with a 62 chance of hit, and 10 chance of critical?
kill_prob = xcom_kill_probability(3,'AssaultRifle',0.62,0.1,false,false)
kill_prob =

0.4340

Or a 43.4% chance of killing him. Its up to you though to decide if the
risk of missing is worth the reward of killing him! :)

Likewise again, what if I am targeting a Sectopod with 8 health remaining
with Heavy Plasma, a 83 chance to hit, and 20 chance of critical hit?
We'll assume I do not have the HEAT Ammo skill.
kill_prob = xcom_kill_probability(8,'HeavyPlasma',0.83,0.2,false,true)

kill_prob =

0.1107

Or 11.07%. Against a Sectopod, with these odds, I recommend a
"strategic retreat." ;)

This code does NOT account for the effects of HEAT Ammo, Bring'Em On, Shredder Rocket, or Killer Instinct. Also currently does not have input for SHIV, SHIV Laser, or SHIV Plasma. Does not have capability for working out kill probabilities for Rapid Fire, as well the probabilities for Rapid Fire and Executioner working in tandem. Also does not have inputs for when firing on enemies with a Mind Controlled alien. Working on it! ;)

Enjoy! Hope this takes alot of the "guesswork" out of the game for you
guys. :)

XCOM Kill Probability Calculator (c) August 4, 2014, Bradley James Ridder.

Cite As

Brad Ridder (2024). XCOM Kill Probability Calculator (https://www.mathworks.com/matlabcentral/fileexchange/47449-xcom-kill-probability-calculator), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Video games in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.2.0.0

Also forgot that this doesn't work with Mind Controlled aliens! ;)

1.1.0.0

Edited the release notes with more missing features that I will try to add at a later date, related to SHIVs and various buffs and debuffs that can alter kill probabilities.

1.0.0.0