View Full Version : Explanation of Suicidal Generals from CA
Red Harvest
03-24-2005, 19:14
This was posted by Dutch of CA @ .com
The AI does go to quite a lot of trouble to evaluate troop strengths of groups of units against other groups - taking into effect a lot of fairly detailed things like frontage, unit disorder, relative kill rates and morale. Flanking sub-objectives and so on play a big role as well.
But there is a chunk of code of last resort, which is there so that something gets done when there are no good choices, and that generally tries to find a weak point for the strongest unit to attack. This is the code which was referred to in the comment above - what it says is a layman's simplification of a part of a system, and shouldn't be taken as gospel as to what precisely is done or not.
Hopefully that clears up any misunderstanding...
Very useful info.
He then added this in a subsequent post:
The problem is, sometimes using the general's unit as a battle-line-breaker is the right thing to do, and a very effective tactic. Especially if the army has few units and/or a lack of armoured troops. It's just that identifying those cases, and discouraging the remainder, has proven a little tricky. The AI as a whole has been one of the areas which we have been focussing on, for, um, "future products".
The AI as a whole has been one of the areas which we have been focussing on, for, um, "future products"...
This is certainly what people want, hopefully expressed in a Rome expansion.
Dutch_guy
03-24-2005, 20:08
it's good that CA actually commented on this matter
also nice to know that they are trying to make a better AI in the next products
So if the generals are modded to a weaker unit, and then taking into account they have a unit of cavalry that is stronger than the general............ would I be less likely to see the general on the opening phase of combat.
Movement speeds in a way kills the A.I. even when support was alongside the cavalry it is quickly lost in the quick charge.
The other problem is I found a weak center is a killer for the A.I.
I've found it is usually best to put your worst units in the center. Well the A.I. hits your weakest units pushing them back and in no time the A.I.'s best units are surrounded on 3 sides
Red Harvest
03-24-2005, 21:27
The weak center effect makes sense. I've long used the approach of keeping weaker units in the center. Great generals sometimes did this with weak or unreliable units (Hannibal for instance.) It boosts their morale because they are near the best officers, they are supported on the wings, and they can't very easily run away. No wonder the AI is always charging my center with all its captains and generals.
I'm glad to see CA's explanation, but I still can't understand why they didn't opt for pushing other strong units against the weak point, rather than the general's cav. He really should have been used primarily as a heavy reserve.
SpencerH
03-24-2005, 22:32
Its not that generals shouldnt be thrown into the fray, its that timing when to use generals is tricky. Too soon and they get chopped, too late and they're ineffective. There must be some way to mimic human calculations as to when to employ them.
Red Harvest
03-24-2005, 23:05
I err on the side of not throwing them in until I'm sure they will be decisive or can't easily be killed. I'm not quite sure how to get the AI to make the same determination other than holding them as a heavy reserve. Most of the time when I commit my general it is to *counter* the AI's general or cavalry. The rank and file are already committed.
Uesugi Kenshin
03-25-2005, 04:15
If the enemy has a large advantage in number, style and ability of troops they do not usually do the suicide general charge. I was playing my Sparta campaign today and had to take on a Roman army that heavily outnumbered my troops. The general was only comitted after the computer's flanking attempts had failed and my phalanxes were reforming. Seems to keep with what CA said...
Nice to see a post from a CA staffer!
Heck..even Sega is posting at the .com these days...(did anyone ever hear from Activision?)
It's also reassuring that CA still appears to consider the TW franchise a viable product and is more than likely considering either an expansion or parallel product.
Gee...this post sounds like a bit 'o trolling...but I'm just happy to see CA actually communicating with us 'target audience' again.
Not just giving us the 'party line'.
Es Arkajae
03-25-2005, 05:46
Well in all fairness I can sympathise a bit with the CA staff, how much bitching must they recieve from people I wonder?
Some of the bitching is quite relevant and it does indeed point out things that they should have by all means gotten right, but I doubt having people nagging at them constantly is going to help them much.
On topic.
I've found that the enemy general typically charges right for my centre even though my centre is usually as strong as the rest of my line, my flanks usually have my cavalry behind them but I place my generals bodyguard right behind the centre, so perhaps the enemy doesn't count the enemy gneral unit into its calculations when deciding who to charge.
Usually I have to send in my own general unit to counter the enemy general, which makes for a nice man to man showdown between the two leaders, one time I even zoomed in and saw my actual general (not one of his bodyguards) strike down the enemy general~D
Its not that generals shouldnt be thrown into the fray, its that timing when to use generals is tricky. Too soon and they get chopped, too late and they're ineffective. There must be some way to mimic human calculations as to when to employ them.
There probably is. Most good generals - and all great ones - could sense when the enemy's morale was at it's weakest, and knew that was the time to "throw in the reserve". Since this is a game, unit morale level is a mathematical number, and hence potentially "knowable" by the AI. The recommendation which follows is probably not moddable, but should be "codable" if CA really wants an elegant fix to the problem:
Given that unit morale is a mathematical value, it should be possible to hold back the AI General until such time as he "knows" an opposing unit is about to snap, and then - and only then - would the AI release the General into the fray. Better yet, you could adjust this "knowledge" using a factor based on the General's Ranking (number of stars). For example: During a battle, as soon as the first enemy unit sees it's morale fall to a critical value (such that one more shock would surely break it), this value is immediately passed on to the AI, which factors it. If the AI General has 1 star or less, there's only a 40% chance he'll get the order to attack. If it's 2-3 stars, maybe it's a 50-60% chance, and so on until you get a 5-star or greater general who will be given the unfactored number and will always know "the time is right". The corollary to this is that AI generals who never get that message will withdraw rather than fight at all - which I suspect is the more realistic historical outcome anyway.
(Note: The number of stars and corresponding percentages are just examples, the real values would have to be playtested to find the optimal combinations)
Red Harvest
03-25-2005, 06:40
Kull, I can't disagree with the basic premise...except for trying to adjust if for general's stars. That is a slippery slope. I'll stick with the ideology of focusing on building one decent AI. (The old KISS principle.) Now, if the AI gets so good that the average human player cannot beat it on equal terms, then it is time to start artificially handicapping it. We are a long way from that at the moment.
Craterus
03-26-2005, 01:19
i hate the way that an AI reinforcement general suicidally sacrifices himself.. i lost a faction leader in one of my first campaigns like this!
I think there is another factor for suicidal generals.
Notice that when you order the army as group to move to some location.
Faster units like cavalry will come first. They won't wait other units, or synchronize their movement.
That'll make them vulnerable, since they first arrive near enemy.
Craterus
03-26-2005, 11:32
Notice that when you order the army as group to move to some location.
Faster units like cavalry will come first. They won't wait other units, or synchronize their movement.
That'll make them vulnerable, since they first arrive near enemy.
If you order the whole army to run the cavalry will arrive first but if you order them to walk they will arrive at roughly the same time.
Someone Stupid
03-26-2005, 14:02
Yes, this was so hard to code to prevent.
If "General"
..then "stay"
....else "attack"
Yes it is overly simple but it explains what could be done which is better than the instant death that happens with them mostly now. Also the general would never attack that way, but I'd rather a general that doesn't attack than one that will barrel headfirst into a row of spartans (as nice as it is for me to kill a faction heir this way, it loses its wow factor when it becomes expected). Some simple additions to that "code" above could have the general wait until he is needed or to avoid certain enemies (those with long pointy sticks generally). Not an issue of can't fix it, it is an issue of them not wanting to fix it.
The_Mark
03-27-2005, 19:09
While testing defensive formations, I have noticed that in many cases AI breaks its formation with no apparent reason, sending its units to charge my lines piecemeal. I struggled with this problem, trying to figure a way of forcing AI to keep its form. Then I tried different unit sizes. On small size AI charged. It charged on normal. It charged on large. But it didn't charge on huge; on huge it kept its form.
Now, if AI checks that a unit seems weak enough for a frontal charge that'd break the unit (as it tries to do with a general), why wouldn't this apply also on normal units? And what if the checks that are made check the manpower of the unit to be charged, but not the unit scale the game is being played on?
Wouldn't that equal as:
Small unit size, 20 men unit (although full strenght, in neat order, in the middle of players line) vs a full-strenght AI unit => AI perceives the situation as: "only 20 men, full-strenght gen. bodyguard/full-strenght swordsmen will break it instantly"
Huge unit size: 160 men unit (full strenght, in neat order, in the middle of players line) vs a full strength AI unit=> AI perceives the situation as: "damn, 160 men, even a full-strenght gen. bodyguard/full-strenght swordsmen wouldn't break it"
That is, it could be that AI checks the percentual strenght of its own unit against the raw soldier count of the players unit.
I haven't tested this conclusively, but I am pretty sure that this is the case.
Maybe generals should be simulated abstractly instead as a physical unit. Routing is completely out of control and unrealistic as is without the additional routing because a general died.
Does anyone know how the AI controls its general if the number of soldiers in a general's unit is modded down to the lowest possible, i.e. 1 in the export_descr_units file?
Does it then still consider the general unit to be such a tough unit worthy of frontal assault?
Given that the AI has in general fewer family members than the human player, maybe this is a suitable way to balance out the advantages of having family members on the battlefield?
screwtype
03-29-2005, 07:29
IMO, they should program the generals so they only join the fray either when the enemy is on the verge of routing, or when the AI's own troops are on the verge of routing. IE they should be used as an emergency reserve, to enter combat only at the critical moment.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.