Thread Tools
Old November 27, 2001, 09:45   #1
boojumhunter
Chieftain
 
boojumhunter's Avatar
 
Local Time: 12:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Toronto, Canada
Posts: 31
A Combat question
Hi folks,
A simple enough question.
In combat... who gets to inflict damage first? The attacker or the defender?
The implication is rather significant. Two equally matched opponents... each with 1 hit point left... and a 50% chance of inflicting damage... the one with the initiative has a huge advantage.

I'm writing a little basic program (which I'll post) to simulate 10,000 battles for each of the 25 possible situations between 2 units... ie. 1 hp vs 1,2,3,4,5 hps, 2 hp vs 1,2,3,4,5 hp etc. etc. providing the chance of winning for each encounter... all you do is enter the modified 'attack' strengths for each of the two units... BUT it REALLY matters who hits who first...

Here's a sample assuming the attacker has the advantage.

attacker chance to hit: .5
defender chance to hit: .5
Atk 1 vs. 1 -- 6696/3304 66.96% wins <--- if the defender had the advantage? this is different...
Atk 1 vs. 2 -- 2178/7822 21.78% wins
Atk 1 vs. 3 -- 715/9285 7.15% wins
Atk 1 vs. 4 -- 242/9758 2.42% wins
Atk 1 vs. 5 -- 76/9924 0.76% wins
Atk 2 vs. 1 -- 8903/1097 89.03% wins
Atk 2 vs. 2 -- 6029/3971 60.29% wins
Atk 2 vs. 3 -- 2989/7011 29.89% wins
Atk 2 vs. 4 -- 1279/8721 12.79% wins
Atk 2 vs. 5 -- 506/9494 5.06% wins

the final program will lay hese results out in a nice 'grid'
But... I first need the answer to who draws first blood? Attacker or defender?

Peter
boojumhunter is offline  
Old November 27, 2001, 10:12   #2
Bobstah
Settler
 
Local Time: 17:35
Local Date: October 31, 2010
Join Date: Nov 2001
Posts: 4
No one attacks first. Combat is based on rounds. The percentage chance is to win a round rather than to a score a hit.

Your task is sadly a fool's errand because combat is not as simple as attack and defence values. There is the phenomenom of 'streakiness' to account for.

Have a look at the 'Random number generator has to be broken' thread.
Bobstah is offline  
Old November 27, 2001, 10:27   #3
Bobstah
Settler
 
Local Time: 17:35
Local Date: October 31, 2010
Join Date: Nov 2001
Posts: 4
This is the streakiness thread:
<The random number generator has to be broken >

This next thread is about the format of combat.
i.e Chance of hit vs. Rounds.
<Do we have combat all wrong>
Bobstah is offline  
Old November 27, 2001, 10:34   #4
Excelsior
Warlord
 
Excelsior's Avatar
 
Local Time: 11:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Alabama
Posts: 162
And this is my thread about testing the streakiness of combat.

Semi-Scientific Study of the Civ3 Random Number Generator
Excelsior is offline  
Old November 27, 2001, 10:41   #5
Excelsior
Warlord
 
Excelsior's Avatar
 
Local Time: 11:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Alabama
Posts: 162
BTW, boojumhunter, I wrote a program that determines the results of as many simulated battles as you want with specified attack, defense, and hitpoints. I can upload it if you want it.
Excelsior is offline  
Old November 27, 2001, 10:44   #6
boojumhunter
Chieftain
 
boojumhunter's Avatar
 
Local Time: 12:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Toronto, Canada
Posts: 31
It's always interesting to see how single paragraphs can be read differently by different people.
On pg 82 of the manual there's the following paragraph...

"The total modified attack and defence factors are combined and the probability of either side winning is approximately the ratio of each side's factors compared to this total. For example, if a Knight (attack factor of 4) attacks a spearman (defence factor of 2), the total of the factors is 6 (4+2). The Knight has about a 66% change (4 out of 6) of winning each round."

Now a Knight is 4.3.2 the Spearman is 3.2.1

When a K. attacks a S. I understand the chance of winning a 'round' is 4/(4+2)... 66.6% as outlined in the above paragraph...
BUT... by the same reasoning
When a S. attacks a K.The S's chance of winning a 'round' is 3/(3+3)... 50%

I saw combat existing as a series of rounds... (as clearly stated in the book)
BUT... with a slightly different reading... ie.
First 'round'... 66.6% chance of the 'attacker' winning the round... if he 'loses' the round... no dame is taken by eaither side.
Next 'round'... a 50% chance of the 'defender' winning the round... and so on, until one of the units is beaten down to 0 hit points.

Which interpretation is correct? It's not clear to me from either the manual provided or the (necessary) strategy guide that there's a clear answer to this question. And... I've seen neither the source code of CIV3 or heard directly from a designer on this issue. Everything else is speculation.

Also... while it is difficult to be certain... it does seem to me that some rounds (according to the animated graphics) do result in no damage to either side. That could be an illusion or a result of my weakening eyesight.

I also make my interpretation by paying special attention to the emphasis on the phrase "each side's factors"... implying that the 'factors' are different for each side...

As to the random number generator in Civ3 being broken? Again that's not clear to me either. A lot of posters are claiming that because their attempts to get a 'better' result by reloading, are yielding the exact same result is merely their lack of understanding about how Random number seeds work. Also? The concepts of winning & losing 'streaks' is a well known and highly documented flaw in human perception. It takes an awful lot of raw data to confirm that a random number generator is flawed in this manner. But of course... it's more than possible.

And besides, whether or not the CIV3 random generator is broken is moot for my attempt to model how combat should work according to the rules...

If combat is, as you say (and as the paragraph in question could be read) based entirely on the 'factors' of the attacker... then it becomes much simpler to model.

Have fun.
Peter

p.s. Not only do I embark on fools errands, but I've also been known to tilt at windmills.
boojumhunter is offline  
Old November 27, 2001, 10:45   #7
boojumhunter
Chieftain
 
boojumhunter's Avatar
 
Local Time: 12:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Toronto, Canada
Posts: 31
Quote:
Originally posted by Excelsior
BTW, boojumhunter, I wrote a program that determines the results of as many simulated battles as you want with specified attack, defense, and hitpoints. I can upload it if you want it.
Sure... I'm always adverse to reinventing wheels.
Thx.
boojumhunter is offline  
Old November 27, 2001, 11:28   #8
Excelsior
Warlord
 
Excelsior's Avatar
 
Local Time: 11:35
Local Date: October 31, 2010
Join Date: Nov 2001
Location: Alabama
Posts: 162
Here you go. Many brave floppy disks died to bring you this information from my laptop. Two, actually.
Attached Files:
File Type: zip probcomb.zip (43.9 KB, 1 views)
Excelsior is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 13:35.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team