combat result: 95% win

Uploaded the new Civulation. Retreat and Blitz should be working correctly now. The code is open source javascript. Any comments or bug reports are welcome.

bismark.jpg


http://www.zachriel.com/battlecalculator.asp
 
Originally posted by Zachriel
Uploaded the new Civulation.


This looks really cool, but what exactly does the "Survivors #" mean? I just ran a sample simulation of 10 Cavalry (retreat, militaristic, Heroic Epic) vs. 4 Riflemen (flatlands, fortified, no walls). The "Survivors #" for the attackers was 6.22 which sounds a little high, but I can accept for now, but for the defenders it was 4.58. They started with only 4, so how did they gain .58 Riflemen by getting attacked? :confused:
 
Originally posted by Dr Elmer Jiggle

They started with only 4, so how did they gain .58 Riflemen by getting attacked? :confused:

Good question! I'll get back to you.

Turns out that's the number of Defender wins (I think). Defenders can defend more than once. And so can Attackers if Blitz is on. I'll work on it.

(And that's why I passed it by you guys first before linking it on my website. Thanks!)
 
Interesting... with 3 veteran tanks attacking 6 fortified veteran speamen in a city across a river, the defenders kill a tank almost 50% of the time!


Edit: This test was a mistake, look at my reply 10 posts down.
 
Originally posted by DaveMcW
Interesting... with 3 veteran tanks attacking 6 fortified veteran speamen in a city across a river, the defenders kill a tank almost 50% of the time!

That's because of the flaming pit of fire in front of the city. ;)

(And the fact that the Civulation -- as well as many human players -- keeps blitzing even when the Tank is down to a single hitpoint, meaning the Tank was out of fuel and should have returned to the fuel depot.)
 
Originally posted by DaveMcW
Interesting... with 3 veteran tanks attacking 6 fortified veteran speamen in a city across a river, the defenders kill a tank almost 50% of the time!

Hmmm, but the tanks should each make one attack and then each tank make a blitz attack. That way you reduce the chance of having to attack a promoted spearman?
 
Originally posted by Cartouche Bee


Hmmm, but the tanks should each make one attack and then each tank make a blitz attack. That way you reduce the chance of having to attack a promoted spearman?

The Civulation will always select the strongest attacker, which always attacks the strongest defender. However, the attack will continue until all units are exhausted or victorious.
 
Originally posted by Cartouche Bee
You probably answered my question but I'm not clear.

If the first tank attacks and wins but it is down to 1HP does it go ahead and do it's blitz?

The strongest unit is selected, then attacks once. Then the strongest unit is selected, then attacks once, etc., until all units have used up their movements and/or hitpoints.
 
OK, just when I saw Dave's post , I was wondering why in game battles that does not usually happen. Guess it's cause I don't often blitz when down to 1HP.

Neat program!
 
Originally posted by Zachriel
Try it again. I appreciate the help.

Well, the defender numbers look better now, but the attackers are worse. Using the same setup as before -- 10 Cavalry (retreat, militaristic, Heroic Epic) vs. 4 Riflemen (flatlands, fortified, no walls) -- I get 7.85 attackers surviving and .29 defenders. So now the attackers are growing in force. :eek:

Oh, no. Wait. 7.85 is less than 10, isn't it? I was thinking of 6 attackers. :crazyeye:

Yeah, looks better.
 
This is just what I love about this forum. Thanks to all of you, folks.

To me, the basic assumption was to add up unit hit-points. Simple and elegant. Very obvious, after Zachriel pointed it out, but in fact I didn't realize it by myself.

Now, could we make kind of like a normalized or weighted stack to account for diverse units? according to some law of distribution?
for example:
3 warrior * 1 attack * hitpoints
=
1 warrior * 1 attack * hitpoints +
1 archer * 2 attack * hitpoints
= 3 weighted hitpoints.

Same for terrain defense value with floating point hit-points ?

Numerics and simulation here seems to work better than a closed solution, accounting for the numerous special cases (like promotion, retreat and blitz). BTW, anybody heard of markov chains and stochastic processes? Might it be applicable here?
 
Originally posted by DaveMcW
Interesting... with 3 veteran tanks attacking 6 fortified veteran speamen in a city across a river, the defenders kill a tank almost 50% of the time!

By the way, that is a very interesting observation. Also, it demonstrates how the critical mass works. Add one more Tank, and the odds change dramatically.

In the first case, 3 Tanks v. 6 Spearmen, in a thousand trials, I got 38.9%, 41.2% and 37.8%. Notice the wide spread even for such a large number of trials.

In the latter case, 4 Tanks v. 6 Spearmen, in a thousand trials, I got 90.7%, 89.4% and 87.1%.

That means the ratio is usually very critical and there is no simple method to predict the cusp of the optimization curve. It's best to have a few extra units. And indeed, there is a wide variation in results due to the number of factors involved.

Originally posted by NobleLeader
Man, just sum up all city defender points and build an army with the double of attack points ! ; )
:)

In other words, just wing it. :cool:

Grok it.


Originally posted by Cartouche Bee


Hmmm, but the tanks should each make one attack and then each tank make a blitz attack. That way you reduce the chance of having to attack a promoted spearman?

By the way, a second successful attack with a blitzing unit IS simulated as an automatic promotion.
 
Oops, I messed up and forgot to give the tanks retreat ability! :blush:

Running the tests again, 3 Tanks vs. 6 Spearmen only has a 20% chance of losing a tank. The odds don't reach 50% until you do 8 tanks vs. 16 spearmen.
 
Originally posted by DaveMcW
Oops, I messed up and forgot to give the tanks retreat ability! :blush:

Running the tests again, 3 Tanks vs. 6 Spearmen only has a 20% chance of losing a tank. The odds don't reach 50% until you do 8 tanks vs. 16 spearmen.

Thank you for pointing out that glaring oversight on my part. Tanks v. Spearmen!What good would a Civluation be without that.

It has since been corrected.
 
Originally posted by Zachriel
Grok it.
I doubt if anyone will ever be good enough to truely grok civ3, at least none of us mortals. ;)

Excellent work Zachriel. I will be using this a lot. :thumbsup:

Since people here seem to be interested in finding out odds here is a copy of the civ3 combat calc, changed cosmetically to allow explicit values to be entered in al the important fields. This allows new PTW and modded units to be entered. Note that my changes were trivial, the work is still Thunderfall's.
 
The Civulation is actually starting to change the way I play the game. :eek: It's not quite as scary to take on an enemy stronghold cause you can send in sorties to determine strength and make rational decisions on when to press a battle and when to stand down. :goodjob:
 
Made a few minor updates, including adding some graphics, fixing a minor bug in the retreat function, and cleaning up some code for readability.
 
Back
Top Bottom