Discussion in 'Civ4 - Fall from Heaven' started by Kael, Dec 8, 2008.
me be excited!
excellent solution to the Archer situation, makes them feel more like proper archers now.
any way to add traits to a player in-game? Evil Marnok wants to punish players who make made decisions in events!
I am going to hijack this for my own uses!
Good, much neater! Especially the Bowyer.
Does this reveal treasure chests?
Al very welcome...
... especially this!
Excellent. Not that it bothers me particularly!
This is going to be the best xmas ever!
Ah good, I can stop using advanced start now.
Yeah, look at the Letum Frigus event for adding a trait to the Illians.
I'm actually wondering... Will attacking a stack with fireballs reduce their number of available defensive strikes?
If not... I may be forced to use summons a lot more... (-Hates using summons-)
Sorry for being so newbish, but what is a UU?
Even without scenarios, this looks way much better than changelog for 0.34. Great work!
Does that include the Sheaim Manticores? 13/9 seems a bit strong to be getting for just a Stable....
It's a unique unit. For example the Amurite Firebow which replaces the regular Longbow and is a unique replacement because of it's ability to cast Fireball when properly promoted.
Invisible workers. That's nice.
But I guess there is no way to upgrade old versions to ones with new promotions? Like, visit a city with the Adularia Chamber, and re-fit the golem with the promotion (maybe for a cost).
It almost seems like its not possible. Ive been playing ffh since the when i thought it couldnt get any cooler when there were mages that could cast fireballs in ffh1. ill be sad to see all the new ideas come to a conclusion.
You can account for it, the math just isn't entirely straigthforward. The simplest method is probably that you first calculate the expected damage from a strike, then subtract that from the attacker's starting strength (the combat odds already takes it into account if the attacker is damaged, so the subtraction part shouldn't be a big issue).
The expected damage is a bit trickier than a straightforward expected value calculation, but it's still doable. Let's use Kael's example and assume we have three longbowmen, two with a 30% and one with a 50% chance to defend. The % that none of them makes their roll is 70% * 70% * 50% = 24.5%. Conversely, the % that at least one of them makes their roll is 75.5%.
Now we need to estimate the damage done, assuming at least one of them succeeds. Since only the highest-hitting longbowman delivers the blow if multiple units make their roll, and he has an independent 50% to succeed, then we get straightforward result that there's a 50% chance for him to deliver the blow.
So we now have:
24.5% - nobody delivers damage
50.0% - drilled longbowman delivers damage
74.5% - sum of these two
Since all the sum of all probabilities must be 100%, this leaves us with a 25.5% chance that one of the two remaining crossbowmen manage to deliver the blow. So the expected damage is:
0.245 * 0 = 0
0.500 * 25 = 12.5
0.255 * 15 = 3.825
What if one of the two other longbowmen would've had a single drill promotion, so that'd we have longbowmen with the odds 30%, 40% and 50%?
In this case, the odds that nobody makes their roll would be 70% * 60% * 50% = 21%. The Drill II longbowman still has a 50% of delivering his hit, in which case the odds of the two others are irrelevant. The Drill I longbowman has a 40% chance of delivering his hit, but only if the Drill II longbowman fails in his attempt. The Drill 0 longbowman has a 30% chance of delivering his hit, but only if the Drill II and Drill I longbowmen both fail in their attempts. So
P(nobody delivers damage) = 21%
P(Drill II delivers the blow) = 50%
P(Drill I delivers the blow) = 40% * 50% = 20%
P(Drill 0 delivers the blow) = 30% * 60% * 50% = 9%
(The probabilities sum up to 100%, so we got this result correct.) Therefore the expected damage is:
0.21 * 0 = 0
0.50 * 25 = 12.5
0.20 * 20 = 4
0.09 * 15 = 1.35
One more case. What if, instead of one Drill II longbowmen, we'd had two? (and one with, say, Drill I) In that case, P(nobody hits) = 15%. If either of the two Drill II longbowmen hit, one of them delivers the damage. The probability that neither of them hit is 25%, so a 75% that at least one of them hits. That leaves us with a 10% chance that the Drill I longbowman is the one to deliver the blow.
0.15 * 0 = 0
0.75 * 25 = 18.75
0.10 * 20 = 2
So, how do we come up with an algorithm for computing the general case?
For n archery units with to-hit chance %n and damage Dn, the probability that nobody hits is the sum C(%1) * C(%2) ... * C(%n), where C( ) is the complement probability.
The probability that the unit with the highest damage delivers the blow is that unit's chance to hit. If there are several, the probability that at least one of them will deliver the blow is C(C(%h1) * C(%h2) * ... * C(%hn)), where "hn" stands for the highest-damage longbowmen.
The probability that the unit with the second highest damage delivers the blow is that unit's chance to hit times the probability that the highest hitter(s) didn't deliver the blow. If there are several, the probability that at least one of them will deliver the blow is C(C(%s1) * C(%s2) * ... * C(%sn)) * (C(%h1) * C(%h2) * ... * C(%hn)), where sn stands for the second-highest damage longbowmen.
The probability that the unit with the third highest damage delivers the blow is that unit's chance to hit times the probability that the highest and second highest hitter(s) didn't deliver the blow. If there are several, the probability that at least one of them will deliver the blow is C(C(%t1) * C(%t2) * ... * C(%tn)) * (C(%s1) * C(%s2) * ... * C(%sn)) * (C(%h1) * C(%h2) * ... * C(%hn)).
And so on. Then you just multiply the probability of each option with the damage it causes, sum the results, and use that as your expected damage.
(Somebody else can check my math for any mistakes - I probably have some, but I already spent too much time on this when I should be revising for an exam.)
will be happier when they can command colonies
at first glance nice, but on deeper thought I can hear alot of complaining when people start consistently start losing 99% battles that they expected to win, needs to be accounted for somehow in combat odds.
would have preferred they all remain, no need to eliminate them. esp. the brewery and adding the Deruptus Brewing House as a national wonder means trading ale is pretty useless by mid-game as everyone should have it.
thank you very much, more please
thank you, was kinda annoying
so i can teach sanctify and water 1 now? thank you
thank you very much
I stopped checking the actual numbers about half way down, but the concepts all look exactly right...nice work!
I wonder if Kael updated the combat odds calculator accordingly?
I'm assuming this isn't the final version. Am I correct? There will be updates to make sure this works and then a finalized version 1.0, right?
This is the final version, but they will likely be patching until they have to use lettters from the Nahuatl alphabet to identify them.
so true so true
so why not call it version 1.0 if it's supposed to be the full final release?
cuz it's already version 2.4
no, it's #2 version 0.40 as the download says. Don't ask me why, but it feels wrong to call it anything but version 1.00
Separate names with a comma.