Difference between revisions of "User talk:PocketUFOPlayer?"

From UFOpaedia
Jump to navigation Jump to search
(Created page with "==Re: kill chance== The chance for a weapon of power P to kill a creature with health H, armour A and damage modifier M is (floor(P * 1.5) - ceiling((H + A)/M) + 1)/(P + 1)....")
 
(tnx)
Line 4: Line 4:
  
 
These are exactly correct for hitting aliens, or for X-Com units hit during the X-Com turn. However, in practice the chance to kill X-Com units during the alien turn will be higher because fatal wounds may kill them before a medikit can be applied (you can't use them during the alien turn, so they're guaranteed to take damage at least once). Compensating for that exactly makes the formula ''much'' longer, but you can ballpark it by reducing H by 2 (there's a 100% chance of death with 1 health remaining, a 2/3 chance with 2 health, and 1/3 with 3 health; the reason this isn't exact is because rounding errors from non-100% damage modifiers may make the chance of 2 health left different from the chance of 3 health left). [[User:Magic9mushroom|Magic9mushroom]] ([[User talk:Magic9mushroom|talk]]) 06:35, 16 March 2019 (CET)
 
These are exactly correct for hitting aliens, or for X-Com units hit during the X-Com turn. However, in practice the chance to kill X-Com units during the alien turn will be higher because fatal wounds may kill them before a medikit can be applied (you can't use them during the alien turn, so they're guaranteed to take damage at least once). Compensating for that exactly makes the formula ''much'' longer, but you can ballpark it by reducing H by 2 (there's a 100% chance of death with 1 health remaining, a 2/3 chance with 2 health, and 1/3 with 3 health; the reason this isn't exact is because rounding errors from non-100% damage modifiers may make the chance of 2 health left different from the chance of 3 health left). [[User:Magic9mushroom|Magic9mushroom]] ([[User talk:Magic9mushroom|talk]]) 06:35, 16 March 2019 (CET)
 +
 +
Thanks for the clarification, if I was more skilled in python I would attempt to factor more of this in however I'm mostly doing this for practice to get accustomed with the language and thought why not upload it here. [[User:PocketUFOPlayer?|PocketUFOPlayer?]] ([[User talk:PocketUFOPlayer?|talk]]) 09:21, 19 March 2019 (CET)

Revision as of 08:21, 19 March 2019

Re: kill chance

The chance for a weapon of power P to kill a creature with health H, armour A and damage modifier M is (floor(P * 1.5) - ceiling((H + A)/M) + 1)/(P + 1). This is true for explosions in UFO and all weapons in TFTD; for ballistics in UFO the chance is instead (P * 2 - ceiling((H + A)/M) + 1)/(P * 2 + 1). If you instead want the chance that the hit does any damage at all, replace H with 1 in those formulae.

These are exactly correct for hitting aliens, or for X-Com units hit during the X-Com turn. However, in practice the chance to kill X-Com units during the alien turn will be higher because fatal wounds may kill them before a medikit can be applied (you can't use them during the alien turn, so they're guaranteed to take damage at least once). Compensating for that exactly makes the formula much longer, but you can ballpark it by reducing H by 2 (there's a 100% chance of death with 1 health remaining, a 2/3 chance with 2 health, and 1/3 with 3 health; the reason this isn't exact is because rounding errors from non-100% damage modifiers may make the chance of 2 health left different from the chance of 3 health left). Magic9mushroom (talk) 06:35, 16 March 2019 (CET)

Thanks for the clarification, if I was more skilled in python I would attempt to factor more of this in however I'm mostly doing this for practice to get accustomed with the language and thought why not upload it here. PocketUFOPlayer? (talk) 09:21, 19 March 2019 (CET)