Log in

View Full Version : HELP!  The French... They keep running away!



AgentBif
08-14-2003, 18:56
One thing that kind of annoys me about the AI is that it refuses to fight until it's got at least a 2-1 advantage.

I've been holding Aquitaine and Toulouse for a long time against massive French stacks on the borders. Finally I get around to expanding my territory by rustling up a good stack and a half against their 3.5 stacks and they refuse to fight. They back off until they have like 5 full stacks against me. But then the battle is super tedious... Assaulting a 5000 man army takes SO LONG.

Sigh.

I guess what this gripe really comes down to is that the tactical AI, as impressive as it is is still no match for a reasonably competent human.

Are there any obvious ways you guys can think of that could improve the tactical AI code?

A couple things I can think of:

1) Fix whatever causes it to get indecisive and zig-zaggy when approaching a defensive line... that only makes their troops target fodder for defensive archers.

2) Stop rushing troops around and tiring them out by constantly trying to keep higher ground.

3) Focus all archers on the same high value target (questionable)

4) Try hammer and anvil tactic more... Charge spears followed by a flanking shock unit. Try to flank more aggressively.

5) Keep cavalry in back rather than rushing them first.

Perhaps if we arrive at a concensus of ideas CA may notice and fix up the AI in some fantasy world where they keep striving to make this great game even better... the way it deserves to be...

Crash
08-14-2003, 22:27
There's been much discussion about the inexplicable AI tactics in battles. I read in one post, that the developers themselves do not do well in MTW battles, but that is just rumor. If you read about the history of computer chess programs, one of the factors that is mentioned is that the program can be no more knowledgeable about chess than the programmers. The MTW AI can be no better in the battles than the software engineers who created the program.

Battle tactics are a complex problem because of the dynamic, real-time, fluid situations in most scenarios. Furthermore different mixes of units require different combinations of tactics. The AI is pretty good for a $40 piece of software, it's good enough to beat me once in a while.

My thought is that the AI could use "profiles" or "styles" for each general, which would limit the combinations or possibilities that AI would have to consider. The more complicated the situation, the more processing the computer has to do, and at some point it has stop "thinking" in order to continue the battle. It's possible that the MTW AI, given an unlimited amount of time to "think" could play much better.

Don't get me wrong, I'm not makeing excuses for MTW, there can always be some "tweaking" to improve it. So it's a good idea to start making a list of those tweaks. I'll add my suggestions after I've thought about it some more.

DrHaphazard
08-15-2003, 00:40
Haha, i'd never considered that the programmers lack of knowlege on military matters might hamper the programming.

Of course i think that its important to point out that CA has done a pretty damn good job given how utterly complex it must be to tell the computer how to wage war. Like all other computer games where the computer must consider strategy the human player will eventually figure out the rules it works by and figure out a way to beat it. I havent played a strat game yet where the computer is always finding new ways to beat me.

But i do wonder how much of the programming we can change. I know for MedMod that the developer (among other things) made the computer do smarter trade routes. How is this done? Is it possible that we could write some improved code for the AI, to make some type of elite AI?

Of course then there must be some kind of randomizer. Every game is different, at least as far as the other factions are concerned. Sometimes the Italians dominate, sometimes they get killed off by the Germans. How is this randomness insured? I mean if you think about it, given the same starting position, shouldn't the computer always make the same choices? How does that work?

Oaty
08-15-2003, 00:59
I've noticed the comp likes to retreat and not fight the battle if they are outvaloured, but will remain if the opposite is true. I had this happen where I had some units seiged in a castle and thought I'd leave 1100 troops there to hold the siege and maintain the loyalty. While my generals were advancing there conquest, the 300 men A.I. comes out of the castle rampages all my valour 0 units. It was then that I realized the comp looks very little at #'s and instead takes valour into consideration

khurjan
08-15-2003, 05:46
well thoe creative assembley should start using help from military historians like me who are qualified software engineers too...i do it for free as hobby for various studios that specialise in making war games.
let me put it this way a competent programed ai with the help of a military historian or theorist would help them alot of companies like paradox or battle front for combat mission uses our expertise you dont hear alot of complain from their fans where our ai is implemented except in earlier stages of hoi. so i suggest to them to use the wealth of info we can provide to make a competent ai and give you guys a challenge

DrHaphazard
08-15-2003, 07:05
I wonder if someone like khurjan wrote to CA offering their services what the response to be. I would think there was already some military historian working on the strategy up there, but you never know.

What are your thoughts are the strategy as is khurjan? Also, and this is simply me being curious, how do you go about writing out a strategy for the AI? This is certainly a very broad question, but i'd be very intriguied to know the basics.

Duke John
08-15-2003, 08:20
Lord Krazy made a new army formation to make Napoleonic armies more resistant to cavalry attacks. So it's possible to create new army formations from which the AI can choose. If this is something that needs to be altered for a more competive then this is at least one thing that you can change to better the AI tactics.

Cheers, Duke John

AgentBif
08-15-2003, 13:12
Quote[/b] (khurjan @ Aug. 15 2003,20:46)]let me put it this way a competent programed ai with the help of a military historian or theorist would help them alot of companies like paradox or battle front for combat mission uses our expertise you dont hear alot of complain from their fans where our ai is implemented except in earlier stages of hoi. so i suggest to them to use the wealth of info we can provide to make a competent ai and give you guys a challenge
The problem of making the battle AI more capable is not a matter of historical, strategical, or even grammatical accuracy http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif

It's an issue of clever algorithm design by means of clear tactical analysis in terms of the in-game assets and ruleset.

The game is not a simulator, after all...

The_Emperor
08-15-2003, 13:26
I think the main reason the AI chooses not to fight ont he strategic map is because of the enemy general's Command ability (and its effect on valor).

Humans will always have their best Generals in Command in key attacking armies... The AI on the other hand doesn't manage its armies quite as well, and often has a really good General sitting off in some far off province.

So by the time the Human army reaches the good AI General (after the AI has withdrawn its troops so often) chances are that the faction has lost so much territory that they are crippled beyond repair (and the enemy commander has the huge force).

This happened to me when I was playing as the Turks at war with the Egyptians... Thier best General was never leading attacks, and often ended up in Egypt doing nothing (Until I attacked from the ocean with a big army and all he had was 2 units of Ghalums, which were just shot down with archers)

The Sultan (with the big army) only had a pathetic two star rating and a Good Runner vice... yet he always seemed to be the one to direct attacks against me.

The AI sucks at organising generals, and Command=Valor and Valor wins battles.

hoom
08-15-2003, 15:16
The problem with the AI zigzagging is that humans set up defensive positions to defend the flanks often by placing them up against the border & the AI quite aggressively attempts to flank but recognises a defended (or inaccessible due to the border) flank so tries to go the other way.
Finding the other flank well defended, it goes back to attempting to flank the other side & continues zig zagging till the point where the AI goes for a frontal attack where it gets clobbered.

The obvious solution is to set up camp away from the border.

This has two problems from my experience:
There are few maps where there is a decently defensible position away from the border forcing the human into a weak position.
The AI now has a much easier time flanking, which the human responds to by redeploying units. The AI recognises the strengthened flank (often for me I wind up pretty much rotating my whole army 90 degrees)and so tries to flank the other way. This again results in the human redeploying to face the threat causing another zig and so forth.

Basically, when I have tried deploying away from the border, the battle becomes just a case of bigger zigs & zags but the human has to zig & zag too or face the enemy army flanking en-masse.

I believe the main problem with the combat AI at the moment is that it tries too hard to flank one way or the other resulting in indecision and humans backing up to an unflankable position causing more indecision.
this indecision results in units zig-zagging infront of the humans missile units.

Also, defending AI armies are rarely set up in anything approaching a good position.
Even when they are, when the human attempts to flank, the AI just up & relocates to the other side of the map (often even abandoning what was high ground) rather than a minor readjustment.


In other situations, the AI does many quite sensible things like in one situation a mongol horde scouted around, realised that my whole army was hidden in trees & well protected on the flanks (I was away from the border in order to get my whole army in the trees), made a couple of little skirmishes & then sensibly withdrew with minimal losses knowing that it couldn't beat me entrenched in the forrest & not able to be lured out.

Crash
08-15-2003, 16:45
Quote[/b] (arrrse @ Aug. 15 2003,09:16)]Also, defending AI armies are rarely set up in anything approaching a good position.
Even when they are, when the human attempts to flank, the AI just up & relocates to the other side of the map (often even abandoning what was high ground) rather than a minor readjustment.
If it's true that defensive battles are more difficult for the AI, then the human player has a huge advantage over the AI since defensive battles are generally easier for the human. Imagine an AI that can defend it's provinces almost as well as a human player, there would be a huge shift in the balance of play.

Maybe one thing that could be done to improve the situation for the AI is to have more defensible terrain available on battle maps. That would give the AI some help in setting up it's defensive formation, and allow the human player to deploy up away from the edges of th map. This would be more realistic since in real life, a commander on defense would always choose to fight on more defensible terrain.

AgentBif
08-15-2003, 20:16
Quote[/b] (Crash @ Aug. 16 2003,07:45)]Maybe one thing that could be done to improve the situation for the AI is to have more defensible terrain available on battle maps. That would give the AI some help in setting up it's defensive formation, and allow the human player to deploy up away from the edges of th map.
BTW Arrrse, nice solid comments you made... good analysis.

I think CA recognized some of these fundamental problems and is fixing them in ROME this way:

There ARE no map edges in RTW

Really, the only possible way to solve this problem was the way they handled it: a totally fluid 3D battle map that is the strat map too... IE, the whole world is your playground when you do battle http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif

So with the edge problem removed, they would still have to tone down the amount of repositioning the AI makes in terms of flanking and being flanked. I suppose the AI code should be designed to handle flanking on a per-unit rather than per-army basis. IE: pick a good hill and park there. If the human tries to flank one side, rotate whole army. If the human tries flanking both sides, split army into 3 parts: left, right, and center reserve. (This is how I generally operate against AI or other humans.)

One of the major keys for the AI I think is to maintain a reserve force of 1 or 2 defender units (spears) and 1 or 2 flankers (cavalry). Certainly cavalry should never be the opening gambit.

Another key to making the AI challenging would be to have it choose semi-randomly among a variety of overal tactical approaches at the beginning and then perhaps even change the overal tactics sometime in the middle if it takes a while for real battle to get going. This would help make it more difficult for the human to anticipate how the AI is going to behave in response to what the human does.

EX: Major tactical modes might be:
1) aggressive flanker... fast units work hard to attack archers or backsides of infantry units
2) conservative: tight line moves gradually into engagement, flanking units held in reserve
3) missile: camp and let missile units do all the work for a while
4) bait and squish... hold missiles and infantry back, send flankers forward to engage and run, hopefully stretching out enemy formation so there is room for flanks on individually exposed human units.
5) etc...

If the AI waits to reveal just which of these kinds of overall approaches it's going to use, it will be harder for the human to approach the battle in a formula kind of fashion.

Another way to think of this is in terms of personality of the general. Some generals are aggressive, some cautious, etc and you don't always know what they're gonna be like unless they're one of the really big famous ones. Even then, the better generals are often victorious because they are unpredictable and creative in their overall approach to each battle.

Crash
08-15-2003, 22:01
Quote[/b] (AgentBif @ Aug. 15 2003,14:16)]Another key to making the AI challenging would be to have it choose semi-randomly among a variety of overal tactical approaches at the beginning and then perhaps even change the overal tactics sometime in the middle if it takes a while for real battle to get going. This would help make it more difficult for the human to anticipate how the AI is going to behave in response to what the human does.
Excellent idea That's what I was thinking earlier when I suggested "profiles" or "styles" for the AI general. The better the general the more "tactical approaches" he will be able to utilize, so you don't know what he's going to hit you with before the battle. A less competent general will have fewer "tricks" in his bag. There could a set of modes, one for each faction, and within each set there would be several tactical approaches appropriate to the historical techniques of each faction.

I wonder if there is a way to mod the current MTW/VI, so that all defensible terrain is in the center of the map, and no defensible terrain is on the edges of the map. This would force both human and AI players to set up in center of the battlefield, unless they intend to withdraw from the beginning.

hoom
08-16-2003, 14:08
Yeah I like the idea of styles/profiles too.

I think there may be a bit of it going on already but the interesting ones don't come out very often.

There should be a bit of a hierarchy to them:
Culture > Competence > Tactical Preference/Selection

A Roman general is going to use different basic tactics to what a Barbarian general would.
A low star general is more likely to get caught out by ambushes and flanking and will have fewer Tactical ideas to select from. A one star general would probably have one form of attack: Frontal assault. While a 7 star general would scout, spot potential ambushes, flank, dummy etc

Asmodeus
08-18-2003, 11:50
Interesting thread http://www.totalwar.org/forum/non-cgi/emoticons/smile.gif

AI is a dark art and although I'm a programmer AI is way beyond my experience.

While we're on the subject of AI improvements I'm surprised there arent more games that use a 'learning' AI.

The only one in fact that I can name is an old classic X-COM Apocalypse. For those of you that dont know it (where have you been???) It had two modes of play similar to MTW, ie a campaign mode and a tactical battle mode.

The tactical mode was fairly simple, you had a squad of guys hunting down aliens in buildings or crashed UFO's (all good stuff&#33http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif but the thing that made it really 'clever' was that it recorded the results of every battle. It would use this 'knowledge' to improve the aliens tactics. How it did this and what it actually recorded after each battle is a mystery to me but the point is it worked and even better, even if you are a military genius it will still get progressively harder to play.

An example....

1st Battle - UFO crash lands and my X-COM squad take positions around it and observe, Aliens come out to patrol and quickly get whacked.

3rd Battle - Same situation as above except that the aliens no longer come out of the UFO on their own, they attack in groups.

6th Battle - The aliens are now being annoying. They dont come out of the UFO at all which means I have to go in and assault it. The aliens are using cover more effectively and use grenades (even smoke grenades) very effectively. Where do they get these ideas from hmmmmmmm?

10th Battle - The aliens have learnt to take up a group position guarding vital points and entrances etc. They appear to be copying the exact same tactics I used on the first battle when the aliens came out of the UFO.

Imagine MTW with an AI that through trial and error would learn from you exactly how to fight a battle - that would be cool http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif

Parmenio
08-18-2003, 20:32
A number of the things that stuck me about the Total War game:

(1) The 'Point of View' appears to be that of a cameraman in a helicopter.

Realistically your PoV should be restricted to that of the general himself with perhaps the addition of a parchment map to draw orders on.

(2) Complex orders are relayed and obeyed at light-speed.

Historically, battles were often badly commanded. Lack of co-ordination, organisation and out right disobediance effected most battles. Plans had to be kept simple, and new orders took signaificant time to be relayed and implemented.

AgentBif
08-18-2003, 20:51
Quote[/b] (Asmodeus @ Aug. 19 2003,02:50)]While we're on the subject of AI improvements I'm surprised there arent more games that use a 'learning' AI.
Adaptive AI would be pretty cool but it's hard to imagine problems where it's even technically feasible to develop such techniques without the pentagon backing up the project... http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif

I suppose in a simpler environment, say Counter Strike, where there is much less variety and far fewer game pieces, adaptive techniques would be essential (assuming you limited the bot to human-like parameters (accuracy, reaction time)). For example, if you keep using certain routes, the AI could track that and tend to look for you in those areas more often and maybe even start chucking nades where it thinks you might be hiding. If you use certain weapons, the AI could choose it's weapons accordingly (you keep sniping it, it starts choosing sniper rifles more often). These problems are very easy to frame and so are a much easier context in which to employ adaptive code.

MTW tactical combat seems much too complex to employ adaptive algorithms given a limited development team. There is some simple decision making that is already in the AI that might be thought of as "adaptive" but I think what you had more in mind was some notion of the AI learning overall battle flow in a neural-net kind of fashion whereby it gets better and better at fighting you as you use the same techniques each time...


BTW, Apocalypse is one of my favorite games of all time, and like MTW it was never finished. They just stopped developing it halfway through and pushed it out the door (though it was reasonably stable, it was only half the game it should have been). However, I do not think it used adaptive techniques. What you are describing is deterministic mission scripting... The missions always followed those patterns of enemy grouping and technology ramping... the AI wasn't learning from you.

Anyway, I'd rather not get into a nostalgic discussion of XCom here. For further XCOM chat, check out this thread:

UFO Aftermath (http://www.totalwar.org/cgi-bin/forum/ikonboard.cgi?act=ST;f=6;t=10187;r=1;&#top)

Let's keep this thread here focused on MTW AI...

NewJeffCT
08-18-2003, 20:58
I would definitely like to see better AI tactics as wel1. First off, in the initial assault if the AI is attacking. They often send a few units of cavalry up first. The cavalry gets whittled down by missile fire and charges into my defending anti-cavalry troops. Inevitably, the AI’s group of 20 royal knights or ghulam bodyguards is whittled down by 3-7 by the time they charge into my 100 chivalric sergeants or Saracen infantry and remaining 15 or so knights/ghulams is soon running off the board with only 3-5 troops left and me having lost less than a dozen of my original 100. And, this does not even take into account if I send a group of Ghazi or feudal men at arms out as a flanker to slam into the side of the attacking cavalry. And, it is even uglier if it is something like hobilars or mamluk cavalry charging into my line. They often rout pretty quickly.

The worst is when they send up one unit of missile horse types to attack. They usually have a weaker defense and are already down 15-20% by the time they get into range. They get off a few volleys and are whittled a bit more before going to the loose formation and routing after another volley or two.

One simple thing I found to improve trade a bit is lowering the build time and expense of ports, shipwrights and the ships themselves. Ports were 2 year builds and 500 florins, while shipwrights were 2 years and 200. I made all 3 year ships half price and a one year build time. All 4 year ships were half price and a 2 year build. So, in my current campaign as the HRE now, I have seen Egyptian ships in the North Sea and English ships all over the Mediterranean. And, when I crusaded out of Prussia to Almohad Spain, I was hoping to swoop into Valencia via ship, but could not advance past the North Sea due to the Almohads having ships there… It is still not perfect, as the English also have about 20 ships sitting off of my province of Flanders and a stray Egyptian baggala was sighted off the coast of Livonia once…

Cheetah
08-18-2003, 21:07
Well, I have found that the AI is pretty bad in ranged duel but pretty good when it comes to a head-on charge. So, if you want a challenging fight from the AI then make one honest head-on charge http://www.totalwar.org/forum/non-cgi/emoticons/biggrin.gif no flanking, no traps, no ranged duel http://www.totalwar.org/forum/non-cgi/emoticons/smile.gif I know it is not a permanent solution, but it gives you more challenge; besides it might even be historicaly more realsitic, at least in case of knight heavy christian armies.

Obex
08-18-2003, 21:21
Quote[/b] (Parmenio @ Aug. 18 2003,14:32)]A number of the things that stuck me about the Total War game:

(1) The 'Point of View' appears to be that of a cameraman in a helicopter.

Realistically your PoV should be restricted to that of the general himself with perhaps the addition of a parchment map to draw orders on.

(2) Complex orders are relayed and obeyed at light-speed.

Historically, battles were often badly commanded. Lack of co-ordination, organisation and out right disobediance effected most battles. Plans had to be kept simple, and new orders took signaificant time to be relayed and implemented.
1. to make up for the general not being able to see everywhere, each sub commander knew the battle plan and reacted independently at times, orders and battle events were relayed, etc. this type of combat would be too hard to implement in a game like this. the pov really shouldnt be changed.

2. while i agree with you here, i have to remember all the time ive screamed at my cavalry "no stop fighting right now and run away. disengage now, damn it"

im surprised that in a thread entitled "The French... They keep running away" that no one has made the obvious cheap shot at the french military. maybe this is a sign of board maturity.

NewJeffCT
08-18-2003, 21:30
Quote[/b] (Obex @ Aug. 18 2003,15:21)][quote=Parmenio,Aug. 18 2003,14:32]

im surprised that in a thread entitled "The French... They keep running away" that no one has made the obvious cheap shot at the french military. maybe this is a sign of board maturity.

true, but we were all thinking it http://www.totalwar.org/forum/non-cgi/emoticons/wink.gif

AgentBif
08-19-2003, 10:31
Quote[/b] (Obex @ Aug. 19 2003,12:21)]im surprised that in a thread entitled "The French... They keep running away" that no one has made the obvious cheap shot at the french military. maybe this is a sign of board maturity.
I'm afraid I must correct you. The subject heading IS the obvious cheap-shot http://www.totalwar.org/forum/non-cgi/emoticons/biggrin.gif

It just so happens that there is an actual story behind it as well...

Crash
08-19-2003, 17:30
Quote[/b] (Cheetah @ Aug. 18 2003,15:07)]Well, I have found that the AI is pretty bad in ranged duel but pretty good when it comes to a head-on charge. So, if you want a challenging fight from the AI then make one honest head-on charge http://www.totalwar.org/forum/non-cgi/emoticons/biggrin.gif no flanking, no traps, no ranged duel http://www.totalwar.org/forum/non-cgi/emoticons/smile.gif I know it is not a permanent solution, but it gives you more challenge; besides it might even be historicaly more realsitic, at least in case of knight heavy christian armies.
Interesting observation, and I agree - the head-on charge might be more realistic in Medieval battles, especially with christian armies. If the army consists of powerful elite christian units, then it is not a bad tactic either. That is one of the reasons that I am playing on Easy level now.

I've tried Normal, Hard, and Expert, and have come to the conclusion that the Easy level is the most realistic. The AI behaves a lot more rationally on the strategic map - less ganging up on the human player that results in suicidal attacks from the AI factions, and fewer rebellions and civil wars for the AI factions. On the battlefield, the AI uses more straightforward tactics, more charging and less flanking, which is not necessarily unrealistic for Medieval battles. But I do have to hold back, and be less agressive in order not overwhelm the AI factions. I restrict myself to attacking rebels, only use agents against AI factions, and concentrate on building up provinces rather than armies. I keep my armies small since they have morale advantages and good generals. In order to maintain the challenge level, I try to make sure that the enemy armies will always be larger than mine to help offset my extra morale.

I find that I can go through long campaign games much faster this way because there are fewer battles, thus I tend to auto-resolve less. Less is more, it seems...

AgentBif
08-19-2003, 18:17
Quote[/b] ]

Quote[/b] (Cheetah @ Aug. 18 2003,15:07)]Well, I have found that the AI is pretty bad in ranged duel but pretty good when it comes to a head-on charge. So, if you want a challenging fight from the AI then make one honest head-on charge http://www.totalwar.org/forum/non-cgi/emoticons/biggrin.gif

Interesting observation, and I agree - the head-on charge might be more realistic in Medieval battles, especially with christian armies.


There are definite documented battles where they parked and used archery before the main clash. And my understanding is that cavalry were typically brought on after the peasantry and MAA engaged... Perhaps at this time is when any flanking might have taken place.

Anyway, another artificial tactic to improve challenge might be to only actively employ 14 or 12 units in battle against the AI's 16. This way you could let loose the full force and variety of your tactical retinue, but the AI will still have an advantage to help it out. Just hold back the extra 2 or 4 squads as a local reserve until you need to start removing depleated squads from the field.


Quote[/b] ]
I've tried Normal, Hard, and Expert, and have come to the conclusion that the Easy level is the most realistic.


Hmm, interesting. Unfortunate too. I'd hate to give up to playing an easier difficulty level just to solve the rebellions problem. My understanding is that WesMod tends to fix the strat AI problems fairly well... It is able to set up good trade routes, build higher quality armies, and I think the mod cuts down on the mass economic collapse problem. (Can anyone confirm this last thing?)

I'm going to be trying WesMod in my next campaign. He was very cool about doing a version that doesn't tweak any of the units, it just fixes many of the strategic problems in the game making the AI more capable.