Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Civ3-Democracy Game-Archive > Combat Results Math...
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Arnelos is offline Arnelos
Emperor
of the Free World
Sep 2002
time: 00:22
  Old Post 23-09-2002 05:32
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Combat Results Math... Support Apolyton, pre-order Civilization IV

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 is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 08:45 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Got spare money?

It's great, Arnelos. Useful spreadsheet!
Btw, some of us like Mathy stuff...

Zero is offline Zero
King
Bouncing back and forth
Sep 2002
time: 00:22
  Old Post 23-09-2002 09:20
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Civilization 2

as long as integration by parts is involved....

MrWhereItsAt is offline MrWhereItsAt
Emperor
New Year's Resolution: 2005 is the year of Where It's At - come get some.
Nov 2001
time: 17:22
  Old Post 23-09-2002 12:21
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

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.

BigFurryMonster is offline BigFurryMonster
Emperor
EMPEROR of Cats
Feb 2002
time: 06:22
  Old Post 23-09-2002 12:29 Visit BigFurryMonster's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Get a bigger avatar today!

I have the impression that, during a fight, if you start losing individual rounds of battle, the probability of losing the next is higher (put in other words: the battle victories are clustered somehow).

Anyone can confirm this observation?

DAVOUT is offline DAVOUT
King
AUERSTADT
Jun 2002
time: 05:22
  Old Post 23-09-2002 12:40
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

I confirm this impression, but I believe it is only an impression (psychology : Ah ! bad start ...).

Others impressions :
- a unit alone loose frequently battles against weaker units.
- elite units behave worse than veteran units.
But that is certainly due to psychology : we forget the percent of possible loss, and we expect too much of elite.

Shiber is offline Shiber
Emperor
Haifa, Israel
Jul 2002
time: 07:22
  Old Post 23-09-2002 14:45
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Bah, I figured all along that my equation is inaccurate and I knew why, I just didn't know how to factor those elements of combat in. I'm still as far advanced as highschool math.
Anyway, thanks for providing us with a much more accurate system to predict combat results!

jdd2007 is offline jdd2007
King
Cincinnati
Aug 2001
time: 00:22
  Old Post 23-09-2002 15:16 Visit jdd2007's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Tired of ads?

quote:
Originally posted by BigFurryMonster
I have the impression that, during a fight, if you start losing individual rounds of battle, the probability of losing the next is higher (put in other words: the battle victories are clustered somehow).

Anyone can confirm this observation?


it does seem like that, but it isnt true. neither is the 'hot hands' myth in basketball.

Shiber is offline Shiber
Emperor
Haifa, Israel
Jul 2002
time: 07:22
  Old Post 23-09-2002 15:30
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Actually, I understand that some long-abandoned algorithms for generating random numbers did often spit out clusters of close numbers, but that's not what Civ III uses.
AFAIK Civ III's battles are fed by Windows' randomizer, which gives fairly spread results.

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 17:36 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

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!

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 17:57 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by BigFurryMonster
I have the impression that, during a fight, if you start losing individual rounds of battle, the probability of losing the next is higher (put in other words: the battle victories are clustered somehow).

Anyone can confirm this observation?



It's just an impression, BFM. However, this is the fun about statistics: one result don't depends of the other...

BigFurryMonster is offline BigFurryMonster
Emperor
EMPEROR of Cats
Feb 2002
time: 06:22
  Old Post 23-09-2002 18:03 Visit BigFurryMonster's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

Yes. Unless the random generator is somehow 'biased' towards clustered outcomes. In Computer Science, a lot of discussion has been going on on the 'randomness' of random generators.

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 18:13 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton buy from Amazon

I don't really believe in an unbiased Universe. God not only plays dices with the universe, He cheats! See how the quantum mechanics works...

Epistax is offline Epistax

Prince
of Bananas
May 2001
time: 00:22
  Old Post 23-09-2002 18:17
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

I have to wonder about that as well.

I think some defenders of cities are granted unholy strength (or maybe that would be holy, I dunno, I'm the attacker).

I have lost so many tanks / modern armors to fighting a single city with a rifleman before, it just isn't funny. I'll be sweeping a nation, getting every city every time in the first shot, then I'll get to one city, and it will take ten tanks to bring it down even though their defense is no better.


Is this a bug in the game, or am I fighting william wallace?

GhengisFarb is offline GhengisFarb
Deity
I want my HAMBURGERS!!
May 2002
time: 23:22
  Old Post 23-09-2002 18:22 Visit GhengisFarb's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Browse Apolyton AD-FREE

quote:
Originally posted by Epistax
I have to wonder about that as well.

I think some defenders of cities are granted unholy strength (or maybe that would be holy, I dunno, I'm the attacker).

I have lost so many tanks / modern armors to fighting a single city with a rifleman before, it just isn't funny. I'll be sweeping a nation, getting every city every time in the first shot, then I'll get to one city, and it will take ten tanks to bring it down even though their defense is no better.


Is this a bug in the game, or am I fighting william wallace?

I don't hear anyone complaining when its their William Wallace.

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 18:25 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Got spare money?

You can cheat with random generators, just introducing a counter in the function... after "x" victories, a new function replaces the old one; after a lot of damage in YOUR troops, the old functions comes back and the things seems "normal" again. There's a lot of other ways.
Btw, Firaxis is always cheating... Just kidding, Mike!

DAVOUT is offline DAVOUT
King
AUERSTADT
Jun 2002
time: 05:22
  Old Post 23-09-2002 18:28
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton buy from Amazon

You are right Aro, the Universe is biased, as all machines are. It produces only heavy atoms from pure energy, through a process in which we appear for a reason we have still to find. Are we designed to help the process, or are we just an inocuous defect ? And in all case are we able to perturb the process enough in order to bring the machine owner to let us go outside ?

Epistax is offline Epistax

Prince
of Bananas
May 2001
time: 00:22
  Old Post 23-09-2002 18:35
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:
Are we designed to help the process

no
quote:
, or are we just an inocuous defect ?

yes
quote:
? And in all case are we able to perturb the process enough in order to bring the machine owner to let us go outside ?

no

now may I please have some pop tarts?

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 18:41 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Browse Apolyton AD-FREE

Brillant, Davout. The Universe, our brains and Math have the same structure... This is why we are able to describe the "nature of things". IMO, we are designed as a part of this, maybe (I don't say "No" or "yes" to this) to understand. And, of course, to perturb the process. Knowledge is our punishment and our redemption.

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 18:44 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton, buy Civilization 2

quote:
Originally posted by Epistax

now may I please have some pop tarts?


But, Epistax... we have a lot of geeks and nerds here, this is a pop tart!

BigFurryMonster is offline BigFurryMonster
Emperor
EMPEROR of Cats
Feb 2002
time: 06:22
  Old Post 23-09-2002 18:46 Visit BigFurryMonster's homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Increase Your PM Length

Uh-oh. Now it gets philosophical...

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 18:50 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by BigFurryMonster
Uh-oh. Now it gets philosophical...

You're right. Shoot the philosophers!
"Philosophers, think about yourselves"...

Epistax is offline Epistax

Prince
of Bananas
May 2001
time: 00:22
  Old Post 23-09-2002 18:52
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Increase the size of your Attachments

No I meant a strawberry pop tart.

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 19:58 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

All we have are banana pop tarts and grape pop tarts. We're in Apolytonia...

Aggie is offline Aggie
King
Of GOW's half of BOB
Jun 2002
time: 23:22
  Old Post 23-09-2002 20:30
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Full PM-box? Change here!

Actually this game gives us a golden opportunity so see if things work out pretty much as they should. We can keep track of not only individual battles but also of each "hit point fight". We can see if they do truly go in steaks and even see if successive battles go in streaks. We all have antedotal evidence that hit points tend to go like this attacker win(w),w,w,l,l,l,w or such. We now can verify it. Additionally It also seems that the overall battles go this way. Look at us here. We went through a period where we couldn't be beat, then we lose troops in the atatck on pasargadae. Also we can see if over the whole game we do get a GL on average 1/16 of the time an elite attacks. In short this game is the embodyment of a lab on civ3 statistics. Heck we can even be like they are in baseball and figure winning streaks etc. I have only scratched the surface.
Aggie

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 20:53 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Great, Aggie! You really found something here.

BigFurryMonster is offline BigFurryMonster
Emperor
EMPEROR of Cats
Feb 2002
time: 06:22
  Old Post 23-09-2002 21:21 Visit BigFurryMonster's homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Support Apolyton buy from Amazon

Which Statistician would take up such a challenging task?

Aro is offline Aro
Emperor
Ipanema
Jul 2002
time: 02:22
  Old Post 23-09-2002 21:29 Visit Aro's homepage!
Edit/Delete Message Reply w/Quote
#28 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by BigFurryMonster
Which Statistician would take up such a challenging task?



Reddawg will have the same problem I have... Big requests and small staff...

Arnelos is offline Arnelos
Emperor
of the Free World
Sep 2002
time: 00:22
  Old Post 24-09-2002 01:08
Edit/Delete Message Reply w/Quote
#29 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

It sounds like a project for a team of us... I don't think any of us want to even attempt that one alone due to the sheer amount of data you've have to be sloshing through.

OPD is offline OPD
King
Birmingham UK
Jun 2002
time: 05:22
  Old Post 24-09-2002 02:16
Edit/Delete Message Reply w/Quote
#30 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

for anyone interested

I have studied stats a bit but at the end of the day you win some you loose some and thats about it.

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:22.
Apolyton Time is 00:22.
    top of page
Rate This Thread:
archivepost
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0635 seconds (92.03% PHP - 7.97% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net