Jump to content

AI plans and a more responsive AI


Recommended Posts

I've been doing a lot of playing around with the AI recently, and I thought I'd bore you all, and insult the developers, by describing what aspects of the AI I think work well, and what could be done to improve it.

A: Static defence

Firstly, in certain respects, the AI works extremely well.

For example, the simplest way to set up an AI plan in an attack/defend QB situation (Probe, Attack or Assault), which is the type of game I play the most (and therefore the type I am most interested in learning how to produce), is to set up several AI groups, and for each one paint the entire defender setup zone (or a big part of it), and then select a different behaviour for each group...

For example:
- group 1, ambush 1000m;
- group 2, ambush 300m
- group 3, cautious
- group 4, normal ...and so on

In an attack-defend scenario, this will give you a very good static defence, and with a suitable map, will give you a fun and challenging Quick Battle. The AI will allocate the groups very intelligently and will create an integrated network of defensive positions, there may be interlocked fields of fire, AT guns will be well sited, avenues of approach will be covered, and it may place units as bait. It seems to have an excellent 'understanding' of the relationship between terrain, objectives and setup zones.

It's incredibly easy for the map designer and works very well. As a map designer, it will also surprise you. Since all you're doing is painting big swathes of the map and inputting the full range of behaviours, you can happily play QBs on your own maps without any foreknowledge of what the AI is likely to do. Marvellous.

For years I avoided using the AI, because I thought the map designer had to think out all the strategies and (a) I wasn't confident in my strategic skills, and (b), what point would there have been when I wouldn't be able to enjoy the maps myself, knowing in advance what was going to happen?

But I was quite mistaken about just how sophisticated the AI is, and how easy it is to use.

If you do something as simple as this:

AI%20plans.jpg?dl=1

...you'll get a really good defence from the AI, but it will be a static defence.

 

B: Responsiveness

Planning an active defence, with displacement or counterattacks, or a realistic attack, is far harder. With QB maps, I've seldom seen either one work well. Occasionally they're quite fun and somewhat challenging, but most of the time - with QBs at least - an attack plan or active defence is a turkey shoot.

The reason for this, and the area where I would like to see improvements is in the AI response, or lack of response, to the actions of its opponent.

I have read comments over the years that programming a truly responsive AI is a Holy Grail that is more or less impossible, but (and this is the point at which I insult the developers), I wonder perhaps if that is true.

I can see the reason why it is so hard...

Imagine a map of 2000m2 - that's 62,500 action squares (250 x 250).

action%20squares.jpg?dl=1

To calculate, at the level of the action square, what was happening on such a map (lines of sight, lines of fires, enemy presence and so on) would involve around 62,0002 or nearly 4 billion combinations of action squares - once a minute or more often.

But if the AI were to react in a more general way - say perhaps it 'observed' enemy movement on the level of 5 x 5 action squares...

action%20acres.jpg?dl=1

A 2000 m2 map would comprise of 2,500 such 'AI action acres', which would mean around 6 million combinations to calculate approximate LOS and LOF.

Given that the AI does such a fabulous job on static defence with the under-the-hood algorithms it has, if the AI were just to react in a general way to the presence of enemy troops on an 'action acre', in a similar fashion to the way it incorporates objective zones and terrain in a static defence (seeking to mass fire on the enemy for units designated 'active', or backing away from massed enemy for troops designated 'cautious, perhaps), you would get a fantastic responsive AI.

The AI already has the capability to produce interlocking fire, keyholes and so on, but it would then be orienting these towards the player's units. Major movements would still be provided as an AI plan by the designer, but the AI would no longer be operating blindly or by clockwork.

In fact, seeing how well the AI produces an integrated static defence with the simplest of designer plans, it only needs to respond fairly generally to the presence of enemy units - anything more would be too much. If the AI were to continuously respond to enemy movements down to the level of the action square with the sophistication it uses to produce static defence, the game would become too difficult to play.

 

Edited by Freyberg
Link to comment
Share on other sites

59 minutes ago, Freyberg said:

set up several AI groups, and for each one paint the entire defender setup zone (or a big part of it), and then select a different behavior for each group...

For example:
- group 1, ambush 1000m;
- group 2, ambush 300m
- group 3, cautious
- group 4, normal ...and so on

+1.  Interesting stuff, especially the above.  Very simple but can be very effective for the amount of work invested by the the scenario designer. Some critical assets like AT guns I might still place myself but in general the above works.  Also the AI (and with only one AI plan) will setup AI units in different areas on different play throughs adding to the replay value.  

Link to comment
Share on other sites

Totally agree that the tactical AI is often sold short. A lot comes from the sort of vague feedback the AI gives scenario designers about its intent on plan execution which can lead to wildly unintended outcomes. On the other hand a lot of people expect an enormous amount of granularity in plan execution on the AI's part which is mostly unnecessary. "Force A moves to point B and shoots whatever it sees" is seriously 90% of Combat Mission and the AI just so happens to be able to execute movement and fire plans...so what more do you need? Certainly some stuff like the AI re-engaging historic contacts would be nice and a way to see AI movement paths in the scenario editor would be a great time saver for testing plans. Overall the biggest problem with the AI is the enormous amount of work involved in making plans for it because of the User-Interface feedback issues mentioned. This leads scenario designers naturally down the path of making simplistic and repetitive AI plans which then leads players to believe "the AI is bad" when it isn't really.

A lot of what Freyburg is saying here is really important for scenario designers. In order to fully wield the AI you have to use multiple plans, and think very abstractly about what the AI can do to upset the player's movements and pose a challenge. For instance in literally every scenario i've designed for myself... i've always set up at least one attack plan for the AI that is very, almost recklessly aggressive. The likelihood of this plan's execution is dependent upon many factors (I increase the likelihood if the AI is Waffen SS for instance) but I always feature it because if the player never has to expect spoiling attacks of any kind, he's not really under any pressure except for that given by the scenario's time limits. Time limits are a good way to make scenarios tense but you don't want to become over-reliant upon the scenario timer either because it can unfairly handicap the player by restricting his movements to only sections of the map his force can realistically reach in the time allotted. Easy solution? The potential, not the guarantee, the potential of an active defense instead of a passive one regardless of how illogical or irrational it may seem. 

The other basic item is randomized deployment rights for the AI when it's both attacking or defending. You can abstract the quantity of the AI's deployment "rights" by considering (or featuring on map even) your own side's reconnaissance quality vs the enemy's. You shouldn't be too perturbed by sort of baffling or seemingly illogical deployments either because tbh a lot of that is a perspective thing and scenario designers often make their scenarios less interesting by trying to police the AI down to every individual square it can use on deployment because "that's not what I would do this is what I would do if I was running this show!" - The confusion here extends from an unclear objective on the scenario designer's part leading to an imbalance in the pursuit of challenge and intrigue. You should consider both of those things when making a scenario.

A company of Panzer Grenadiers deploying in the middle of a forest hex around zero objectives doesn't make much sense no but that's only if the scenario designer is thinking about that in terms of a linear script. What if you open enough of the map up the player could potentially maneuver through that forest? What if they don't deploy there every time? What if you substitute a minefield instead sometimes? Every square on your map needs the potential for context. It doesn't necessarily need to be held or be dead, it just needs to be potentially something. 

Crucially when the AI is attacking its own fire support is going to be the biggest source of the scenario's ability to generate random outcomes. Lots of the scenario designers seem to avoid use of the AI fire support plans though, or make them too restrictive by using only one plan. One thing I always do with AI fire plans is include a heavy "rear area" bombardment to discourage the player from just pooling his force is a small area near the objectives. Remember that artillery was the solution to heavy force density and if the player can reliably concentrate his forces on areas of the map he expects to be safe the AI attacker's job will be predictably harder every time. I redesigned Hot Mustard in CMFI with a squadron of FW-190s in ground support and split their "missions" between attacks on my frontline or bomb runs on the train station the American commander is using as his HQ. If this squadron had existed at the battle it would've been perfectly reasonable to expect them to bomb and strafe the train station as a suspected HQ even if their mission had called for direct support of the German's attack. Usually they will not do this, but it could happen. So maybe pooling your whole Battalion for a dense and interlocking defense at the train station would not be the path to victory or an optimal defense every time hmm? What if there's a plan for a cancelled attack? Seriously what if you just put a plan in there where the AI executes a completely different set of objectives from what the player sees wherein just capturing the front half of the map was "good enough" for them in an "own objective" sort of way? 

It's important not to cripple the player I think, and give them enough assets to face setbacks and still reasonably be able to affect the scenario's outcome. Most of the scenario designers are thinking too much in terms of scripting though, and this makes their AI plans very limited or simplistic. Defense is easy enough, and randomized deployment is very basic. You've really made it though when you can construct compelling offense from the AI that doesn't rely excessively on any single constraint upon the player. 

Edited by SimpleSimon
Link to comment
Share on other sites

That static defence custom QB-trick sounds like a nice idea 🙂...

But as for giving the AI greater freedom to act on its own...i'm  not so sure.

If BFC could make it work...yeah that would be great but i fear that features such as you describe might be a bit more complicated...

Simply having LOS/LOF to an action square might not help the AI enough...what kind of enemy unit is comming ? where are the other enemies/friendlies ? What are they doing ? Where should the AI units regroup to ? Why  ?

There are a lot of things the AI will need to considder...not only for each induvidual unit but also as a force as a whole.

I doubt it would be able to do it...

I would prefer that BFC moved in the opposit direction and gave the scenariodesigner MORE tools to 'help' the AI...providing for better scripting...

- more AI groups 

- more trigger options like AI group casualty level higher then, unit killed (friendly or enemy), unit spotted,  AI group ammo level below...etc,etc

- more options for when reinforcements arrive.

- more objective options

- a new AI artillery programing interface that would allow the designer to specify indirect firesupport for the AI mid game among other things.

 

 

Link to comment
Share on other sites

37 minutes ago, RepsolCBR said:

- more AI groups 

- more trigger options like AI group casualty level higher then, unit killed (friendly or enemy), unit spotted,  AI group ammo level below...etc,etc

- more options for when reinforcements arrive.

- more objective options

- a new AI artillery programing interface that would allow the designer to specify indirect firesupport for the AI mid game among other things.

All great suggestions, lots in common.

I'd add a few things that occur to me from time to time in the Editor, off the top of my head.

-A toggle to an AI Group to set it for "foot" or "wheel/track". That would only allow binary selection of movement types, so you don't have plans with guys hauling it 4k to the end order.

-See all AI orders at once in the AI Plan UI, on map (color coded by Group, even better). I have a Photoshop tool I use for this that I'll release after the RT module is out, but this would be better.

-Conditional Triggers for presence/time. "If no enemy is present in area 'X', then move/don't move". Group casualty would be another big one, already mentioned above. Omniscient, but incredibly useful for making the AI react in ways that seem human. The AI can't counterattack if it doesn't know it needs to!

-LoS Triggers. Units must be in LoS for Trigger to operate, with the standard Trigger operations offered. Solves any AI omniscient powers, but much harder to program. Mixing LoS Triggers with standard ones could create interesting results. A unit that has LoS to fellow units that have taken heavy casualties could have a Trigger to do a given action, while a larger narrative thing is happening with the other Triggers.

-A "Hold in place for 'X' amount of time" order for the AI. No more counting from the start/end times! Things like Area Fire would be available, and easier to plan for. A "when you are in this location, hang around for 'X' amount of time, and hammer that building with for the duration". rather than the current "Maybe there will be some time for that, but we gotta head for the next location, buddy! No time for fighting!".

-A method to deal with vehicle transports, in particular remounts.

-Ability for the AI to "Move", rather than run everywhere. In fact, the full set of movement abilities would be ideal.

-Ability to save multiple hand-placed AI set-ups.

-Ability to view AI plans in 3D view/ Scenario Editor mode.

 

Edited by benpark
Link to comment
Share on other sites

With regard to multiple AI plans...

Imo it kind of depends if the goal with the scenario is to be used simply by one self or if it is to be uploaded and made avaliable to the community...

If the goal is for personal use only then a higher number of AI plans would be preferable to maintain some sort of FOW...

But if the scenario is to be shared i actually prefer fewer...well designed ! AI plans to a high number of them...

I rarely play a scenario more then twice...having fewer, better AI plans would be preferable 😎

Even if you have multiple AI plans some of the FOW will be ruined anyways...the unit roster will be the same !

If a scenario has 4 Panther tanks and 2 AT-guns...thats what it has...in every playthrough...

You will know it after having played it the first time...

If the scenariodesigner would like to add some uncertanty into the head of the player...he could use the briefing..🙂

För example mentorn things like...

"Based on previous days fighting we can not rule anything out...despite being heavely outnumberd and low on ammo...don't be supprised to see the enemy counterattacking...

Even in suicidal fashion ! The enemy is very unpredictable..."

Mentioning the unit roster...got me thinking...

To increase the FOW and make multiple AI plans somewhat more interesting..wouldn't it be a good idea to have the option to include multiple unit rosters in a single scenario...?

This way the unit FOW of the AI would not be ruined after the first playthrough...

Maybe not completally different unit rosters offcourse but change a few details...

Kind of in the example above....instead of having 4 Panthers and 2 AT  Guns...one AI plans might have 2 Panters, a StuG and 2 AT-guns 😁

 

Edited by RepsolCBR
Link to comment
Share on other sites

Quote

Crucially when the AI is attacking its own fire support is going to be the biggest source of the scenario's ability to generate random outcomes

I've been making heavier use lately of  the painted-on AI 'fire' orders for AI unit movement paths. Its the only way to get the AI to blast specific building X or tree line Y for two minutes at 24 minutes into gameplay. You can get inf, tanks and hmgs to open fire on what you want (but not off-map artillery). An on-map mortar, for example, can be given a 'movement' order with no painted destination but with just a painted 'fire' order, and it can be linked to a tripped trigger. That means when the trigger gets tripped the on-map mortar will start dropping rounds where you instructed, with no need for FO or LOS.

Link to comment
Share on other sites

34 minutes ago, RepsolCBR said:

I rarely play a scenario more then twice...having fewer, better AI plans would be preferable 😎

This is wisdom IMHO.

30 minutes ago, MikeyD said:

I've been making heavier use lately of  the painted-on AI 'fire' orders for AI unit movement paths.

You can use it for 'special effects' & 'covert' purposes too, @MOS:96B2P did it in 'TOC' and I've used it in a couple of scenarios recently too, to attract the player's attention and possibly reveal the presence of a few enemy units (which never hurts given the spiteful sort of scenarios I make).

I often use pre-planned artillery or 'other explosions' for purposes that are not immediately obvious (or I hope they aren't).  :ph34r:

In the modern titles (especially CM:A) you can 'set a certain tone' to a single-player scenario, by assigning a helicopter gunship to a pre-planed target area that the player cannot possibly reach within its duration (TBH it's best not to have any units in the area if it's a Red helicopter that you are using).....When the scenario starts, the helicopter will fly a couple of passes, not find anything and leave.  But the player will have due warning.....'Hinds Hunt Here!'. 

Edited by Sgt.Squarehead
Link to comment
Share on other sites

35 minutes ago, RepsolCBR said:

To increase the FOW and make multiple AI plans somewhat more interesting..wouldn't it be a good idea to have the option to include multiple unit rosters in a single scenario...?

This way the unit FOW of the AI would not be ruined after the first playthrough...

Maybe not completally different unit rosters offcourse but change a few details...

You can kind of do this already, if you are barmy enough.....Simply place all the units that you might want to use on the map, assign them their AI groups, and have the ones you don't use in a given AI plan enter an 'Exit Zone' on their first orders.

Edited by Sgt.Squarehead
Link to comment
Share on other sites

Does claiming you play a scenario only twice include the number of times you quit 3 minutes into the scenario because you lost too many troops up front? ;):D

It seems players will most often chose the attacking side when paying against the AI. As a result they only see the AI at its most basic. You need to play defender to watch the attacking AI trying hard to achieve the objective. Its the attacker that get's the intricate precisely timed AI orders for the smallest units. The defender might get a retreat or attack order on a tripped trigger. I had joked on the Beta board that its a shame we put the most effort into the stuff that the player is least likely to see.

Map size is the enemy of making coherent AI orders. The bigger the map the more variables there are, and the lower the AI designer's ability to anticipate what the player is going to do. If you want the opposing AI to act logically you're going to have to accept some restriction. I wouldn't begin to know how to make logical AI plans for a 4km map.

Link to comment
Share on other sites

7 minutes ago, MikeyD said:

Map size is the enemy of making coherent AI orders. The bigger the map the more variables there are, and the lower the AI designer's ability to anticipate what the player is going to do. If you want the opposing AI to act logically you're going to have to accept some restriction. I wouldn't begin to know how to make logical AI plans for a 4km map.

To be fair this can be mitigated by going for the 'low-density' option discussed elsewhere.....Controlling a battalion on a map that size could become the stuff of nightmares, but a couple of mobile platoons (using exits & snowballing over the longer durations typical for these scenarios, so as to get the most bang for your AI slots), plus a few static defending units, is a lot easier and much more doable (it's still a s**tload of work, but it's doable).

Edited by Sgt.Squarehead
Link to comment
Share on other sites

20 minutes ago, Sgt.Squarehead said:

You can kind of do this already, if you are barmy enough.....Simply place all the units that you might want to use on the map, assign them their AI groups, and have the ones you don't use in a given AI plan enter an 'Exit Zone' on their first orders.

Ahh...these little 'tricks' saves us 😁

Thanks for the tip  !

 

Link to comment
Share on other sites

16 minutes ago, MikeyD said:

Does claiming you play a scenario only twice include the number of times you quit 3 minutes into the scenario because you lost too many troops up front? ;):D 

Uuuummhpf, uuuurf...maybe not 😉

But i acctually do not restart all that often...but it do happen...i have to confess  😊...

 

Link to comment
Share on other sites

31 minutes ago, MikeyD said:

 

Map size is the enemy of making coherent AI orders. The bigger the map the more variables there are, and the lower the AI designer's ability to anticipate what the player is going to do. If you want the opposing AI to act logically you're going to have to accept some restriction. I wouldn't begin to know how to make logical AI plans for a 4km map.

Yepp...

On smaller maps the AI can contribute in the battle atleast to some degree even if they are not...in the right place, at the right time.

On huge maps...not so much

Link to comment
Share on other sites

2 hours ago, MikeyD said:

It seems players will most often chose the attacking side when paying against the AI. As a result they only see the AI at its most basic. You need to play defender to watch the attacking AI trying hard to achieve the objective. Its the attacker that get's the intricate precisely timed AI orders for the smallest units. The defender might get a retreat or attack order on a tripped trigger. I had joked on the Beta board that its a shame we put the most effort into the stuff that the player is least likely to see.

One issue players seem to bring up a lot is that the AI seems to be prepared to conduct excessively bloody attacks to the last man. Like the AI doesn't conduct any kind of active threat assessment. Actually it does, but again here designers don't seem to be thinking about context and/or using the tools available to their fullest. 

If you tell the AI to advance through a sector and use modifiers on the designated units like "fanatic" and "elite" then yeah you're going to get an attack that seems pretty pushy. Fanatically so in the sort of Light-Brigade sense. I've gotten pretty used to designing my own scenarios low balling troop skill and motivation way more than I think most guys are used to and that tends to produce far better results than making everyone crack Airborne/Shock Troops. The AI doesn't make high level decisions like the player does...but high-level thinking isn't always necessary either. Remember we as the player are omniscient gods presiding over the battlefield with our instant and precise awareness of encounters and our assurance that the only enemies we will ever encounter will be in the highly predictable slice of map we are fighting on. (Just one of the issues with games using play areas of hard-definition. EG: Map borders clearly defining where the player does not need to expect enemies to attack him from.) 

You can delegate basic self-preservation to troops easily enough by just setting their motivation and morale values much lower. I experimented with this on a modification of the Troina campaign in Fortress Italy. I set the morale and motivation modifiers of a platoon of German troops so low that my opening bombardment on a sector of map nowhere near them caused them break and flee back to the Battalion leader's HQ elsewhere on the map. This is not very precise threat assessment, but it's an example none the less.

Most guys would prefer awry attacks were simply cancelled I think, but given the scale available to the AI through its morale/motivation selectors I don't see how the leader AI couldn't be expected to self assess that well enough. Again here scenario designers need to be fair and remember that real life commanders were often afflicted by confusion themselves and could be unaware of just how badly their attack had failed, even from within that very attack, until very late. 

Edit: Also Squarehead's point that more maps need to feature mixtures of static and mobilized troops is a good point too. I designed one scenario with a pair of companies attacking from the edge of a forest one time. Company A was dug-in at the forest edge and Company B advanced from behind them toward a phase-line. Crucially I allowed both Companies to use the same deploy area, leaving the decision to deploy both Companies in line or both in attack up to the player. I used the entrenchments to suggest that at least one of the Companies be used as a base of fire, and in the briefing I allude to their positioning being necessary due to resistance from the opposing forest. Since the defense plan could include a counter attack, or perhaps nothing more than snipers there's context here for making use of defense while conducting what is, overall, an attack. 

Edited by SimpleSimon
Link to comment
Share on other sites

 

Unless I am mistaken the AI makes no threat assessment. Individual units will make reactive assessments to pressure placed on them but they are always reactive. Never forward looking.

E.G. A player may decide that their chosen avenue of attack is too costly after seeing a Platoon vaporized by fire and reroute or bring in more support before sending anyone else to die. Whereas the AI will never realize that. They will just keep feeding men into the machine. Those individuals squads and sections will realize that they are in a high threat situation but only after leaping into the fire. Regardless of their morale ratings they're all in the same pickle. Playing modern exacerbates this issue as its far rarer to get second chances. The lessons learned when Javelins are raining down must be learned by adjacent units. As the unit engaged by the Javelin no longer exists.

At least that is my fundamental issue with the AI on the attack. That they have a difficult time adapting to a threat unless you provide them with overbearing numbers or firepower. Because they essentially have no understanding of economy of force. yes the 2 surviving crewmen will skedaddle back to safety but 2nd platoon is on deck and ready to die.

Link to comment
Share on other sites

When doing an attacker AI need you need to design-in logical tactics. Supporting fire, suppression of likely hot points, use of defilade, shifting position to avoid potential mortaring, etc. If you just tell 'em to 'assault' across an open field the AI will fail as assuredly as a human player doing the same thing would fail. Just now I was playing through the Beta of a CMRT module scenario, watching the Russian AI enter a town and capture a defended POW camp. That plan requires a LOT of moving parts. you can't just tell the AI 'BE SUCCESSFUL!'

Link to comment
Share on other sites

Obviously you can;t tell the ai to be successful because there is no AI to speak of. I think we all know that. The CM decision of only having bespoke designer intent is quite good when the designer is both skilled and lucky enough. It can create some truly fantastic scenarios, however, it can also be significantly worse and the QBs suffer the most.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...