I had assumed that you would apply such a code in a more general way and not just for amphibious attacks.
It's a possibility, but I think that the amphibious code in particular has some issues. The amphibious assault does two things relatively simultaneously: declare war, and attack your city. That makes it different from almost all other invasions, because in 99% of the cases, the war declaration and the attack on the city take place on different turns. This leads to the defender having a chance to reinforce/whip units, which changes the strength balance.
With the amphibious assault, you know what the relative combat strengths are before the war declaration is made. That means that the AI should be able to decide if it
should declare war. If it "knows" that it can't take the city it was moving towards, it can save itself the war declaration, and the potential for retaliation. At least, in theory.
I'd go for this grumbler-option 2 for an AI (I myself would probably try save my units for a later fight). It's probably the easiest and least abusable way to code the AI and it does some fairly serious damage.
Yes, I neglected that option, but it's a decent one. I must admit that removing the AI pillaging struck me as a poor decision for BTS. The AI might have gone overboard before, but now they go excessively underboard (is that a word?

). A decent amount of pillaging, especially of mature cottages, can be devastating to an opponent, even if you don't actually acquire new cities.
By the way, I've edited the last part of my previous post after you (Bhruic) have read it. I hadn't expected such a quick response.
Well, I have no life.
Also, it's not extremely easy for the Firaxians to calculate these chances. The chance of victory for a single unit-single units battle was only added after one of the earlier patches and if I recall correctly, some players from this forum were involved in the formula to calculate these results. One of the early formulas used by Firaxis also wrongly calculated the effects of first strike on victory. This was fixed in a later patch.
It becomes a lot harder to exactly calculate the chance of victory of 25 units attacking 15 units defending a city. The calculation time for something like that is probably far too lengthy for computers. So you'd need to use some decent estimate for the chance of victory which requires a bit more than basic knowledge of mathematics and chance theory. It's not impossible, but I'm not sure if there's someone within Firaxis who is a specialist in these kinds of estimates.
There's a difference between calculation an individual combat and calculating full battles. Basically, individual combat needs to be precise, where battles do not. For example, let's take a battle between two units, a str 5 Axeman vs a str 6 Horse Archer, no promotions, both out in the open (just to keep it simple). The Axeman, when attacking, has a 27.2% chance of victory. How is that arrived at (you probably know, but for anyone following along)?
I won't bother with the actual calculations, but what it comes down to, is the Axeman has a 45.5% chance of winning a round, and the Horse Archer has a 54.5% chance of winning a round. If the Axeman wins, it does 18 points of damage, if the Horse Archer wins, it does 21 points of damage. So the Horse Archer needs to hit 5 times, the Axeman 6 to win.
At this point, you can calculate, after how many combat rounds does the chance the Horse Archer wins become greater than 50%? I'm not going to go through all the math, because it becomes tedious. Let's assume that it's 8 rounds. That means the Axeman hit 3 times before it died. 3 x 18 = 54, so the HA would have 46 HPs left.
So assume that's the result of the first individual combat. Go from there. Obviously the more fights you have, the more chances you have to deviate from the "average" there are. But at the same time, the more balance you're going to have to offset any deviations. So using something that (relatively) simple, you could calculate the rough odds of winning a battle. And it doesn't have to be anything more than rough, because it never needs to be presented to the player.
And the calculation time being too long for computers? Computers
excel at this kind of mathematical calculation. I think you'd find that it wouldn't slow things down as much as you might think.
Bh