Roland Johansen
Deity
Roland is correct. He's using the right formula, and I double-checked it in SAS software with sdf('binomial', 5, 0.2, 10) = 0.00637.
IMHO, simulation is by far the most reliable method here. Once you could establish benchmarks via simulation, then maybe you could start modeling it and using the simulation benchmarks to test the models, but I'd be surprised if we were able to come up with a good model, as Civ-obsessed as we are. Nevertheless, PM me if you're interested, and I'd be happy to put my Prob/Stat PhD to good use for a change.
Of course, "victory" here can be defined any way you like---such as surviving with a certain number of units intact with a certain amount of health, or winning within a certain number of turns. That's part of the beauty of the simulation approach: you don't need to go do more math each time you want to try a different victory condition.
Thanks for the support and the very interesting tables which show which sample size would be needed for an accurate estimate of the victory chances. The reason why I started talking about a fairly small sample size was that I originally thought that we were just talking about avoiding suicide attacks and that can easily be done with a fairly small sample size.
Bhruic says that a sample size of 100 might cause a slowdown of the program. I wonder if that is true, but it is of course a thing to keep in mind.
I for one think that an estimate of the victory chances within 10% of the real victory chances is more than precise enough. I don't think any of us could guess the victory chances between 2 stacks of 20 units with 10% accuracy if these victory chances are something in the 20-80% range (a close fight). There are too many factors to make an accurate guess. But still we can make fairly smart decisions by just not attacking when we aren't sure that victory chances for our stack are in the 90+% range. I don't think the AI needs to know more precise data than that to make adequate decisions. And as you have shown, the number of simulations needed to show that isn't that high.
In single unit match ups we often accept a much lower chance of victory than 90+%. But in that case the normal chance calculation could be used.
So my point is: attack the city if the chance of victory is in the 90+ or 95+% range doesn't require a lot of simulation runs and realistically that is often the thing which you want to know. You normally don't risk your whole stack attacking a city if the chances of victory are 55% or something like that. You won't have much of a stack left after the battle anyway.
edit: good point about the relation between margin of error and number of simulations.
exactly. And they will tell me: you're right. They had to disembark first, and then attack. The only artillery support they received came from the BB's and the air (both already modeled in Civ4 as bombardment). Did you know of any transport carrying artillery that fired from within the transports?
In fact, the key objective of the campaign was the port of Cherbourg. Did you see them storm the port itself? I didn't think so. In terms of Civ4, they disembarked first "on a contiguous tile" from where to attack inland and the port-city.
I mean it. This has to be the easiest and most logical solution, but it has to be implemented by Firaxis; if not, this turns out a mod.
I stand my ground. Any other opinion?
I agree with Bhruic that in the end this is a game and realism is just a basis for the game and not the determining factor in the game.
However, if you bring realism into the game, then you have to know that you can view it from more than one point.
You see a catapult in the game firing from a ship and think this is a simulation of a real catapult firing from a ship onto a city. Nonsense. That can't happen. This game makes a mockery of combat!
You can also view it a bit more abstractly. A tile is symbolizing an area of 100*100 kilometres. There might be a nice unprotected beach which we can use to land our catapults before we march on the city as the city could be 20 kilometres to the south of where we are landing. The 50% defence bonus for the city defenders is there to show that in reality the defenders of the city might try to sabotage the landing of the catapults. Ok, that makes sense.
This game shows a very abstract form of battle. Whether it makes sense or not just depends on how you look at it.
Oh, I know he's right. I only assumed he was wrong to begin with because he listed 0.637% as being for just 6 out of 10 - if that were the case, then 6+ out of 10 would have been higher.
Yes, yes, 6 or more. I know it.


I'm not sure that 100 simulations is realistically doable. I mean, it's fine for a a single battle. But the problem is that when a particular unit is trying to determine a city to attack, it scans all the cities in a certain radius, and then calculations victory chances (choosing the one with the highest victory chance). With a large radius, that will result in a lot of calculations. And that's for a single army.
Hmm. Whether it is feasible or not is a very good point. If it takes 1 second to do this for each 'should we attack this city'-question, then that could be a disaster. However, I don't expect it to be such an inefficient process. The amount of calculations needed to simulate a single battle once shouldn't take a computer long. But it is good to assume a worst case scenario and work with that.
A worst case scenario might be that the average city is defended by 20 units and the attack stack consists of say 35 units, so a maximum of 35 battles need to be calculated to find the outcome. The AI chooses between say 10 cities and so it chooses between 10 battles of 35 units facing 20 units. For each of these battles it performs a check of 30 simulations, only accepting an attack as a possibility if it wins 28 out of 30.
Ok, so that makes a simulation of 30*10*35=10500 battles, say 10000 battles to have a nice round number.
So the question would be: does it take civ4 more or less than 0.05 seconds to simulate 10000 1-on-1 battles? (Just assuming that more than 0.05 seconds for just this part of the program would be considered too much.) Say it needs the random number generator 6 times for each of these battles, then that would make 60000 calls for the random number generator (which I suspect is the most time consuming part of the battle simulation). I really don't know how long it takes to use the random number generator once, but it isn't very long. The random number generators that I've seen use some multiplication (modulo another number) to generate the next random number and computers are very good at that. Still 60000 times is a lot.
If it is not feasible, then we should probably try something along the lines of what Krikkitone is suggesting. We should be able to come up with a much better estimate of the power of a stack as the one that was described earlier.
By the way, I think that squaring the strength of units is overdoing it.