Talk:Base Defence Systems

From UFOpaedia
Jump to: navigation, search

I added some info about TFTD to the article since it talks about TFTD too. I noticed though that some of the info conflicts with Base_Defense (TFTD) article. e.g. here it says the item limit has been raised to 110, there it says the limit is still 80. Anyhow, I can verify there's a sorting algorithm from my experience, but not much further. I wonder if it may end up preferring unresearched guns for example.. Cesium 20:02, 30 December 2009 (EST)

Hadn't realized that there was a page for TFTD. I just corrected it to 110 (this number is actually from the Unofficial Strategy Guide but from what I recall it is correct). About the sorting algorithm I can't confirm it. Hobbes 20:40, 30 December 2009 (EST)
I just ordered a lot of Jet Harpoons, Dart Guns and Chemical Flares to a base and let the aliens find it. The equipment available in the load screen was mainly Sonic Rifles and Sonic Cannons. The Darts, Jets and Flares were not available. Something has to account for the quartermaster being sane, and we do know some attention was given to base defense (since the item limit was raised). I guess only way to be sure is for someone to disassemble the executable and examine the code.... Cesium 09:35, 31 December 2009 (EST)
Well the quartermaster is mostly sane. However it does not check if you have researched the clip before it packs the shiny new Sonics. So be sure to move them out if you have not or you might end up with lots of guns without ammo. If you want Medikits be sure to reduce the number of spare weapons--Tauon 19:32, 16 October 2010 (EDT)

Not sure the 110 number for TFTD is technically correct. When I try to load more than 80 items on a craft I still get a warning. --Zombie 22:31, 30 December 2009 (EST)

The limit for weapons being carried in craft is still 80 but for the base defense missions the game allows for 110 items. Hobbes 22:56, 30 December 2009 (EST)


Penetration Math

"...Missile/Torpedo Defences are the most cost-effective of the defensive base facilities. The odds of penetrating 12 such modules and a Grav/Bombardment Shield are 30 to 1. On average, 30 attack ships will be destroyed before one gets through. Such a system costs $3.7 million. For the same price, 3 Fusion Ball/P.W.T. Defences with a Grav/Bombardment Shield will offer only 9 to 1 protection..."

Huh? Where is this math coming from? From the way I understand it, it's a simple binomial distribution (at least for exclusively one type of base defense module).

In order to bring down a battleship (3200 hits) you need to connect 7 rounds from a missile defense (500 damage). With 12 missile defenses and a grav shield, you have 24 bernoulli trials with a 50% probability of success. The probability of 6 successes or fewer out of 24 trials at 50% I believe is ~0.01133, or 1 out of about 88 ships getting through your defenses. I calculated this in excel via =BINOM.DIST(6,24,0.5,TRUE) so I am confident it is correct.

In the fusion ball case, I believe it is 2 or fewer successes out of 6 trials with 80% probability, =BINOM.DIST(2,6,0.8,TRUE), 0.01696, or 1 out of about 59 ships getting through.

While the original point still stands with my math (missile is more cost effective than fusion), the odds of penetrating either setup are greatly reduced, as is the difference between the performance of the two. Perhaps I do not properly understand the mechanics of base defense modules, or screwed up my thinking or math somewhere along the way.

--Jewcifer 12:57, 16 March 2012 (EDT)

I'm not sure if the page mentions it (I've only got time for a quick skim right now), but to further complicate matters the amount of damage the defences do per-shot is randomised. I think it goes from about 50% to 150% of their rated power, can't remember if I was ever able to confirm an exact range. Seven shots from a missile defence may not be enough to down a battleship. -  Bomb Bloke (Talk/Contribs) 17:39, 16 March 2012 (EDT)
Hmmm, I have seen no mention of variable damage either in-game or anywhere on this wiki (I've been reading through it quite extensively for months before finally getting around to signing up a couple days ago). I think that information should be determined and put somewhere (this article is probably as good a place as any for it). I'm not likely to do that myself (would probably require either extensive simulation or disassembling and hunting through the executable code to determine the range?), but if anyone else does I will run the different calculations appropriately. If the range is 50%-150% it should be only slightly more likely for ships to penetrate in these cases (but not nearly enough to account for the discrepancy), but perhaps if the range is more like 50%-100% (like craft weapons) they would match up with what's in the article. --Jewcifer 12:24, 21 March 2012 (EDT)
I am 100% sure that damage to UFOs from base defences is variable. I have seen Battleships both die and not die from 2 hits with a Fusion Ball Defence while I was using the Battleship Farming exploit. Magic9mushroom 18:19, 21 March 2012 (EDT)
Indeed, a defense module may deal more then 100% of its rated damage. I've seen two fusion ball shots take out a battleship, and I've seen some require four - the vast majority drop after three. This "proves" a minimum range of 66%-133% (the damage averages required to achieve 2-4 hit take-downs), which strongly suggests the actual range is 50%-150%.
Much of the information on this wiki is written off the top of someone's head, especially articles like this one that deal less in hard statistics and more on handing out strategies and tactics (it doesn't even mention how much damage needs to be done to shoot down a battleship!). Many such errors are only corrected when newcomers come along and spot them. There are plenty there, though, so don't be afraid to question anything you see or correct anything you are certain to be wrong. -  Bomb Bloke (Talk/Contribs) 04:42, 22 March 2012 (EDT)
Thanks guys. Initially I tried to work out a mathematical approach using the probability density function of an irwin–hall distribution, but dealing with variable n due to the accuracy aspect made it way too complicated and confusing for me to handle. Yikes.
So I did what any sensible programmer would do and wrote a quick script to run monte carlo simulations of x-com base defense. I ran 1,500,000 simulations of both of the above scenarios for damage ranges of 100%-100%, 50%-100%, 50%-150%, and 0%-200% (using a discrete uniform distribution within the range). The output is the damage range formula used, the base defense setup (i.e. number of shots, damage, and accuracy), and the average number of attacking ships needed for one to get through:
100%-100%
24 shots,	500 damage,	50% accuracy:
89.46 ships
6 shots,	1200 damage,	80% accuracy:
59.12 ships

50%-100%
24 shots,	500 damage,	50% accuracy:
11.63 ships
6 shots,	1200 damage,	80% accuracy:
07.88 ships

50%-150%
24 shots,	500 damage,	50% accuracy:
67.75 ships
6 shots,	1200 damage,	80% accuracy:
25.19 ships

0%-200%
24 shots,	500 damage,	50% accuracy:
31.32 ships
6 shots,	1200 damage,	80% accuracy:
10.86 ships
Nicely enough, the 100%-100% numbers (fixed damage) match my earlier calculations reasonably well, and it seems the 0%-200% numbers are very close to what is in the article! So I think unless someone verifies or is already quite confident the damage range is something other than 0 to double, or maybe has some non-uniform distribution, I'll leave it alone.
I do think this article should mention somewhere that the damage is a variable range. Perhaps go ahead and say 0%-200%, with a note that this maybe should be verified?
Thanks again for the replies!
--Jewcifer 11:36, 29 March 2012 (EDT)

Monte Carlo method should be able to find the damage range, actually. Given a save with a Battleship inbound on a base with 10 Fusion Ball Defences + Grav Shield, one would save-scum (or just keep playing while leaving the Battleship swarms alone) and record the number of Fusion Ball hits needed to down the Battleship on each attempt. If it's 50%-150% (as I suspect it is), then the chance in Collector's Edition (3000 Battleship health) should be 1/8 (12.50%) to down it in two hits, 5/6 (83.33%) to down it in three hits or less, and 383/384 (99.74%) to down it in four hits or less (five hits gives certainty). In DOS (3200 Battleship health) it should be 1/18 (5.56%) to down it in two hits, 241/243 (99.18%) to down it in four hits or less and 933119/933120 (99.9999%) to down it in five hits or less (six hits gives certainty; three hits is more complicated and I CBF doing it right now). If it's 0%-200% then the chance to down it in two hits should be 9/32 (28.12%) in CE and 2/9 (22.22%) in DOS, the chance to down it in three hits or less should be under 5/6 (83%), the chance to down it in four hits should be under 23/24 (96%) and the chance to down it in five hits should be under 119/120 (99.2%) (in all cases by a decent margin, since that's actually the chance of doing under 2400 damage). My recollections don't match that latter set of numbers (I've never seen four hits fail to down a Battleship in CE, and two-hit kills are fairly rare) but I could be wrong. Magic9mushroom (talk) 02:22, 18 February 2016 (EST)

After analyzing the CE code, it seems the damage range is 50-150%. - Tycho (talk) 03:52, 20 February 2016 (EST)