 |
|  |
 |
|
Arnelos
|
 |
of the Free World
Sep 2002 time: 00:22
|
|
Ok, I went to the trouble of looking up how Civ3's combat probability works (to the best of anyone's knowledge online) and then used my handy-dandy probability spreadsheet (which I have used for other games where probabilities of this sort are required) and worked out the actual chances of stuff.
It turns out the the civulator created by a guy on CivFanatics (which I tested against my model) works exactly the same way and spits out the same result. By contrast, the equation Shriber was using is *not* accurate.
The reality is that you have to use either Pascal's triangle as a data set for a series of fairly complex calculations (my formula for each cell in the spreadsheet is below) or you have to use a series of factorials and other stuff like that (which is what the "Civulator" uses), essentially the same calculation.
First of all, the chance of the attacker winning any individual round of combat is the same as Civ1:
a = attacker's modified attack rating
d = defender's modified defense rating
% = a/(a+d)
To determine the result of an entire combat for two units with given hitpoints as well as modified attack/defense ratings is a hellishly complicated thing to do.
Just to give you a glimpse of how I set up my spreadsheet, here's the fomula for individual cells (each cell representing the chance that a certain number of hits will be scored by the attacker in a given number of rounds):
c = % chance of attacker winning a single round
r = maximum # of possible rounds for this combat
h = # of rounds won by attacker (of maximum # of rounds)
k = appropriate number from Pascal's triangle
% = [(c)^(h)]*[(1-c)^(r-h)]*k
------------
To give you an example... I'll use the combat we were debating about during the turnchat earlier today...
An Elite (5/5) Apolytonian Pikeman (1/3/1) attacks a Regular (3/3) Persian Archer (2/1/1) on a jungle tile. The jungle tile gives the Persian Archer a 25% bonus to defense, so its modified defense rating is 1.25, where the Apolytonian Pikeman's modified attack rating is 1, the same as its base attack rating.
a = 1
d = 1.25
c = a/(a+d) = .4444 (rounding)
c = .4444
The value of r is defender's hp + attacker's hp - 1
so r = (3)+(5)-1 = 7
r = 7
The values for h and k are determined case-by-case as we determine the chance for a specific number of attacker wins (h) -vs- the total number of possible rounds (r).
In this case, we have 8 different cases to examine, one each for values of h from 0 through 7. Now, It is not possible for the attacker to even *make* anything more than 3 hits, but for purposes of determining the probability of a "win" for the attacker, 3+ hits are a "win" since the extra "hits" simply represent that the combat might have ended more quickly than maximum possible 7 rounds.
Here's the calculation for each individual case:
c = % chance of attacker winning a single round
r = maximum # of possible rounds for this combat
h = # of rounds won by attacker (of maximum # of rounds)
k = appropriate number from Pascal's triangle
% = [(c)^(h)]*[(1-c)^(r-h)]*k
****0/7 attacker wins (defender victory)****
k = 1
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*1
% = 1.63%
****1/7 attacker wins (defender victory)****
k = 7
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*7
% = 9.15%
****2/7 attacker wins (defender victory)****
k = 21
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*21
% = 21.96%
****3/7 attacker wins (attacker victory)****
k = 35
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*35
% = 29.27%
****4/7 attacker wins (attacker victory)****
k = 35
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*35
% = 23.41%
****5/7 attacker wins (attacker victory)****
k = 21
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*21
% = 11.24%
****6/7 attacker wins (attacker victory)****
k = 7
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*7
% = 3.00%
****7/7 attacker wins (attacker victory)****
k = 1
% = [(.4444%)^(0)]*[(1-.4444)^(7-0)]*1
% = 0.34%
Now, adding up the cases of defender victory and attacker victory seperately:
attacker victory: 67.26%
defender victory: 32.74%
----------------------------------
Now, the good news is that you don't have to do all that math on your own . The civulator that someone on CivFanatics created actually does these calculations for you (though in a different way than I have) and just spits out the results of each of those cases (you still have to tally the cases of attacker victory -vs- defender victory yourself). My spreadsheet is much the same, but it's significantly less user friendly (I designed it for my own use...).
The reason why Shriber's calculations didn't work was that his system for determining the victor of a full combat was too simple (he multiplied the modified attack rating by the attacker's hp and the modified defense rating by the defender's hp). The reality is that the multiple rounds of combat caused by having multiple hitpoints make the situation many times more complex.
I strongly suggest that at least one person who will be around for turnchats go take a visit to CivFanatics or somewhere else to pick up a copy of the Civulator spreadsheet (I think OPD apparently already has one). Conversely, if I'm around, I'll just use my spreadsheet (I like mine better, though it spits out the exact same results :-) ).
That's all for now. Sorry for the obsessively long post with all the mathy stuff...
|
|
|  |
 |
|  |
 |
|
Aro
|
 |
Ipanema
Jul 2002 time: 02:22
|
|
quote: Originally posted by MrWhereItsAt
What, no separation of variables? Dirac delta functions? Hilbert spaces?
NO FOURIER SERIES?!?!?! 
Very interesting, though. I have read and at one time downloaded the Combat Calculator, but somehow you make it seem so much less boring to read, Arnelos.
Excellent thread. |
Well, you are using Fourier series (not exactly you, but the numeric processor of your computer... ). Unfortunately, no complex variables. Some topology, maybe.
About Dirac... try some impulse functions... One integral here, another there...
Are you complaining about Hilbert? What about Riemann?
Here’s a little poem about my beloved zeta function:
Where are the zeros of zeta of s?
G.F.B. Riemann has made a good guess;
They're all on the critical line, saith he,
And their density's one over 2 pi log t.
This statement of Riemann's has been like a trigger,
And many good men, with vim and with vigour,
Have attempted to find, with mathematical rigour,
What happens to zeta as mod t gets bigger.
The efforts of Landau and Bohr and Cramer,
Littlewood, Hardy and Titchmarsh are there,
In spite of their effort and skill and finesse,
In locating the zeros there's been little success.
In 1914 G.H. Hardy did find,
An infinite number do lay on the line,
His theorem, however, won't rule out the case,
There might be a zero at some other place.
Oh, where are the zeros of zeta of s?
We must know exactly, we cannot just guess.
In order to strengthen the prime number theorem,
The integral's contour must never go near 'em.
Let P be the function minus Li,
The order of P is not known for x high,
If square root of x times log x we could show,
Then Riemann's conjecture would surely be so.
Related to this is another enigma,
Concerning the Lindelöf function mu sigma.
Which measures the growth in the critical strip,
On the number of zeros it gives us a grip.
But nobody knows how this function behaves,
Convexity tells us it can have no waves,
Lindelöf said that the shape of its graph,
Is constant when sigma is more than one-half.
There's a moral to draw from this sad tale of woe,
which every young genius among you should know:
If you tackle a problem and seem to get stuck,
Use R.M.T., and you'll have better luck.
Words by Tom Apostol (revised cph
They don't do math nowadays like they did yesterday...
Note: Math could be extremely literary…
Btw, excellent thread.
Note 2: Delicious nonsense....
Note 3: Tech spam is fun!
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|