PDA

View Full Version : Improving the AI (M2TW fixes & omissions cf RTW)



econ21
10-17-2007, 15:55
Now I have had about a year to play around with M2TW, I'm starting to get a feel for AI weaknesses and am wondering what could be done to improve it for ETW.

Before M2TW came out, I made a thread in the Colosseum on possible AI improvements for RTW:

https://forums.totalwar.org/vb/showthread.php?t=52465

Looking back on it, M2TW did make some of the improvements suggested in my first post in that thread but some could still use more work. It might be useful to discuss how M2TW advanced over RTW and how ETW could make further progress.



*****


STRATEGIC AI:


(1) Do not attack when outnumbered. I regularly get attacked by AI armies that are weaker than my own and there seems no strategic reason for a desperate assault.

Fixed? This does seem to happen less in M2TW than RTW.


(2) "Double team" armies. Sometimes the AI will have three full stacks and attack me with them sequentially, losing one each time. Instead, they should put two in "contact" and then attacked with the third, so that the first two could reinforce. That would be a challenge (even if only one army was on the field at a time, I would have lost my ammo by the time the second arrived).

Partially fixed Double team armies are a more common sight in M2TW than RTW, but arguably not common enough. I would like to see the AI form a kind of "grande armee" of multiple mutually supporting stacks. The hordes (e.g. Mongols) do this, but they often break up and the more sedentary factions almost never do it.


(3) Stack fleets. The naval war is a joke - unlike MTW, the AI builds enough ships but loses now them piecemeal because they seldom stack.

Fixed :2thumbsup:


(4) Keep armies out of reach of stronger armies (ie keep inferior armies out of the movement range of stronger armies). The AI in Heroes of Might and Magic III did this very well - it makes it frustrating to bring the AI to battle, but greatly increases the challenge.

Not fixed: I think perhaps the biggest strategic AI failure in M2TW is that it lets the human attack at advantageous odds. For example, this table from the beginning of a VH/VH English AAR I did shows that nearly all the encounters are me attacking an inferior AI.

https://forums.totalwar.org/vb/showpost.php?p=1515423&postcount=10

Given that a human can outfight an AI 1:1, these kind of encounters just make the game dull. (Perhaps part of the solution could be a defensive bonus? Such a thing seems more plausible in the age of gunpowder - the attacker has to move into range and expose themselves to more fire.)


(5) Put good generals in command of large armies. Most large AI armies are led by strutting fools and mewling infants (captains), yet there is the occaisional high starred AI generals sometimes left alone in towns.

Not fixed: In M2TW, I've even used the console to add units to a general's stack to max it out and then observed him transfer the whole stack to a captain, so he can go off on his lonesome. :wall:

After playing with M2TW, I would also add:

(6) Pick up dollars on the sidewalk: if I deliberately abandon a province in the middle of nowhere, the AI can often march armies past it and completely fail to take it, turn after turn. There seems no reason for this (e.g. it may be a castle with no risk of rebellion).

(7) Escalate attacks after failure: if an AI invasion is defeated, make sure the next invasion has significantly more men. Don't just send the same sized army to meet the same fate. I swear STW/MTW had this feature. But in M2TW, the AI does not seem to "learn" in the same way.

(8) If you are going to war, mean it. If the AI declares war, it should have a large, superior, army ready to march on you. Civ does this. By contrast, in RTW and M2TW, wars can often be declared when the AI has neither the ability nor the desire to seriously attack you (other than blockade or take a menace a border settlement). It simply has not got itself on a war footing when it choose to declare war.



*****


TACTICAL AI:


(1) Do not attack piecemeal. It is fun to fight Seleucids in RTR v6.0, as they combine phalanxes with fiercesome sword units. But what happens is that the non-phalanx stuff charges in, gets defeated and then the phalanxes arrive. If the phalanxes hit at the same time as the other stuff flanked me, I'd be in trouble.

Partially fixed. The AI does keep together more on the attack. It still may fragment when trying to counter-attack in a defensive situation. (One unit may run at you, get shot to pieces, then run back to its stationary friends. Repeat and rinse till there are no more friends.)


(2) Keep phalanxes in a line and march forward into combat - stop them veering off to make piecemeal unit to unit match ups. In vanilla, a phalanx can crush most other infantry if kept in a solid wall (my German spears could overrun massed armies of hastati with virtually no loss). But the AI can't pull this off and so phalanxes become very weak units for the AI.

Haven't experienced pikes enough to say. The scarcity of phalanxes in M2TW makes it less of an issue, anyway.


(3) Do not open combat by charging in missile or skirmisher units! (Really bizarre behaviour). When attacking the AI does not seem to use ranged superiority if it has it.

Partiall fixed: The M2TW AI has a tendency to let its archers get ahead of their supports when attacking, making them vulnerable to a cavalry charge.


(4) Do not open combat by charging generals into battle (suicide Daimyos are sometimes back in RTW).

Partially fixed. In field battles, the general often does stay further back and in reserve. However, in AI siege defenses with a fullish AI garrison, it is often the general (ok, only a captain) who is the first to ride into my spears.


(5) Do not stand on the defence if getting shot to death. Better try to take some of the enemy with you, than just step into the position of a unit wiped out to enemy missile fire.

Partially fixed. Mainly seems a problem now in sallies?


(6) Do not parade up and down in front of missile fire when defending wooden walls. (Again very wierd behaviour).

Fixed. A lesser problem with AI siege defence in M2TW is that it often only deploys in the town centre if you have artillery (and no siege engines). It might be better on the walls. This could be a feature - without having to build siege engines, you can suprise the garrison - but it handicaps the AI.


(7) Do not reposition to lower ground when the player tries to maneouvre you off a hill. (This refers to Puzz3Ds observation in the recent MTW AI vs RTW AI thread.

Fixed?: I think, not sure.

After playing M2TW for a year, I'd add another problem:

(8) Don't ignore massive flanking movements. It seems alarmingly easy to send your cavalry behind the AI while it fixates on some other point in your line. Getting the AI to assign some men to cover your flanking movement seems required.



*****


Anyone got any other views on how the TW AI could be improved?

I am posting this in the ETW forum - despite the focus being on comparisons between M2TW and RTW - as apparently there will be no more work done on M2TW. So the discussion would be a little pointless in the Citadel.

Noir
10-17-2007, 16:36
Good work econ21

Points 4 to 8 relative to the strategic AI would make the game much much better.

The tactical AI can give a reasonable challenge on the field and even win wars in the long term if he has the resources to wage them, engages when he has favorable odds and comes in a coordinated manner. All of the above were present in the older games.

The strategic AI in STW/MTW was waging war when he had lots of armies and so he was getting/would get on the red; then he would invade the weakest usually neighbour. When he didn't have more armies than the weakest neighbour, he would wait until the opportunity of a weak neighbour presented itself and not otherwise (this is why the Danes an the Aragonese were waiting for ages and were drowning in debts because in the process they were getting all these expensive heirs they couldn't support - but that is easily solved if the boduguards cost nothing to maintain; the actual AI behaviour was correct!).

In RTW/M2 the AI will declare war anyway upon having common borders, even if he hasn't the resources to do so - you can also see the *recently revealed* but long time anticipated "conflict" between the military and diplomatic AI in RTW and M2TW: one turn we offer you a protectorate only to attack you anyway (you accept or not) in the next (with that great stack we brought to make you accept).

Let me add at this point that the AI often opts for mass producing the cheapest units available - and the cheapest units tend to be oddities (like the wardogs or screetching women of RTW). Its better to keep these oddities perhaps as recruitable before a battle (something like siege engines) instead of killing the AI stacks composition in that fashion.

Noir

TinCow
10-17-2007, 17:49
(7) Do not reposition to lower ground when the player tries to maneouvre you off a hill. (This refers to Puzz3Ds observation in the recent MTW AI vs RTW AI thread.

Fixed?: I think, not sure.

Not fixed. I regularly maneuver the AI off of the high ground without much effort.

Zenicetus
10-17-2007, 23:08
(1) Do not attack when outnumbered. I regularly get attacked by AI armies that are weaker than my own and there seems no strategic reason for a desperate assault.

I'd call that one only partially fixed. The AI will still follow through with an planned attack on a player's army that was initially weaker, but then reinforced to be much stronger. Classic example is sieges... an AI army will be spotted heading for one of my cities, I'll manage to reinforce it before the AI can get there, and the AI attacks anyway instead of breaking off. It doesn't seem to be very good at handling last-minute changes on the stategic map. It just plunges ahead blindly with a plan made several turns back.

The other thing I'd stress as a continuing problem is that when the AI does manage to build a large army, it's often poorly balanced. Too many battles, especially field battles, take place with ludicrous combinations of units that you'd never see in real life.

I don't know if this is an AI flaw as much as an overall design issue, but I hope that ETW manages to shift the game more towards open field battles. Both RTW and M2TW are more "total siege" than anything else, and that really gets old after a while... especially since there isn't much variation in the way sieges play out.


In RTW/M2 the AI will declare war anyway upon having common borders, even if he hasn't the resources to do so -

True, but that happens much more often on a H or VH strategic setting, due to the way relations normalize to the worse on every turn. On M it normalizes to neutral, and the AI will only invade across a border if you're the weakest neighboring province and that's the only way they can expand. It isn't driven by slow, steady sink to "abysmal" relations. It's still a problem when they attack without being ready, but that's much more an artifact of the "harder" difficulty settings (which in my experience actually aren't more difficult... it just kills diplomacy and makes the AI do more stupid things than usual).

Noir
10-18-2007, 13:52
A further point that i think was present from time immemorial in TW:

Directions of expansion

The AI factions in RTW/M2 will move first against their "shadow" faction before setting off to expand within the rules that TW factions were always expanding, that is:

1) Rebel settlements take precedence
(remember the Byzantines moving into the steppes in early era/MTW or the Romani moving to Poland straight up in EB? same thing, they follow the line of rebel settlements).

2) Land over water
AI factions prefer to expand over land rather than cross a little water like the straits of Sicily or the Bosporous even though that will make up for much bigger bucks.

As an example remember the Brutii in vanilla RTW that after taking over the Greek cities were not moving over to Asia Minor to reap complete benefits of Aegean trade, but instead were moving straight up north (!) to the poor lands of Dacia. A good exception in this was the Scipii moving over to Carthage and yet this was because Carthage was their "shadow" faction. M2 factions beahave to all intents and purposes in the same way as far as i can see.

*edit* A workaround for this is the insertion of land bridges as we saw them return in M2 - and yet this still doesn't solve the AI's inability to decide what's best to conquer in a particular situation.

There is a major flaw in this behavior: the AI factions do not choose to expand along the routes that will provide them with the most profits (and hence better long term standing, better challenge etc).

It would be quite a step forward in stopping the player outperforming the AI factions in the income department to actually have them expand according to:
a) an assessment of the opponents' strength that can be reached via naval avenues or land

b) an assessment of the benefits of such a move financially speaking; this should consider not only the individual wealth of provincies but also the trading potential (for example if you occupy Greece in RTW then Asia Minor is a very welcoming addition to your conquests at it will make you the sole benefactor of the Agean trade and part of the Black sea trade - the Balkans conversely are not).

To complete it a further assessment should predate expansion "thoughts", and it should relate to the risk that each neighbour poses to the AI faction relative to its strength (is it better to dedicate resources to expand somewhere profitable or is it risky to do so as by that time i will be swallowed?). Surprisingly AI factions in MTW aim to expand someplace that will place them with their back on the wall - for example when HRE is pushed west by Poland, it will expand into France in the hope of avoiding multidirectional pressure and end up fighting only one opponent, which was the right thing to do.

RTW/M2 factions somewhat overconcentrate their stacks in the borbers they aim to expand and leave the rest defenseless, that offers another easy one-up on the human player.

Noir

Daveybaby
10-18-2007, 17:03
One of the biggest (and most regularly complained about) deficiencies in the M2TW AI is stack composition. The AI seems to train stuff in order to reach some kind of balance of units throughout its empire, e.g. 10% artillery, 30% cav, 30% archers etc - the theory (i suppose) being that you will then end up with fairly balanced armies. Unfortunately it doesnt seem to work out in practice. We've all faced invasion stacks full of weak militia, and stacks half-full of artillery.

They really need to take a layered goal driven approach to stack creation (i.e. top-down rather than bottom-up). i.e.

1. Decide what youre going to attack.
2. Decide what kind of stack(s) you will need in order to accomplish this.
3. Source suitable units for those stacks locally wherever possible, and from mercs or from further afield otherwise.
4. Apply some kind of threshold whereby if it becomes to expensive/slow to build the ideal army then substitute other units.

This is generally how a human player does it, although along with most other human thinking its actually a closed loop where youre taking into account what units you have available when you choose where to attack.

econ21
10-18-2007, 18:45
On stack composition, I think a lot of it is due to the AI's low tech position. It is like the early period MTW situation. Where the AI has low tech, you often see rubbish. In our HRE PBM in the Throne Room, we are on 1320 and have deliberately not rushed some AI factions. They are producing lovely armies - in fact, if anything the problem is that they are too elite. We play with "historically balanced" armies - and I've also been spawning some such armies to beef up the AI. But they seem rather feeble compared to what the AI is preparing. (e.g. the almost all knights and footknights; the Egyptians had Sudanese gunners, massed elite axemen and Royal Mamelukes). The problem of too many elites could be an issue for ETW, if the French end up fielding an army full of Old Guard regiments or something.

I agree a different approach to army composition would be good. Maybe rather than programme what each settlement should recruit, ;programme what each stack should have. I think I heard that ETW will be shifting the focus of recruitment from settlements to armies, which would make such an approach feasible.


RTW/M2 factions somewhat overconcentrate their stacks in the borbers they aim to expand and leave the rest defenseless, that offers another easy one-up on the human player.

The defenceless point is a big weakness of the RTW/M2TW AI - I forgot to mention it. AI garrisons are typically minimal. There should be a standing garrison of around half a stack in any settlement the human can reach. Some economic cheats may be necessary to fund them, but given the free upkeep idea, that's not too jarring a concept.