Unofficial BTS 3.13 patch

If it's so easy, then someone as talented as you must surely be able to do it, heh?

I didn't say it'd be easy, just that it should be possible. :p

I do remember that in civ3, you could fairly easily make the AI move like a puppet on puppet-strings by continuously moving your defenders around on your own infinite movement railroads. An AI army of 50 units would move from city A with 10 defenders to city B with 1 defender and the next turn from city B with 10 defenders to city A with 1 defender. It's probably hard to avoid AI puppet-string behaviour if you make the AI turn back from attack plans when situations deteriorate. I even vaguely recall some comment from an AI-programmer of Firaxis saying something along these lines.

Yes, and in fact I've brought that up myself when appropriate. But I'm not sure it's relevant to this case. The whole point of the amphibious assault is to take the enemy by surprise. If they don't know you are coming, they can't move defenders in.

The real question comes, however, as "what to do if you can't win". As a human player, if you move a large stack to attack an enemy city, and when you get there, you realize you can't win, what do you do? What would be the best course of action? Assuming, for the sake of argument, that you're facing a competent opponent, as opposed to the AI (where you could simply move to attack another city, and the AI would let you).

The two options I see are sit and wait for reinforcements (which the AI does sometimes choose), or withdraw. The first makes the assumption that you can get more attackers to the city than the other player can get defenders. The second effectively stymies any invasion plans. Are they better choices than suiciding units? The advantage of suiciding the units is that you no longer have to pay the upkeep for them. Not a very strong advantage, obviously, but is it much worse than the alternatives?

Bh
 
The two options I see are sit and wait for reinforcements (which the AI does sometimes choose), or withdraw. The first makes the assumption that you can get more attackers to the city than the other player can get defenders. The second effectively stymies any invasion plans. Are they better choices than suiciding units? The advantage of suiciding the units is that you no longer have to pay the upkeep for them. Not a very strong advantage, obviously, but is it much worse than the alternatives?
Bh

Two additional uses that would make sense:
1. Reroute the invasion force and use it against another enemy.
2. Suicide them by reckless pillaging.
 
I didn't say it'd be easy, just that it should be possible. :p

Heh. :D

Yes, and in fact I've brought that up myself when appropriate. But I'm not sure it's relevant to this case. The whole point of the amphibious assault is to take the enemy by surprise. If they don't know you are coming, they can't move defenders in.

I had assumed that you would apply such a code in a more general way and not just for amphibious attacks.

The real question comes, however, as "what to do if you can't win". As a human player, if you move a large stack to attack an enemy city, and when you get there, you realize you can't win, what do you do? What would be the best course of action? Assuming, for the sake of argument, that you're facing a competent opponent, as opposed to the AI (where you could simply move to attack another city, and the AI would let you).

The two options I see are sit and wait for reinforcements (which the AI does sometimes choose), or withdraw. The first makes the assumption that you can get more attackers to the city than the other player can get defenders. The second effectively stymies any invasion plans. Are they better choices than suiciding units? The advantage of suiciding the units is that you no longer have to pay the upkeep for them. Not a very strong advantage, obviously, but is it much worse than the alternatives?

Two additional uses that would make sense:
1. Reroute the invasion force and use it against another enemy.
2. Suicide them by reckless pillaging.

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.

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.
 
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
 
3. If this is was planned as an amphibious assualt, consider whether landing first would have suitable odds of success to make it worthwhile.
 
3. If this is was planned as an amphibious assualt, consider whether landing first would have suitable odds of success to make it worthwhile.

Again, the problem with that is that by landing, you give the defenders time to react. Now maybe they can't, which is fine. But if they can whip a defender, or move some up, or draft one, then any combat odds calculations are going to be outdated - and possibly incorrect.

Bh
 
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 agree that the amphibious attack is a bit different. I just thought that you meant it in a more general way. It was just a misinterpretation of your previous statement.

It's probably possible to make the AI also more cautious in normal battles, but as we both understand it can be tricky to avoid a human puppet-master strategy. But if it could be done, I think it would be worth while. The solution in avoiding the human puppet-master could be found by adding some randomness to the AI decision making. The civ3 AI was also far too cautious as it would avoid successful attacks if it saw potentially more successful attacks in another direction.

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.

Agreed (and underboard should be introduced a new word in the English language). I don't think that pillaging is usually a cost-efficient strategy for humans, but if you have already committed some units to an attack and you are a stupid AI, then you'd best make the enemy hurt as much as possible before you lose the units. A good strategy for an AI is not necessarily the same as a good strategy for a human.

There's a difference between calculation an individual combat and calculating full battles.

[snip]

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.

What you're describing here is an estimate and I agree that that's the way to go (I said so in the post you quoted) and I agree that it can be calculated in a very very short time. But the exact calculation of victory between 2 large stacks would quickly become far too much for any computer. The number of calculation steps needed for an exact calculation has an exponential relation to the number of units in both stacks.

I guess that it is fairly simple to do if you only want an estimate. Just do the battle between the stacks 10 times (without showing the animations) and then just take the average result as a measure for the success chance of this battle (perform a simulation to estimate the result). I can't imagine that that would take any serious amount of time for a computer and the estimate would be more than accurate enough. It would be far more accurate than the estimate made by most humans who see those 2 stacks, so it's a good enough basis for decision making. And it's also fairly easy to implement as the combat code is already in the program.

But I'm not a programmer, so maybe I shouldn't talk about things in programming being easy. ;)

edit: If one can learn the AI to not attack in certain cases (suicide) and then learn the AI to retreat in 50% of the cases and pillage in the other 50% (randomly), then that would be annoying to defend against. And if humans find it annoying, then it must be a good strategy from the AI. ;)
 
I'm wondering if my original point on amphibious attacks has been slightly overlooked guys ;)

I'm purposly using a pre-railroad example, because its so typical of many of my games.The ai has scouted (earlier, but now generally its info is far outdated). It thinks it sees a fairly undefended coastal city of mine. It arrives with 12 galleons full of lets say assorted cannons, trebs, knights, muskets and a few Grenadier. My city has 60% cultural defence, and now 3 rilfes and a grenadier guarding it.

If it attacks from the sea, it may, just may take the city with a handful of troops left alive. It will probably loose all its siege equipment, and unless it has a massive 2nd wave on its way, it will almost definetly lose the city very quickly. It will have taken so many casualties, that the war is virtually over before it began, and taking my four defenders out, has also given me a large amount of xp before the defenders succumbed. Now I don't typically have 30+ stacks of units just idling around, unless Im preparing either for an attack myself, or to be attacked......so.....

Now take example 2, where the ai lands its stack first. I suddenly have a stack of 36 units sitting by my city. But what the heck do I do? I don't have the number of units to take them out. I can whip a unit or 2. Big deal, it isn't going to make that much difference. I am without the slightest doubt going to lose that city, and Im probably best leaving it to its own fate. At a guess even being patient and bombarding first, the ai can probably take the city with most of its force intact (especially if it sacs the siege units (some of which will probably survive.))

Now I have a real problem, on how to take the city back, if I even can in the short term. If the ai NOW has even a small 2nd wave on the way, I've REALLY got problems.

See the difference? (sorry I know you do)....

As I said in an earlier post, if I DID have enough troops sitting around to completely disrupt the ais stack when it lands(troops that could reach the point of incursion in 1 or 2 turns), then there isn't a cat's chance in hell of it holding the city anyway. So why waste all those troops in the first place?
 
Again, the problem with that is that by landing, you give the defenders time to react. Now maybe they can't, which is fine. But if they can whip a defender, or move some up, or draft one, then any combat odds calculations are going to be outdated - and possibly incorrect.

Bh
And the decision analysis by the AI should take this into account by adding a "fudge factor".

Here's the scenario. The AI decides to do an amphib invasion. It builds and assembles the force. They sail over. They see the target city. It has troops in it. The AI crunches some numbers and the result falls below some threshold.

At this point the AI
1) goes home
2) attacks somebody else
3) goes through with the attack anyway (which is what it currently does)
4) lands and attacks conventionally

Without a doubt, #4 will allow the defender at least 1 extra turn to rally more defensive units, or to counterattack the landed stack. The AI needs to take this into account when deciding which of #1-#4 to do.

Sometimes, the AI may be close enough in power to the current defenders that even one more defending unit will make it not worth while to land. Thus, he should do #1 or #2 instead.

More often, the AI will have such overwhelming power that it's purely the amphib penalty that is killing the odds. This is when #4 is a good idea.

Wodan
 
What you're describing here is an estimate and I agree that that's the way to go (I said so in the post you quoted) and I agree that it can be calculated in a very very short time. But the exact calculation of victory between 2 large stacks would quickly become far too much for any computer. The number of calculation steps needed for an exact calculation has an exponential relation to the number of units in both stacks.

It's actually implossible to do an exact calculation of victory between 2 large stacks. Combat results between 2 units has no outside factors. Combat between multiple units does. For example, if my Axeman stack attacks a city with 2 units in it, one possibility is that I beat the odds, and kill the first unit. Another is that I lose, but damage the unit heavily. Another that I damage it weakly, or don't damage it at all. Predicting any further combat would require knowing the results ahead of time, which is impossible.

I guess that it is fairly simple to do if you only want an estimate. Just do the battle between the stacks 10 times (without showing the animations) and then just take the average result as a measure for the success chance of this battle (perform a simulation to estimate the result).

That's another way to do it, but I'm not sure that 10 times would be a sufficiently large sample size to determine the probability.

edit: If one can learn the AI to not attack in certain cases (suicide) and then learn the AI to retreat in 50% of the cases and pillage in the other 50% (randomly), then that would be annoying to defend against. And if humans find it annoying, then it must be a good strategy from the AI. ;)

Well, the true suicides (the single unit attacking a city with 5+ defenders) definitely need to be removed. As for what to do the rest of the time, it'll depend on combat odds. It still might be better for the AI to wait for reinforcements in some cases.

Bh
 
I'm wondering if my original point on amphibious attacks has been slightly overlooked guys ;)

I don't think it's been overlooked, the solution(s) we are talking about for other areas apply here too.

As I said in an earlier post, if I DID have enough troops sitting around to completely disrupt the ais stack when it lands(troops that could reach the point of incursion in 1 or 2 turns), then there isn't a cat's chance in hell of it holding the city anyway. So why waste all those troops in the first place?

That's assuming the AI is going to try and hold the city. If it ends up razing it, then mission accomplished, no?

Bh
 
And the decision analysis by the AI should take this into account by adding a "fudge factor".

Oh, I know. I wasn't trying to shoot down your idea, I'm just saying that trying to perform a combat analysis with (effectively) incomplete data leads to a large amount of ambiguity.

More often, the AI will have such overwhelming power that it's purely the amphib penalty that is killing the odds. This is when #4 is a good idea.

It's certainly a better idea, yes. I think we all agree that the current system is decidedly poor. The area of discussion is more focused, at least in my mind, on trying to make that decision (the odds calculations) accurately enough to be useful.

Bh
 
Yeah.

Well, we alredy have an algorithm that performs the analysis on the ground, don't we? (Or, do we? Does the AI currently suicide it's SOD even if the defenders are in overwheming strength? I usually kill SODs before they get to my cities, so I find myself unsure of the answer.)

If so, then the next question is how good that algorithm is.

If it's pretty good, then adding a check for the amphib situation should be pretty straightforward.

If it's not, then the problem is much bigger.

Wodan
 
There's got to be some sort of check being made, because of the fact that some times armies will stop and fortify instead of attacking. But that check can't be terribly effective because I've still seen attacks made that had little to no chance of winning. I'll have to dig around a little and see if I can find where it's making that decision.

Bh
 
I know from the reference sheet, that the AI Leaders have something like "Attack Curage" defined in the XML, which probably influences the decision to attack at low odds.
 
I don't think it's been overlooked, the solution(s) we are talking about for other areas apply here too.



That's assuming the AI is going to try and hold the city. If it ends up razing it, then mission accomplished, no?

Bh

Yeah I said that in the same earlier post too,;) then mission accomplished, but how often does that actually apply?
 
From the looks of it, it merely does a "plot strength" comparison. Plot strength seems to merely be the sum of the strength of all the units on a tile (modified based on promotions/terrain/etc). The combat odds are simply the ratio of strengths (attackter str x 100 / defender str).

Bh
 
Well I suppose the first step would be to add in dynamic modifiers such as attacking from sea or across a river. At least, it sounds like that's not currently counted.

Wodan
 
No, those are counted - part of the "modified based on promotions/terrain/etc" that I mentioned. It takes things like attacking amphibiously into consideration. But I'm not convinced that it does a good job of estimating combat effectiveness. For one thing, it doesn't take collateral damage into consideration (which makes a str 5 catapult much stronger than it appears).

Bh
 
Back
Top Bottom