View Full Version : Civ III Combat Calculator (.EXE)


BomberEscort
Jan 18, 2004, 04:46 AM
It's finally here... :D

the conversion of my Excel spreadsheet into an EXE file for all those who wanted to use it but didn't have Excel. Also, I will no longer be supporting the spreadsheet.

*** Latest Version 1.35 ***


v1.32

Custom Terrain Bonuses from -99% to +999% in 1% increments.
Defender and Attacker HP increase to a maximum of 20 from 6.
Bombard Rate-of-Fire increased to a maximum of 20 from 6.
New Fields to show cumulative percentages of winning with 6+ HP
for Non-Bombard Attacks and 7+ HP for Bombard Attacks.
Fast Defender/Attacker HP and Experience are no longer tied to one another. Conscripts to Elites with 1 to 20 HP are now possible.
With the use of the new Custom Terrain setting you can achieve any Total Defensive Bonus from -99% to 1174% in 1% increments!
SAM Missile Battery Defenses from 1 to 99 (Default 8)
Interception Percentages from 1% to 100% (Default 50%)
A tool-tip functionality has been incorporated as a rudimentary form of help. Hover over a section and information shall be displayed.
Added Defensive Equivalent Option.
Fixed problem with Bombardment Percentages not showing correctly when lethal bombard was off. The totals were correct, the error was in the HP loss individual Percentages.
Added Default Bombard values for reference when using Offensive Bombard.
Rearranged to make the calculator more compact.


v1.33

Reworked Defensive Equivalent to include all units instead of slow only.
Individual Battle percentages now show for Defensive Bombard, Fast units and Slow units. Totals were not effected.
Added 'help' text for the Defensive Equivalent function.


v1.35

Fixed bug with retreat AHPL/DHPL not showing correctly
Fixed bug with Defensive Bombards not calculating correctly in some instances


Scroll Down past the screenshot for the EXE file ;)

BomberEscort
Jan 18, 2004, 04:47 AM
Screenshot

BomberEscort
Jan 18, 2004, 04:49 AM
Here is the program...

Version 1.00 removed after 21 downloads...
Version 1.01 removed after 58 downloads...
Version 1.10 removed after 83 downloads...
Version 1.15 removed after 1,005 downloads...
Version 1.22 removed after 841 downloads...
Version 1.30 removed after 16 downloads...
Version 1.32 removed after 192 downloads...
Version 1.33 removed after 458 downloads...

Calculator EXE
http://forums.civfanatics.com/uploads/33932/CivIIICombatCalculator_v1.36_.zip

Calculator VB6 Source
http://forums.civfanatics.com/showpost.php?p=4908955&postcount=82

Gogf
Jan 18, 2004, 11:01 AM
NICE!! Great job!

Sparta
Jan 20, 2004, 08:27 AM
sweet! thanks BomberEscort!

Oldenbarnevelt
Jan 21, 2004, 07:49 AM
Congrats on your first VB program! As far as I can see the calculation results are correct. A nice tool! A little nitpicking: "Lethal Bomard" should be "Lethal Bombard".

--
My first post to a Fanatics Forum :)

BomberEscort
Jan 21, 2004, 08:30 AM
Originally posted by Oldenbarnevelt
Congrats on your first VB program! As far as I can see the calculation results are correct. A nice tool! A little nitpicking: "Lethal Bomard" should be "Lethal Bombard".

--
My first post to a Fanatics Forum :)

Thanks... Also, nitpicking is fine, I like to pick nits... :D

Also, welcome to CivFanatics!

BomberEscort
Jan 22, 2004, 04:17 AM
Version 1.01 available...

Fixed some very minor errors, AA still on schedule for the next version release (mid-Feb)

jaafit
Jan 23, 2004, 01:50 AM
Nice job. Another nit: The tool-tip on AHPL is the same as the tool tip on DHPL.

One question: why does a fast attacker have less chance of winning than a non-fast attacker?

socralynnek
Jan 23, 2004, 02:42 AM
Originally posted by jaafit
Nice job. Another nit: The tool-tip on AHPL is the same as the tool tip on DHPL.

One question: why does a fast attacker have less chance of winning than a non-fast attacker?

It's because the fast attacker runs away when reaching 1 HP, while the others fight on. So, if you fight on, you have a small chance to win, so it's a small increase in winning, but also notice the bigger increase in losing...

jaafit
Jan 23, 2004, 03:55 AM
Ahhh, got it. Thanks.

BomberEscort
Jan 23, 2004, 04:24 AM
Originally posted by jaafit
Nice job. Another nit: The tool-tip on AHPL is the same as the tool tip on DHPL...

I believe this was fixed in version 1.01, it is on the copy I have... If it isn't let me know and I will repost.

BomberEscort
Jan 23, 2004, 04:27 AM
Also, the AA section is ahead of schedule, after I get the kinks in the formula straightened out I should have it ready by the end of the month...

Go here...

http://forums.civfanatics.com/showthread.php?postid=1540188#post1540188

for details on the AA Formula...

BomberEscort
Jan 24, 2004, 04:19 AM
The AA formula is now apart of the Civ III Combat Calculator v1.10... Credit to alexman and his work over at Poly in this endeavor and his testing on the formula... Our results and conclusions are in agreement.

jaafit
Jan 24, 2004, 04:41 AM
Originally posted by BomberEscort


I believe this was fixed in version 1.01, it is on the copy I have... If it isn't let me know and I will repost.

I downloaded v 1.10 and it's still the same.

I love this program though! I just used it today in my war against Ottomans, trying to decide if my 4hp calvary with radar tower should attack his 1 hp tank on a hill. I put in the values and it looked like I had about a 50/50 so I went for it. I lost 3 hp, and then... :)
No more tank.

BomberEscort
Jan 24, 2004, 04:46 AM
Ok, I see what you are talking about now, I thought you meant the numbers 0-5 under that... I will fix this in the next version (I'm going to wait to see if any more errors crawl out of the woodwork...)

Civrules
Jan 24, 2004, 10:18 AM
BomberEscort, thank you. I was unable to use your other excel calc but this seems to work fine. Now I can use this!!

Thanks a lot!!! :goodjob:

Pepso
Jan 24, 2004, 08:23 PM
Hi BomberEscort, first of all congrat's for this very nice program.

Secondly as you are an expert in this matter i was thinking if you could explain how the bombardment formula is calculated and if it's the same as the defensive bombardment, or you could just indicate some thread's you know, as i don't want to start a new one over this matter again.

And keep up the good work.

BomberEscort
Jan 26, 2004, 04:40 AM
Originally posted by Pepso
Hi BomberEscort, first of all congrat's for this very nice program.

Secondly as you are an expert in this matter i was thinking if you could explain how the bombardment formula is calculated and if it's the same as the defensive bombardment, or you could just indicate some thread's you know, as i don't want to start a new one over this matter again.

And keep up the good work.

The Bombardment Formula:

(BombardAttack / (BombardAttack + ModifiedDefense))^RateOfFire

e.g.- If the Bombard Attack = 4, Modified D = 6, ROF = 3 then...

Chance the Defender Takes 0 Damage = (6/10)^3 = 0.216
(Defender has to win all 3 battles)

Chance the Defender Takes 1 Damage = (6/10)^2 * (4/10)^1 * nCr(3,1) = 0.36 * 0.4 * 3 = 0.432
(Defender wins 2 battles, Attacker Wins 1, 3 Ways to Happen)

... Same for the other values (Defender takes 2 and 3 damage)

As for Defensive Bombardment, that is something different... ;)

Pepso
Jan 26, 2004, 12:10 PM
Thanks BomberEscort. :)

BomberEscort
Jan 28, 2004, 05:03 AM
Version 1.15 update:

Stealth Ability and SAM Missile Battery options added.

Civrules
Jan 28, 2004, 12:32 PM
Thank you!

Bleser
Jan 29, 2004, 11:06 AM
FANTASTIC!

lordbasl
Jan 30, 2004, 12:07 AM
Very nice!

Bobby Lee
Feb 10, 2004, 03:28 PM
is there sum way you could make this so that the numbers for the attack and defense points go above 99? i am using ur calculater to figure out unit strengths for a mod im working along with help from others, and i need the unit strengths to go above 99....by quite a bit

thanks

oh and BTW nice job :)

Louis XXIV
Feb 16, 2004, 03:22 PM
Finally got a chance to look at it today. It seems that some options keep graying themselves out for no particular reason, so sometimes I have to click to another option and then click back in order to do a particular thing (Like fortified units).

Also, I can't seem to check Lethal Bombard.

Roland Johansen
Feb 16, 2004, 04:29 PM
Very nice program. :goodjob:

And to answer one of Louis' questions.

Lethal bombard is only effective when rate of fire is higher than number of hp of defender left. Good programming on that, i'd say.:goodjob:

I have another questions though.

As you have made this program, I'd expect you to know exactly how every outcome of every combat is calculated. :)

Now I'm wondering if terrain bonusses and civil defence and radar towers and all those kinds of bonusses have any influence on the outcome of air combat (defender intercepting bombarding fighter/bomber unit).

Your program seems to suggest that radar towers and rivers do have an effect and the rest of the bonusses don't. But I can also select fast attacker/defender which is very strange for air units. Can air units retreat? I never tested what happens when you give movement points to air units, but I doubt that they retreat.

Are you correct? Do only radar towers and rivers have any effect on air combat? I'm just curious because I want to balance attack and defence of fighter units for a mod I'm making and thus want to know what effects air combat.

DrSpike
Feb 17, 2004, 10:21 AM
I don't post here much, but I dropped by to say what a nice tool this calculator is. Very easy to use and interpret.

Cheers

Doc

BomberEscort
Feb 23, 2004, 04:08 AM
Originally posted by Louis XXIV
Finally got a chance to look at it today. It seems that some options keep graying themselves out for no particular reason, so sometimes I have to click to another option and then click back in order to do a particular thing (Like fortified units).

Also, I can't seem to check Lethal Bombard.

List some specific examples and I will check it out...

BomberEscort
Feb 23, 2004, 04:14 AM
Originally posted by Roland Johansen
...Now I'm wondering if terrain bonusses and civil defence and radar towers and all those kinds of bonusses have any influence on the outcome of air combat (defender intercepting bombarding fighter/bomber unit)...

No they don't have any effect. The only thing that effects air combat is other air units, AA units, and SAM Missile Battery.

Originally posted by Roland Johansen
...Your program seems to suggest that radar towers and rivers do have an effect and the rest of the bonusses don't. But I can also select fast attacker/defender which is very strange for air units. Can air units retreat? I never tested what happens when you give movement points to air units, but I doubt that they retreat...

Are you selecting 'Air' for your terrain. I don't have a copy of the program with me, but I remember 'Air' greying everything out. If not I will check this out... You can give air units movement points, I know they don't retreat, but I have heard that you can rebase twice with 2 MP, I haven't personally tested this though. But you are correct, radar towers and rivers have no effect, the only units/improvements the effect air combat are listed above.

BomberEscort
Feb 23, 2004, 04:17 AM
Originally posted by Bobby Lee
is there sum way you could make this so that the numbers for the attack and defense points go above 99? i am using ur calculater to figure out unit strengths for a mod im working along with help from others, and i need the unit strengths to go above 99....by quite a bit...

No 99's the limit... :P

Roland Johansen
Feb 23, 2004, 07:25 AM
Originally posted by BomberEscort

Are you selecting 'Air' for your terrain. I don't have a copy of the program with me, but I remember 'Air' greying everything out. If not I will check this out... You can give air units movement points, I know they don't retreat, but I have heard that you can rebase twice with 2 MP, I haven't personally tested this though. But you are correct, radar towers and rivers have no effect, the only units/improvements the effect air combat are listed above.

Thank you for the information. Now I know everything to balance out air combat in my personal mod.

In the utility a lot of things get greyed out when one selects Air, but not everything in the top half of your calculator (radar towers, attacking across a river, fast defender). This is also true for coast/sea/ocean. I don't know if radar towers give bonusses for sea combat, but rivers obviously can't give bonusses at sea ;). Also I'm not sure if fortifying at sea really gives a bonus, but I never tested it.

All of these observations are of course minor details, it's a great calculator. :goodjob:

Shogun Gunner
Feb 24, 2004, 08:57 PM
Very useful utility. Thanks BomberEscort!

Conditional Zenith
Mar 13, 2004, 11:00 PM
Bomber Escort,

It seems that your combat calculator (version 1.15) does not calculate the probability of a retreat correctly.

For example, when a unit with an attack rating of 4 on 3HP with regualr experience attacks a fast unit with a defense rating of 3 on 3HP with regular experience (giving a retreat chance of 0.5), the probability of retreat is as such:

(4/7)^2 * 0.5 + (4/7)^2 * (3/7) * 0.5 * 2
= 0.303207

Your calculator gives an answer of 0.233236 as the chance of a retreat. This is the same answer as the above equation without the final "*2".

The final * 2 is added to account for the fact that there are 2 ways that there could be a 2-1 retreat: attacker wins, defender wins, attacker wins, defender retreats OR defender wins, attacker wins, attacker wins, defender retreats.

In general, there are (defender's starting HP + no. HP attacker loses - 2)C(no. HP attacker loses) ways that a retreat for a given no. of HP attacker loses can occur.

Apart from the above issue, nice calculator.

BomberEscort
Mar 15, 2004, 01:23 PM
Originally posted by Conditional Zenith
Bomber Escort,

It seems that your combat calculator (version 1.15) does not calculate the probability of a retreat correctly.

For example, when a unit with an attack rating of 4 on 3HP with regualr experience attacks a fast unit with a defense rating of 3 on 3HP with regular experience (giving a retreat chance of 0.5), the probability of retreat is as such:

(4/7)^2 * 0.5 + (4/7)^2 * (3/7) * 0.5 * 2
= 0.303207

Your calculator gives an answer of 0.233236 as the chance of a retreat. This is the same answer as the above equation without the final "*2".

The final * 2 is added to account for the fact that there are 2 ways that there could be a 2-1 retreat: [Case #1] attacker wins, defender wins, attacker wins, defender retreats OR [Case #2] defender wins, attacker wins, attacker wins, defender retreats.

In general, there are (defender's starting HP + no. HP attacker loses - 2)C(no. HP attacker loses) ways that a retreat for a given no. of HP attacker loses can occur.

Apart from the above issue, nice calculator.

Bracketed comments in the quote above are mine...

I see it as only one way to retreat... Here is my rationale...

Fast Defender retreats only occur when the attacker has 2 hp and the defender has 1 hp, any other combination of hit points will not retreat. When this combination exists, using the example above, the retreat happens in 50% percent of those cases. The other 50% the battle continues normally (Win or Loss).

Using your example above, eliminating the 'way' we get to the 2-1 requirement, the retreat-round is as follows:

Case #1: ...attacker wins, defender retreats OR
Case #2: ...attacker wins, defender retreats.

There is one and only one potential retreat round in any given encounter, though this potential may never be realized (the retreat is only calculated once)

In the above cases the defender always loses 2hp and the attacker can lose 0 or 1 (if he loses 2 before the defender loses 2 the retreat will not happen), I account for this in my fomula.

Either way, the retreat is triggered by this scenario (attacker wins round THEN defender retreats)

From what I can tell, you include the 'ways' to get to the 2-1 requirement and I do not... I am far from a statistical expert, if you could explain why you include the 'ways' to get to the 2-1 requirement that might help... Also, I will do another sample based on the example above and post the data...

Either way, good check... I appreciate all the help I can get, the perfection of this calculator being the goal... :D

Lambda
Mar 15, 2004, 03:39 PM
this is a great tool....this is THE tool for any civ player.

i'm learning C and C++ and i wanted to do something like this, i never liked the excel calculators they just occupy to much ram and they are just to slow.

you are the man bomber escort!

Conditional Zenith
Mar 16, 2004, 03:29 AM
quote:
--------------------------------------------------------------------------------
Originally posted by Conditional Zenith
Bomber Escort,

It seems that your combat calculator (version 1.15) does not calculate the probability of a retreat correctly.

For example, when a unit with an attack rating of 4 on 3HP with regualr experience attacks a fast unit with a defense rating of 3 on 3HP with regular experience (giving a retreat chance of 0.5), the probability of retreat is as such:

(4/7)^2 * 0.5 + (4/7)^2 * (3/7) * 0.5 * 2
= 0.303207

Your calculator gives an answer of 0.233236 as the chance of a retreat. This is the same answer as the above equation without the final "*2".

The final * 2 is added to account for the fact that there are 2 ways that there could be a 2-1 retreat: [Case #1] attacker wins, defender wins, attacker wins, defender retreats OR [Case #2] defender wins, attacker wins, attacker wins, defender retreats.

In general, there are (defender's starting HP + no. HP attacker loses - 2)C(no. HP attacker loses) ways that a retreat for a given no. of HP attacker loses can occur.

Apart from the above issue, nice calculator.
--------------------------------------------------------------------------------



Bracketed comments in the quote above are mine...

I see it as only one way to retreat... Here is my rationale...

Fast Defender retreats only occur when the attacker has 2 hp and the defender has 1 hp, any other combination of hit points will not retreat. When this combination exists, using the example above, the retreat happens in 50% percent of those cases. The other 50% the battle continues normally (Win or Loss).

Using your example above, eliminating the 'way' we get to the 2-1 requirement, the retreat-round is as follows:

Case #1: ...attacker wins, defender retreats OR
Case #2: ...attacker wins, defender retreats.

There is one and only one potential retreat round in any given encounter, though this potential may never be realized (the retreat is only calculated once)

In the above cases the defender always loses 2hp and the attacker can lose 0 or 1 (if he loses 2 before the defender loses 2 the retreat will not happen), I account for this in my fomula.

Either way, the retreat is triggered by this scenario (attacker wins round THEN defender retreats)

From what I can tell, you include the 'ways' to get to the 2-1 requirement and I do not... I am far from a statistical expert, if you could explain why you include the 'ways' to get to the 2-1 requirement that might help... Also, I will do another sample based on the example above and post the data...


I include the number of ways to get to 2-1 (actually the number of ways to get to 2-2, as there is only 1 way to get to 2-1 from 2-2 as you have already pointed out) as the retreat can happen as in case#1 or as in case#2. Both the cases are mutually exclusive and therefore the probability of case#1 OR case#2 is P(case#1) + P(case#2). I think we agree that P(case#1) = P(case#2) = (4/7)^2 * (3/7) * 0.5
therefore P(case#1 OR case#2) = ((4/7)^2 * (3/7) * 0.5) + ((4/7)^2 * (3/7) * 0.5) = 2 * (4/7)^2 * (3/7) * 0.5

Hope this explains my inclusion of the number of ways to get to 2-1

BomberEscort
Mar 18, 2004, 01:43 PM
Good catch, I have verified your numbers through testing and an update will be forthcoming :goodjob:

Sovereign
Mar 18, 2004, 02:02 PM
Sweet... now I can work out what to do in a game, to attack or to defend... that is the question :D!

daufoi
Mar 19, 2004, 03:23 PM
how come the original combat calculator by Xerxes314 uses playing level (i.e. Regent, Monarch, etc) in its calculations and this one doesn't? does the level of play affect those calculations?

daufoi

Sovereign
Mar 19, 2004, 03:36 PM
Hmm... I dunno... you might be right, well BomberEscort will hopefully say if it does, but I don't think it does.

Sparta
Mar 19, 2004, 03:58 PM
I'm far from a reliable source, but if I had to venture a guess, I'd say that the old combat calculator was giving you odds on barbarian attacks (for which you definitely DO get a bonus based on difficulty level). Probably not much of a concern, as your odds will be better against a barb anyway (unless you're on like sid level or something). AFAIK there are no difficulty modifiers for civ-on-civ attacks, but I could be wrong.

BomberEscort
Mar 22, 2004, 04:18 AM
Level of play does not affect any combat except those against barbarians...

Sovereign
Mar 22, 2004, 06:08 AM
I keep loosing the World War in the Pacific Map... yet the Napoleonic Europe maps are okay... my French troops spit and everything (I edited the files byt recording me spitting). When playing as Russia the barbarians are easy... and the French have got too good Imperial Guards and Imperial Cavalry... but my Cossaks are okay, because they are faster than they are traditionally.

socralynnek
Apr 22, 2004, 06:26 AM
Hello Bomber Escort,
first of all: I really like your program, but I think I found a very small bug:

If a fast defender is fortified in a city, it never retreats, but your program computes a retreat chance.

BomberEscort
Jul 24, 2004, 09:32 AM
Sorry for the update delay, I have been occupied by career concerns...

Version 1.22 update fixes the following
- An error with the retreat calculations (Thanks Conditional Zenith)
- Other very minor misc. errors

Other Issues:
- Army combat will not be added
- There is still a minor error with the AA formula that needs to be addressed...

deeno
Aug 12, 2004, 05:14 AM
Could you make it go above the regular 6 hp's? I need a calculator that makes it go to 15 :(

handy900
Aug 12, 2004, 10:04 AM
Fantabulous! [dance]

So easy to use and it has bombard built in. Very well done!

NP300
Sep 07, 2004, 09:47 PM
I have a modded game with custom defensive bonuses for terrain tiles. Is there any way to manually add in the modified defense for the calculator? For example, I have tiles with a defense bonus of -20%, yes a defensive penalty. And the only way I can calcuate these is by multiplying the defense by 10x and then subtracting 20%. But then I run into the problem that the calculator doesn't allow values greater than 99.

Zeekater
Oct 04, 2004, 03:26 PM
Sorry for the bump, but I wonder if it'd be possible to have the program be able to handle HP above 6?
It's a really good program, and I use it to test out unit stats when I wanna change them, and many units have more then 6 HP :)

Rubruk
Oct 13, 2004, 07:30 AM
Hi BomberEscort!

Your calculator is very good.

BomberEscort
Oct 28, 2004, 06:22 AM
I'm taking an official list of requests for updating the calculator.

So far I have:

1) Increase to allow up to 15 hp battles.
2) Allow custom terrain modifiers from -99% to +999%

If there is anything else let me know, I will try to start on this in early November...

Roland Johansen
Oct 28, 2004, 05:00 PM
What I would like to see are some usefull additions for modmakers. I'm thinking about:
1) The possibility to change the defensive bonusses of terrain, fortresses, barricades, rivers and fortifying or the option to determine the total defensive bonus yourself.
2) The option of the amphibious assault bonus of 25% somewhere added.
3) The option to change the interception chances for normal and stealth bombers.

I realize that adding these functionalities might make the calculator more complicated and less accessible for some people, thus it is a challenge to add functionalities without making the calculator look very complicated.

The present calculator is already a great tool. :goodjob:

As you know a lot about the way combat is handled, you might know the following aspect of combat too. If a bomber attacks, it can hit nothing, a unit, a building or a population point. I've read some studies about this in PTW en Civ3 vanilla where the chances to hit each of the differnet types of targets were determined, but I haven't read any study about the topic in C3C and we know that they made some changes in bombardment as artillery and ships now first target units, but bombers can hit anything. Is something known about this subject? Thanks in advance.

BomberEscort
Oct 29, 2004, 06:12 AM
As you know a lot about the way combat is handled, you might know the following aspect of combat too. If a bomber attacks, it can hit nothing, a unit, a building or a population point. I've read some studies about this in PTW en Civ3 vanilla where the chances to hit each of the differnet types of targets were determined, but I haven't read any study about the topic in C3C and we know that they made some changes in bombardment as artillery and ships now first target units, but bombers can hit anything. Is something known about this subject? Thanks in advance.

I haven't seen anything for this in C3C.


2) The option of the amphibious assault bonusof 25% somewhere added.


I wasn't aware this was included in the C3C final version. Last I heard it was an idea that was never implemented. I'll check though.

BomberEscort
Oct 29, 2004, 06:18 AM
Changes made for Version 1.30


Custom Terrain Bonuses from -99% to +999% in 1% increments.
Defender and Attacker HP increase to a maximum of 20 from 6.
Bombard Rate-of-Fire increased to a maximum of 20 from 6.
New Fields to show cumulative percentages of winning with 6+ HP for Non-Bombard Attacks and 7+ HP for Bombard Attacks.
Fast Defender/Attacker HP and Experience are no longer tied to one another. Conscripts to Elites with 1 to 20 HP are now possible.
With the use of the new Custom Terrain setting you can achieve any Total Defensive Bonus from -99% to 1174% in 1% increments!
SAM Missile Battery Defenses from 1 to 99 (Default 8)
Interception Percentages for SAM Missile Battery range from 1% to 100% (Default 50%)


I tested this thouroughly with extreme values, trying to create overflows, etc. I also tested the comparable results with version 1.22 of this calculator and they tested accurate, no difference between the two. As with any complicated endeavor errors are bound to be hidden in the code. I welcome any comments pertaining to the accuracy of this Combat Calculator. Enjoy :thumbsup:

See page one for downloading...

Roland Johansen
Oct 29, 2004, 12:44 PM
Thank you. That was fast. :goodjob:

I've heard different things about the amphibious assault bonus. I am not sure that it was implemented and have never done any tests to make sure.

BomberEscort
Nov 01, 2004, 05:33 AM
*** Latest Version 1.32 ***

Minor fix to v1.30
Custom Terrain Bonuses from -99% to +999% in 1% increments.
Defender and Attacker HP increase to a maximum of 20 from 6.
Bombard Rate-of-Fire increased to a maximum of 20 from 6.
New Fields to show cumulative percentages of winning with 6+ HP
for Non-Bombard Attacks and 7+ HP for Bombard Attacks.
Fast Defender/Attacker HP and Experience are no longer tied to one another. Conscripts to Elites with 1 to 20 HP are now possible.
With the use of the new Custom Terrain setting you can achieve any Total Defensive Bonus from -99% to 1174% in 1% increments!
SAM Missile Battery Defenses from 1 to 99 (Default 8)
Interception Percentages from 1% to 100% (Default 50%)
A tool-tip functionality has been incorporated as a rudimentary form of help. Hover over a section and information shall be displayed.
Added Defensive Equivalent Option (Explained Below).
Fixed problem with Bombardment Percentages not showing correctly when lethal bombard was off. The totals were correct, the error was in the HP loss individual Percentages.
Added C3C Unit Default Bombard values for reference when using Offensive Bombard.
Rearranged to make the calculator more compact.

BomberEscort
Nov 01, 2004, 05:35 AM
Changes in v1.33

Reworked Defensive Equivalent to include all units instead of slow only.
Individual Battle percentages now show for Defensive Bombard, Fast units and Slow units. Totals were not effected.
Added 'help' text for the Defensive Equivalent function.

Offa
Nov 05, 2004, 04:08 PM
Do you know if the capital city gets an additional defence bonus? I had thought that this was the case, eg rated as a size bigger than it actually is. This actually has some real bearing in how to play the game, and so I would love to find out.

BomberEscort
Nov 08, 2004, 05:43 AM
Do you know if the capital city gets an additional defence bonus? I had thought that this was the case, eg rated as a size bigger than it actually is. This actually has some real bearing in how to play the game, and so I would love to find out.

AFAIK it just a graphical representation only, I do not believe there is a bonus for the capital.

Updated to version 1.33 (see page 1 for download)

eldar
Nov 14, 2004, 03:43 AM
Changing a lot of things (e.g. 'Population Center') unchecks the 'Fortified' box. Just a bit annoying, as you have to re-check it every time.

Neil. :cool:

Offa
Nov 22, 2004, 03:47 PM
For offensive bombardment at present the results are given as the same regardless of whether the defender is outside in the open or in a town. I believe that the actual chance of inflicting damage on a defender inside a town is much lower as the bombardment may get directed against city improvements or population instead.

Arathorn
Nov 30, 2004, 11:37 AM
Somehow, retreats and hps lost aren't being calculated properly. The final attacker wins, defender wins, and draw probabilities also seem to be affected, I think.

Consider a 2 hp veteran knight attacking a 2 hp regular spear fortified in a town on grassland. This means a modified defense of 2.70, we agree. Thus, the attacker wins 4/6.7=59.7% of the rounds. I think we agree on that.

By your calculations with Oystein, the chance of a retreat, should one occur, is exactly 58% -- 58/(50+50), since the knight is vet and the spear regular. I think we agree on that (unless there's been more recent research I've missed...in which case, where is it?).

Let's go through all the possibilities. With only 2 hps, we can list them all out. I'll use A to mean attacker wins a round and D to mean defender wins a round, so AA means attacker wins and then attacker wins. [Note, I used more exact numbers but am only showing a few to save typing time.]
AA - Happens with probability .597^2 = 35.64% (AHPL = 0, attacker wins)
ADA - No retreat chance since defender at 1 hp when attacker reaches 1 hp - Probability .597*.403*.597 = 14.36% (AHPL = 1, attacker wins)
ADD - No retreat chance - Probability .597*.403*.403 = 9.70% (DHPL = 1, defender wins)
D* - The * is a successful retreat - Probability .402*.58 = 23.37% (AHPL=1, DHPL=0, DRAW)
D*AA - The * is a failed retreat. Since the defender still had 2 hps, the knight rolls to retreat. In this case, it failed, leading to this result - Probability .402*.42*.597*.597 = 6.03% (AHPL = 1, attacker wins)
D*AD - * is a failed retreat - Probability .402*.42*.597*.402 = 4.07% (DHPL = 1, defender wins)
D*D - * is a failed retreat - Probability .402*.42*.402 = 6.82% (DHPL = 0, defender wins)

Total probabilities....
A wins - 35.64 + 14.36 + 6.03 = 56.03%
D wins - 9.70 + 4.07 + 6.82 = 20.59%
DRAW - 23.37%

(AHPL = 0) - 35.64%
(AHPL = 1) - 14.36 + 23.37 + 6.03 = 43.76%
(DHPL = 0) - 23.37 + 6.82 = 30.19%
(DHLP = 1) - 9.70 + 4.07 = 13.77%

The A wins, D wins, and DRAW match your combat calculator, but you show 43.972% for (AHPL = 0) and 35.440% for (AHPL=1), for example, which just has to be wrong.

Also, changing the attackers hps changes the odds of (AHPL=0), which is wrong, because that's always just the chance the attacker wins two consecutively and MUST be the same for all values of attacker hps. Indeed, setting attacker hps to 1 gives 35.643%, which is what (AHPL=0) must be for any attacker hp value (changing nothing else).

You need to look at your retreat logic again. If I can help, let me know.

This simple example doesn't show the error in attacker wins, defender wins, DRAW, but I think it's there and probably the same bug. For example, a 4 hp vet knight attacking a 3 hp regular spear with same terrain, I get 78.4% attacker wins and you get 79.4% with our defensive wins off by similar amounts.

Arathorn

BomberEscort
Dec 19, 2004, 12:16 PM
Version 1.35 posted on Page #1.


I reworked the retreat formula (credit to Arathorn). I think this is working correctly now. :D
Fixed a coding error with Defensive Bombard that caused a minor error in the totals.


I don't think I am going to update Offensive Bombard to include damage probabilities when attacking units in cities. Sometimes the bombard hits the pop, unit, or building and this could not be added without extra toggles that will clutter the interface.

dexters
Feb 14, 2005, 06:12 AM
A quick question, I'm not exactly sure how to configure the combat calculator to calculate air vs. air intercept rates. (ie: the chance a bomber will be shot down by a passive fighter on air superiority)

Can you clarify?

Pfeffersack
Mar 25, 2005, 06:16 AM
About the amphibious attack bonus...I found this thread at Apolytons AU forum:

http://apolyton.net/forums/showthread.php?s=&threadid=105787

Quote from Alexman:

OK, the amphibious bonus is actually 25% (confirmed by Firaxis). (...)

BomberEscort
Mar 25, 2005, 02:00 PM
A quick question, I'm not exactly sure how to configure the combat calculator to calculate air vs. air intercept rates. (ie: the chance a bomber will be shot down by a passive fighter on air superiority)

Can you clarify?

ATM, the calculator does not support these calculations.

BomberEscort
Mar 25, 2005, 02:02 PM
About the amphibious attack bonus...I found this thread at Apolytons AU forum:

http://apolyton.net/forums/showthread.php?s=&threadid=105787

Quote from Alexman:

Last I heard this was tentatively in, but was later removed. I did some testing with the latest conquests patch sometime back and I did not notice this bonus. I'll check posts by Alexman on poly and see if he has any new data of which I am unaware.

Eetu Pellonpää
May 01, 2005, 03:12 AM
Fine tool to check the changes of impossible to happen...

:spear:

would-be-addict
May 10, 2005, 09:24 PM
For some odd reason, my very slow computer can't get the calculator. I will download it, but when I try to open it, it comes up with this window that says: "CivIIICombatCalculator.zip could not be opened." and it won't let me get to it. :mad: Monitors will roll!!! :mad:

Himalia
Jun 16, 2005, 09:47 AM
Very nice utility however it has just confirmed to me even more so how dodgy some of the results are the AI keeps getting in its favour. OMG how the hell is my Elite Modern Armour gonna defeat that 2hp Spearman on the grasslands. Im sure many of you know what i mean by this.

socralynnek
Jun 16, 2005, 04:57 PM
Hmmm, it also happens the other way round, the AI does not cheat concerning the Combat calculation.
You don't have a 100% of winning, so sooner or later it happens that you lose a 99% fight.

MSTK
Jul 07, 2005, 11:29 PM
Wait, am I missing something, or does this only calculate the results of one "fight" and not an entire battle? What if I want to compound many units vs many units?

josephstalin
Jul 21, 2005, 01:41 PM
That's good utility. Though I'm not goung to use it often. But you have to check/uncheck too many same boxes too many times, when you changed something...

Simon1995
Aug 12, 2005, 06:23 PM
:confused: Can u tell me how to correctly use this program and does it work for Civ3v1.29f and how do u use it i dont understand :confused:

Ingxoxo
Nov 15, 2006, 10:59 PM
How do I download the program? I clicked onthe "NEW Civ III Combat Cal..." and it takes me to this page, then I scroll down to "Here's the program..." and there is nothing to click on. What's the deal? (I don't think this matters in the slightest, but I am logged on)

BadKharma
Dec 21, 2006, 02:25 PM
"Bump" I really could use this utility if anyone has it could you upload it. There no longer is a link to download it.

socralynnek
Dec 21, 2006, 03:17 PM
Since I don't know whether this is on purpose, I won't just send it to you. Have you tried PMing BomberEscort?

Mirc
Dec 21, 2006, 05:19 PM
What do you mean, if this is on purpose? :)

socralynnek
Dec 21, 2006, 05:29 PM
Sorry, if I was unclear.
I don't know why the program isn't here anymore. So I don't know whether BomberEscort doesn't want to spread this program anymore.
As he is the owner of the program, you might want to ask him whether he wants to distribute it.

Mirc
Dec 21, 2006, 05:30 PM
Ah, ok, I get it now. :)

BomberEscort
Dec 23, 2006, 08:21 AM
Hello all,

Sorry for any delays. I haven't been monitoring this page, so I didn't know about the problems until I was PMed. That said I am officially releasing the calculator into the public domain. Included are all the files I used with Visual Studio 6.0 to create the calculator (If I inadventently missed one, just PM me). It was written with VB 6.0. I tried to comment the code as much as possible, mainly for my benefit at the time, but hopefully it will help everyone now. If anyone finds errors or has improvements feel free to post them here. Although I am no longer making code changes or supporting the program, I'd still be interested in hearing about it. Happy Civ-ing!!! :D

Calculator Source
http://forums.civfanatics.com/uploads/33932/CivIIICombatCalculatorSource.zip

Calculator EXE
http://forums.civfanatics.com/uploads/33932/CivIIICombatCalculator_v1.36_.zip

Civinator
Dec 23, 2006, 10:13 AM
Thanks a lot BomberEscort and merry christmas :D

BadKharma
Dec 23, 2006, 01:45 PM
Thank you so very much and a Merry X-mas to you.

eerr
May 30, 2007, 03:10 PM
"Custom Terrain Bonuses from -99% to +999% in 1% increments."
...........................................^
if a unit has a net strength penalty, the % combat strength is added and then inverted
(1/1.99), or about 1/2 normal strength for -99% defense

or it could be a typo : P

BbarronN
Jun 26, 2007, 07:41 PM
Could you please add bonuses for fights against barbarians according to difficulty levels?

england817
Nov 26, 2007, 07:05 PM
Just wondering, but i've seen that the max HP for the calculator is 20, while I know that having more than that is strange, the naval battles in my WIP Scenario have been spiced up.

You see, the Battleships (I was just testing how some of the battles would play out, statistically) have an 18 pt. bonus (max of 20) so therefore they have 21 HP, more than 20.

I wanted to see if the Battleships could defend against a Submarine -- as the Defense value of the BB is [45] and the attack of the SS is [55], but the BB HP is [21] and the SS HP is only [6], so I was wondering how this would play out.

Just wondering if it could be fixed, not that its a big problem.

Lord Douglias
Aug 31, 2009, 03:03 PM
After reading about and downloading a couple combat calculators for Civ 3, I realized they are not what I am looking for, If I understand what it is I am looking at...What I really need a CIV 3 Mod/ Utility that tells me what will happen if a particualr unit attacks another unit- A combat predictor or "Combat Crystal Ball", if you will, is what I want.

If I select a unit and pass the cursor over or single click on on an enemy unit- I want to know which unit will live and which will die. I am constantly saving and loading and it is a major waste of time. If I know my unit will die I just won't attack and that way I don't have to save and reload. Sometimes I will sacrifice a unit but I still want to know in advance what will happen.

I believe you when you say you can calculate the combate odds. But it seems to me those odds are pre-determined each turn? You can save and reload a 100 times and the exact same thing will happen in the same turn. Please correct me if I am wrong or better yet, someone please create my "Combat Crystal Ball". Thanks!

Conditional Zenith
Aug 31, 2009, 04:51 PM
I think you are getting confused about how combat in Civ3 happens. Civ3 will save the random number seed in the saved game, which means that if you load the saved game, then the same random numbers will be generated each time, and thus combat will have the same result every time as long as you do the combat in the same order. What this does not mean is that combat odds are predetermined.

To change this, you can turn off saving the random seed (it is an option somewhere, which may have only been added with a later patch), or do the combat in a different order. Either of these things will give you a different result when you reload the game.

As for what you want, that is a lot more work than what has been done here. This is a calculator; having something which actually got the seed, and used the game interface to select units and display results takes a lot more work.

Roland Johansen
Aug 31, 2009, 05:01 PM
The idea of combat in the civilization series is that it is unpredictable but that the stronger unit will win far more often than the weaker one. The odds that the stronger unit wins are higher than the odds that the weaker unit wins.

You are correct that reloading won't change the result and that thus in a sense the result is predetermined. However, the game tries to simulate a pure random value which will determine the outcome of the battle (by so called pseudo random number generators which are based on mathematical formulas that generate series of results which behave very similar to a series of random numbers). In version 1 and 2 of the civilization series, the game would simulate a new random number on reload but it resulted in players which couldn't restrain themselves from reloading as often as was needed until the lucky number caused their spearman to win against the enemy rifleman. Some players said this was cheating which I agree with as you're systematically changing (pseudo) random behaviour so that you have more luck than you should have. It's very very similar to demanding a redraw of the lottery each time that you lose until you're going to win. Other players didn't like that things happened differently on a reload for different reasons. So in civilization 3, this was changed. When you reloaded, the same random number (the same seed of the pseudo random number generator) would be used, so the result would be the same and reloading one hundred times wouldn't make your spearman win against the rifleman. (However, it does allow you to do something different.)
In civilization 4, it was again changed so that players may choose (at the start of the game) whether random numbers remain the same on reload or not. The game designers decided that players should choose themselves whether they are willing to reload the odds when they lose.

What you're looking for is something that shows you the next random number and what result that will have (on the combat that you're planning). This is of course fundamentally opposed to the idea of civilization combat which is supposed to be unpredictable. It would be very similar to you deciding whether you're going to enter the lottery with your numbers after the winning lottery numbers have been drawn.

In theory, such a function could be designed as reloading gives you the same information, but no one has done so as far as I know. In civilization 3, the amount of access to the games functionality by modders is fairly limited (and still great mods have been and still are being created) so I don't know if this would even be possible without a huge amount of work. I do know that such a utility would be automatically disallowed in any competition related to the civilization series.

Lord Douglias
Sep 01, 2009, 09:14 AM
Thanks for the informormation about seeds! Because you could consider saves and reloads (other than those to begin and end a session) CHEATING, I guess a hardcore Civ addict might play a game with no saves and reloads. I would probably try it no higher than 'Warlord' level.

Currently I am playing the Austrians in Ryne's huge realistic world map and actually kicking some butt for the first time in 'Regent' level in this mod. I cannot, especailly in the early game, afford to lose a single unit as I am hanging on for dear life, so I do a lot of saves and reloads which is very time consming on my older PC, thus my request.

I will look for that option to turn off saved seeds in Civ 3 if it exists.

Roland Johansen
Sep 01, 2009, 09:54 AM
I've read several comments from players who used to reload everything when something went wrong. They claimed that it improved their enjoyment of the game once they gave up reloading.

No one really likes losing units, but once you realise that reloading essentially lets you dictate the outcome of every battle, you'll realise there's no challenge in any conflict in this game. In that case, there's kind of a button next to each battle which you'll have to press in order to win that battle and that will quickly become stale. Or at least, it does for most players.

I'm not trying to tell you how you should play this game as that is up to you. I'm just warning you what systematic reloading will do to your game experience once you realise that there is no challenge left in such a game. However, everyone is different and it's of course all up to you how you wish to experience this game.


I'll present a game experience of mine in my latest game. I was fighting and conquering a weaker enemy when another civilisation amphibiously attacked me at a small island (4 cities) off the opposite coast. This second enemy was at least as strong as I was and came with quite some troops so I lost a city. There was no way for me to get my troops there quickly enough to stop him and it was a challenge to stop his advance at only that single city. I managed to sink his second invasion fleet and after several dozens of turns I could get a significant force there (by ship from the main continent) to recapture my lost city. I got a peace treaty and continued my conquest of the weaker enemy. Of course, this second front significantly slowed my original plans of conquest and hurt the area around the conquered city which took some time to recover. But in the end, I did win that game.

Of course, I could have reloaded to a point before the amphibious attack of this second enemy and strengthen my defences so that I didn't lose the city. I also could have reloaded as often as necessary so that my weak defenders somehow through sheer luck would win their defensive battle. However, after the game would have been won, I would know that I won the game by reloading that sequence and not through my own skill. It would have cheapened the victory.


Maybe, you don't have this problem and you like your play style better. I'm just giving you some experience from others. It might help you enjoy the game more.

Have fun!

Lord Douglias
Sep 01, 2009, 11:21 AM
Humm...I appreciate your perspective. I find that there is a certain point, usually in the early medevial era when my Civ's very survival, or at least the probabability that I can eventuallly catch up to more powerful Civs, can hinge on a few specific battles and events. So by reloading I, in effect, time travel back and tweek the course of history. I guess I consider it payback for the A/I cheating. Depending on the level you play, the AI will give computer Civs advantages like cheaper units and improvements. The AI is much more aggressive toward me than it is between other computer Civs.

Personally, after I beat Ryne's world map a couple times on 'Warlord' I no longer found it challenging, while failing several times to "get over the hump" at Regent level. So now I am "using every trick in the book" to suceed at Regent level. One of those tricks is save before taking a hut and reloading and waiting a turn if I don't get a new tech or unit or a settlement. Unless I aggressively get new techs from huts I fall so far behind the leaders they will soon be sending Tanks against my Pikemen. Another trick is to agressively pursue diplomacy, which is a nusance-like paying off enemies to make peace and bribing others to make military alliances. It seems to be working because I am leading in Victory points at about 1500 AD. Thanx!

Conditional Zenith
Sep 01, 2009, 05:28 PM
While saving/reloading to change combat results kills my enjoyment too, I can understand you wanting to do it. It turns out that option I was talking about was not added until patch 1.21f.

Regarding AI cheating, AFAIK it doesn't cheat with cheaper/extra units until Monarch or higher levels (though it still does know where all your units are IIRC). And the AI can never be as adaptable as a human player.

Wahsayah
Mar 06, 2010, 06:23 PM
I got a question; What if there is more than four anti-air units in a stack?.. Does the rest of the units of that stack up more than four times their chance to destroy the aircraft or is it just four times and nothing stacks past that?

tom2050
Mar 06, 2010, 10:47 PM
From BomberEscort's post here (http://forums.civfanatics.com/showpost.php?p=1539572&postcount=5);

Conclusions...
Hit Points and Experience do not affect interception by AA.
Stealth Ability does not affect interception by AA.
Terrain has no effect.
Radar Towers have no effect.
SAM Missile Battery is cumulative with Mobile AA.
If more than 4 AA in a square, only the best four will defend...
A Defense of zero will result in always being shot down, this is why Stealth Aircraft now have a Defense...

So only the best four AA units will defend.

Tom

just bob
Dec 21, 2010, 06:03 AM
1) The formulas for these are the actual formulas the game uses?

2) Is there any shortcomings this program has? I like programming, so I may be interested in fixing anything wrong. If someone else hasn't already.

3) Related to game loading - I reload my games only on very few occasions, and I hate doing so because I know it changes how the game goes. a) I reload on stupid culture flips that wipes out a stack of units/enough units to make me POed, especially when the citizens were happier under my rule than their old ruler. b) When something really impossible happens, like a 3 defense (with minimal fortify bonuses) unit defeats five 8 offense units in a row, when the defender had 1 hp for 3-4 of those fights. Only two I can really think of now.