Jump to content

AI script: emulating a fighting withdrawal


Recommended Posts

Hi,

I'm wondering about the best way to emulate a fighting withdrawal: the defender unit ambushes the attacker ("ambush X meter" command is perfect for that), then withdraws to the next fighting position. The problem is to correctly trigger the withdrawal. I only xan think of a "terrain objective" trigger condition, but I don't think it will work correctly; say the defender is set at "Ambush 100m":

- if the trigger location is set 100 meter away from the defender or more, the defender will retreat before engaging the enemy.

- if the trigger location is set at less than 100 meter away from the defender, the defender will stay engaged until the attacker closes in, with a high risk of getting pinned or destroyed before the trigger is set off.

Timer is no option, as there is no way to anticipate the time the enemy will enter the 100 meter ambush range. If only time was relative… but it is not.

Any idea around?

Link to comment
Share on other sites

AI aside, you definitely don't want to be trying to do a fighting withdrawal at 100m, that's not really possible for anyone.

You really want to be looking at your engagement ranges - for the sake of giving actual numbers, we can take the US in the Cold War, either emulating Active Defence, or a more generic cavalry screen.

In this case, the engagement range really starts at about 2km, and 1km is the threshold for starting to pack up. These ranges are doctrinal, but they're from the range of the AT weapons - 2km will be TOW and 1km is the range of Dragon. This means you need to site them somewhere (possibly using TRPs) where they can engage at 2km with TOW and cannon, then to draw a terrain objective trigger in a 1km radius around the unit. The actual order you'll want to give is anything below Dash - you want them fleeing in sections, rather than all at once - but precisely what order makes the most sense depends on the circumstance.

Now, an actual "wait until they're in 100m, wait until they're all killed, then withdraw" isn't really possible with the CM AI triggers. You're best leaving them in-situ in that case (and you're likely to be combat ineffective after a 100m engagement in any case), or using a time trigger if not.

Link to comment
Share on other sites

45 minutes ago, domfluff said:

AI aside, you definitely don't want to be trying to do a fighting withdrawal at 100m, that's not really possible for anyone.

You really want to be looking at your engagement ranges - for the sake of giving actual numbers, we can take the US in the Cold War, either emulating Active Defence, or a more generic cavalry screen.

In this case, the engagement range really starts at about 2km, and 1km is the threshold for starting to pack up. These ranges are doctrinal, but they're from the range of the AT weapons - 2km will be TOW and 1km is the range of Dragon. This means you need to site them somewhere (possibly using TRPs) where they can engage at 2km with TOW and cannon, then to draw a terrain objective trigger in a 1km radius around the unit. The actual order you'll want to give is anything below Dash - you want them fleeing in sections, rather than all at once - but precisely what order makes the most sense depends on the circumstance.

Now, an actual "wait until they're in 100m, wait until they're all killed, then withdraw" isn't really possible with the CM AI triggers. You're best leaving them in-situ in that case (and you're likely to be combat ineffective after a 100m engagement in any case), or using a time trigger if not.

Of course I agree, the 100 m value was just an example to illustrate the dilemna. Even though in my particular case, a CMBN small units, infantry only mission in bocage country, the terrain favours ambushes and close range fights, so 100 m in that specific case is not irrelevant.

Anyway, you confirm what I basically thought: whatever the range, it's impossible to program an effective AI fighting withdrawal with the available triggers. Thank you.

Link to comment
Share on other sites

I mean, it's certainly possible, just not at 100m, or where you want to trigger a move after a close-ranged ambush has been completed.

That's a very different thing from a fighting withdrawal, and that's outlined as above (setting up a 2km killsack and a 1km withdrawal line, in the example of the US in CMCW).

The AI will even help you with this - the withdraw order pops smoke for you and other things, to better represent breaking contact. If you wanted to get particularly exciting, you could trigger on-map mortars to do final protective fires as well.

Link to comment
Share on other sites

I would-

-Place defensive positions in sensible terrain, with a retreat position situated behind, with some cover between the two positions. The fall-back position should have a few HMGs and mortars set up, if this is an existing position and not hastily put together.

-Split your forces into two basic forces: "Cover, then Retreat" (AI 1) and "Retreat First" (AI 2). Both are in the initial defensive position. These forces have Ambush to a set distance, dictated by the terrain, and the following factor...

-Place a Trigger at the distance (generally a line the length of the map to punish edge dodgers) at which things will be impossible to retreat out of if the enemy is getting the upper hand. Your defensive fire should kick in at around double this for the AI to have any chance of retreat.

-Connect your Trigger to AI 2, and make an order to move (I generally use Assault) to the fall-back positions. Use a Withdraw Facing (it's used by holding down CNTL or ALT, I forget - but it should be pink) with the end-point of this order. The Assault will have the AI group use bounding movement. To simulate a break-down of cohesion, you could have them all tumble out of their positions at Fast or Quick. Less chance of survival that way. The Withdraw order will allow the use of smoke in the direction placed, and will also dictate that the retreated units will face the enemy on arrival.

The remaining force can be ordered to do the same with a closer trigger to the defensive lines. Or they could both be placed further out.

Fine tuning is done in Scenario Author Mode, Turn-Based. Just blast through, and watch for issues. Tweak. repeat, until the result is looking good.

Edited by benpark
Link to comment
Share on other sites

1 hour ago, PEB14 said:

you confirm what I basically thought: whatever the range, it's impossible to program an effective AI fighting withdrawal with the available triggers. Thank you.

Well...This might not neccesarely be the the case 😎 Offcouse that might depend on what you considder to be a fighting withdrawl. If by fighting withdrawl you simply intend to have the ambushing units break contact after a short while of shooting and use a covered route to withdraw...It is certainly doable.

Atleast if you have one additional AI group to spare.

- Ambushing AI group is group 1.

- 'timer' AI group is group 2.

For AI group 1...

1. set up a terrain trigger (trigger 1) with - trigger enemy - or trigger - enemy armour - as desired to cover the ambush location.

2. give group 1 a hide AI order with a wait for trigger 1 option.

3. Set the next AI order to MAX ASSULT with no zone painted and change if to CAN TRIGGER to allow for the use of the AI-order trigger for this order.

 

For AI group 2 (the 'timer' ai group)

1. At set-up place this unit one the map at a location far back that is out of sight from any possible player observation. Preferably use some small team like a sniper or something.

2 Create a second terrain objective with a - trigger friendly - that is close to the set-up location of this ai group and still out of sight of any possible player unit.

2. Give AI group 2 an additional order to have it to move to the location of the new terrain objective and make sure to add a WAIT FOR...THE AI ORDER TRIGGER you created in step 3 above. The one where the ambushing AI group changes to MAX ASSULT. This will have the second AI group start its move as soon as AI group 1 begins its ambush.

You can adjust the speed of movement and the  distance between the seconds AI groups starting location and the second terrain trigger to achive the desired amount of time needed to reach the second terrain objective. This time will be the actual  lenth of the ambush.

Now go back to the ambushing AI group and add an additinal order and have it move out in any way desired and make sure to add a WAIT FOR....terrain trigger 2.

 

This way you can have your ambushing units hide until the player moves into your desired ambush location and after that the will fight in place for your desired lenth of time before withdrawing into cover.

It might now be a perfect solution...but it works. It costs you one additional AI group and one additional terrain trigger though.

 

EDIT...!!!!!

The WAIT FOR....TERRAIN TRIGGER 2 should be added to The AI group 1 order that has it change to MAX ASSULT....NOT the lats one...the withdrawing one...😎

 

 

 

 

 

 

 

 

 

Edited by CarlXII
Link to comment
Share on other sites

Thank you gentlemen for these advices.

2 hours ago, domfluff said:

I mean, it's certainly possible, just not at 100m, or where you want to trigger a move after a close-ranged ambush has been completed.

That's a very different thing from a fighting withdrawal, and that's outlined as above (setting up a 2km killsack and a 1km withdrawal line, in the example of the US in CMCW).

I agree, what I try to do is more in the line of a move after a close-ranged ambush fighting than a fighting withdrawal.

 

2 hours ago, benpark said:

-Place a Trigger at the distance (generally a line the length of the map to punish edge dodgers) at which things will be impossible to retreat out of if the enemy is getting the upper hand. Your defensive fire should kick in at around double this for the AI to have any chance of retreat.

I may not understand correctly, but you seem to suggest that I might be able to fire at double the distance at which I plan to retreat, e.g. if defensive fire (ambush) is set at 300 meters I should put the trigger line at around 150 meters. While it sounds perfectly sound, it's not compatible with the bocage close terrain of my map where distance engagement are really too small.

 

1 hour ago, CarlXII said:

For AI group 2 (the 'timer' ai group)

1. At set-up place this unit one the map at a location far back that is out of sight from any possible player observation. Preferably use some small team like a sniper or something.

2 Create a second terrain objective with a - trigger friendly - that is close to the set-up location of this ai group and still out of sight of any possible player unit.

2. Give AI group 2 an additional order to have it to move to the location of the new terrain objective and make sure to add a WAIT FOR...THE AI ORDER TRIGGER you created in step 3 above. The one where the ambushing AI group changes to MAX ASSULT. This will have the second AI group start its move as soon as AI group 1 begins its ambush.

You can adjust the speed of movement and the  distance between the seconds AI groups starting location and the second terrain trigger to achive the desired amount of time needed to reach the second terrain objective. This time will be the actual  lenth of the ambush.

Now go back to the ambushing AI group and add an additinal order and have it move out in any way desired and make sure to add a WAIT FOR....terrain trigger 2.

Wait… I can't believe that… Basically, you're creating a timer that can be triggered when I want, and which time length is given by the distance covered by the "timing" unit?!! That's incredibly clever !!!!!!!!! I never would have been able to find this trick on my own! 👍👍👍😍

 

Link to comment
Share on other sites

29 minutes ago, PEB14 said:

Wait… I can't believe that… Basically, you're creating a timer that can be triggered when I want, and which time length is given by the distance covered by the "timing" unit?!! That's incredibly clever !!!!!!!!! I never would have been able to find this trick on my own! 👍👍👍😍

I can't claim the titel of inventor of this trick 😎...I belive it is sort of a joint effort developed over time by several scenario designers...I have used it several times and i know many others have to....An yes...it is a TIMER...usuable for many different situations.

And remember...The timing unit does not have to move in a straight line...What i tend to use is if it is suitable given the scenario is this...

Use 3 one tile modular buildings and place them next to eachother. Connect them by adding internal doors to the adjoining walls inside this 3 tile building. keep in mind that you will need simular doors on both sides of a wall to allow movement between the buildings (rooms).  Remove any extarnal doors and windows.  This will pretty much ensure the the 'timing unit' will not be spotted and will not open fire on any potential player units. Place the terrain trigger over one of the three bulding tiles and place the 'timing unit' in one of the two remaining building tiles without the terrain trigger.

Now you can give this AI group order after order ones it has been triggered to  move between the two rooms that does not contain the trigger zone and ones you feel that they have been doing this for an suitable amount of time give them an order to move into the third room...containing the terrain trigger. 

This will start the withdrawl of the ambushing units for example.

Using this 3 tile building setup you can keep this timing feature fairly discrete i have found...Nothing that looks wierd on the map.

 

 

Link to comment
Share on other sites

1 hour ago, CarlXII said:

Place the terrain trigger over one of the three bulding tiles and place the 'timing unit' in one of the two remaining building tiles without the terrain trigger.

Now you can give this AI group order after order ones it has been triggered to  move between the two rooms that does not contain the trigger zone and ones you feel that they have been doing this for an suitable amount of time give them an order to move into the third room...containing the terrain trigger. 

Lots of interesting stuff can be done with AI plans.  I think I almost like working in the editor and experimenting with AI plans more than I like playing the actual game. :D

Another way to accomplish this same timing event would be to use an orders trigger instead of a terrain trigger. But not a big deal unless you are short of terrain objectives/triggers. So instead of a terrain trigger in the third building the ambushing unit would respond to an orders trigger. After the timing unit (AI 2) in the building started moving it would eventually reach order #30 (or whatever is appropriate). Then the ambushing unit would be triggered by order's trigger A2 Order 30.   

Link to comment
Share on other sites

1 hour ago, MOS:96B2P said:

Lots of interesting stuff can be done with AI plans.  I think I almost like working in the editor and experimenting with AI plans more than I like playing the actual game. :D

 

It can be a fun challange for sure...😎 Where i find AI programing to be less enjoyable though is to playtest and tweak AI plans for somewhat longer scenarios...having to play through the whole thing over and over to get to the part you want to test and tweak can be quite tiresome at times.

1 hour ago, MOS:96B2P said:

Another way to accomplish this same timing event would be to use an orders trigger instead of a terrain trigger. 

You are absolutelly right...I belive that would be a better option in most situations. Thanks !

 

Link to comment
Share on other sites

7 hours ago, CarlXII said:

It can be a fun challange for sure...😎 Where i find AI programing to be less enjoyable though is to playtest and tweak AI plans for somewhat longer scenarios...having to play through the whole thing over and over to get to the part you want to test and tweak can be quite tiresome at times.

Developpers definitively need more tools, both to build maps and to playtest faster.

Link to comment
Share on other sites

4 hours ago, PEB14 said:

Developpers definitively need more tools, both to build maps and to playtest faster.

Yepp...It's kind of sad that the productivity when it comes to Battlefront have been very low for a number of years now. 

The suggestion/request list on this forum when it comes to the editor is quite extensive and we have seen pretty much nothing being done in recent years to improve the editor.

Hopefully the reason for this is that the guys are working hard on developing CM3 and that we will soon see some signs of that. 😊

 

 

Link to comment
Share on other sites

23 hours ago, PEB14 said:

Hi,

I'm wondering about the best way to emulate a fighting withdrawal: the defender unit ambushes the attacker ("ambush X meter" command is perfect for that), then withdraws to the next fighting position. The problem is to correctly trigger the withdrawal. I only xan think of a "terrain objective" trigger condition, but I don't think it will work correctly; say the defender is set at "Ambush 100m":

- if the trigger location is set 100 meter away from the defender or more, the defender will retreat before engaging the enemy.

- if the trigger location is set at less than 100 meter away from the defender, the defender will stay engaged until the attacker closes in, with a high risk of getting pinned or destroyed before the trigger is set off.

Timer is no option, as there is no way to anticipate the time the enemy will enter the 100 meter ambush range. If only time was relative… but it is not.

Any idea around?

I actually did a scenario like this. It's small-scale WW2 infantry combat and the German defenders have been programmed to do a fighting withdrawal with close-range ambushes.

If I remember right, I did the scenario just before the proper withdraw command became available in the editor, so you won't see the Germans popping smoke, but they are set up to try to prevent getting flanked.

Try it out and see if you like it, then afterwards, you can pick apart the AI plans to see if it can maybe inspire you.

CMBN and Commonwealth expansion are required.

https://www.thefewgoodmen.com/tsd3/combat-mission-battle-for-normandy/cm-battles-for-normandy/contact-front/

 

Link to comment
Share on other sites

Especially for the modern titles, being able to remount would be great for actually any kind of withdrawal. What good is a battle taxi if you have to literally leg it... That's in parts why casualty rates are so high, I think. If it was simpler to let the AI withdraw properly we would see less static defenses that are fought to the death. That may fit the cliche for fanatic SS troops (and even they withdrew more often than not) but feels quite off in most other cases, I think.

Link to comment
Share on other sites

22 minutes ago, Butschi said:

 being able to remount would be great for actually any kind of withdrawal. 

That would be nice for sure...as would some additional trigger options like

AI GROUP (XX) CASUALTY LEVEL HIGHER THEN (XXX) PERCENT.

for example...

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...