Jump to content
fiestamasta

Configuring AI to use Grenades and RPGs against Infantry

Recommended Posts

Hi all,

 

Browsing through the forums to answer this question I have seen several different solutions to this. Though I haven't been able to find a specific answer to what I'm trying to achieve though I believe I have an understanding of what I need to do.

 

I would like to configure the AI factions that my group plays against to use a variety of weapons against us rather than just their primary weapon.

I would like the AI to use RPGs and Grenades at the very least against hard point positions or whenever it suits their fancy. I've been playing Arma 3 with my group for a couple years and over the several iterations of our mod sets I've encountered a couple of factions that would indeed use launchers and grenades to varying effect. This is without using do action/do fire triggers and should be innate to the AI itself to use these weapons.

 

If I am correct I think this may have something to do with weapon configs/engagement distances? I haven't played around much with configs in the past but am eager to learn.

 

What I would like to know:

 

1. What causes AI to decided when to use these secondary weapons?

2. How can I replicate this on a faction that currently does not use these weapons against infantry targets?

 

Any help would be much appreciated.

 

Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Unfortunately there are no RPG in Arma 3 - there should be.

As for grenades, give every man pistols and grenades but no rifles and the enemy will gladly use grenades. As for grenadier soldiers, remove all bullet ammo and they fire the grenade launcher all day long.

Share this post


Link to post
Share on other sites

Some configuration of mods i used a while ago allowed this-i was using a mix of ACE and ASR_Ai and whatever I did it meant that enemies would engage with RPG's-very exciting :) Seemed to only work when fighting against massi's units though...

Share this post


Link to post
Share on other sites

Not sure I can provide more insight, but I'll add what I've seen...

The Enemy AI will indeed use grenades, launchers, and 40mm grenades. It seems to be somewhat random, based on some BIS formula/system. Not sure if it applies to vanilla units or all.

We always go for the Grenadier first if ambushing, because he often opens up with a barrage if not dealt with first. There also seems to be a morale system in play as well. The Enemy AI will act differently based on several factors. I could be wrong. The more you retreat or get outnumbered and pinned down, the more aggressive they seem to be. And vice versa.

They also seem to use throwable grenades more in urban/close environments for obvious reasons. We have noticed this alot while watching battles play out in our death cam waiting to Spawn a new game.

And a great game we had last year... The two of us were sneaking into enemy territory when we were spotted by a patrol, only to engage in a small firefight. But little did we know word got out (over Radio?). We moved into a small abandoned rock-walled house nearby to re-qroup and reassess the situation.

Then we heard footsteps around the house.... We waited... My friend was watching with his gun on the front door and I was checking all windows to see what I could. Someone was lurking around checking out the House, and then soon left.... Several tense minutes had passed... Nothing. All quiet. Looks clear...

Still checking and moving from window to window. Then I noticed a long ways away, movement.

Didn't look right. Not a CIV. Grabbed the Binoculars.... Yup, enemy! Saw a single CSAT soldier jogging across a field. He was about 600m away. Maybe more. Far enough that I couldn't make out detail without the Binoculars... He had a Tube!

So he stops in the middle of this field, a long ways out. And gets out his Rocket Launcher. Points it at the house. All while I'm watching.... Keep in mind, about ten long minutes had passed at this point since that firefight. All was dead quiet. Then it happened...

Puff of smoke....

Before I could finish yelling - GET OUT!!! I saw that warhead scream across those fields, and right into my window. KABOOM!

Game Over.

It sucked to get beat by the Enemy AI. But it was awesome, to see the AI actually play out that way. Realistic. Instead of simple gun to gun battles, when we were dug-in, they actually foresaw to get a Launcher out, way out in the field and just put that Rocket in through the window. Right in the face! Wow! It was great. Amazing.

So they will indeed use Rockets, Grenades, and the Underbarrel when they see fit. Just may not seem too obvious sometimes. The AI gets a bad rap a times, often justified, but other times, ...it is absolutely fantastic.

Share this post


Link to post
Share on other sites

If your playing the campaign or missions made by other people, then you may have a problem getting them to use smoke, h/grendes, rifle mounted grenades, rpg, plant explosives etc. However if your making your own missions/scenarios, try using GL5, it will help with some of that type of thing (not all).

That said, you'll not get the results that you'll get in A2 (modded), just that there is a lack of other AI mods in A3, that you could mix and use, that would help out with that type of play.

 

AI will use all these things, plus others, including flame throwers, throwing back grenades that land near them etc. etc.

If they have it they'll use it, but you'll need a mod to get them doing it, unfortunately.

 

NB: GL5 will not work well with all missions/campaigns. It is best used when you make your own missions, with the mod in mind i.e. as the base format (if you like).

Share this post


Link to post
Share on other sites

You don't need mods. The AI will often use the right weapon for the job. If you use the editor and give the AI just one weapon he will ALWAYS use that - and only throw or fire when in range!

Share this post


Link to post
Share on other sites

It's an interesting question about what governs their choices.

We have about 12 types of offensive grenades in unsung mod, and the ai happily throw the lot about.

We have an rkg-3 that i designed (has a parachute and penetrates armour) and the ai rain these down on your m113 apc, destroying it really quickly if you dont reverse or manouever rapidly.

They us rpg-2 and rpg-7 against infantry as well as land vehicles.

What governs this?

Well im only guessing but here's what we do in our missions/mods:

1. When we spawn ai we run a little script on them that turns down their accuracy but turns all their skills up. Having high skill mkaes them much more like human players - they flank, rush, flee, hide, counter and use full array of weapons against you.

2. The COST of the ammo is set low so they use them frequently - this is in the config for the ammo

3. The DAMAGE of the grenades is much higher in our mods - you can take out a tight squad of 10 men with one well timed grenade. This may have abearing - see below

Ok so a conundrum we have wanted to solve for ages but haven't yet, is how to get ai to fire rpgs at slow moving helicopters - as this was a key factor in vietnam - but also ai often don't fire at helicopters until they land...

My current theory, backed by evidence, is that the cost of the bullet or its damage is inhibiting them firing at the heli because of the value of the helicopters armor or the other variable i cant remember (am on tablet not pc) that affects the ai perception of your armor.

It's something like damageresistance in the vehicle config

I did an experiment in arma 2 and without any mods, i placed a russian group of infantry on utes airfield and flew slowly over them in a littlebird. The guys who fired at me had pks or svds. Nobody with an smg or ak fired at me. So i tested this in unsung and the same thing happened. The vc with mosins, pks and dp28s fired but the guys with smgs sks, or aks did not.

So whats the difference between these weapons? The weapons that were fired at the heli were all 7.62x54 and the weapons that they did not fire were 7.62x39 or lower.

So there is a fine line governing the firing behaviour against armored vehicles etc. I think this time around i will try to lower the damageresistance in the apcs and helis to see if they will fire ak's at the helis etc

As for firing rpg's at helis i imagine trackleadspeed or w/e its called would play a part, but i really have no idea why they dont try to shoot down a heli with an antitank rocket... Anyone got any idea?

  • Like 2

Share this post


Link to post
Share on other sites

Hi all,

 

sorry, I cannot start a new topic, so i post here:

 

I search the command (if it exists), to give the control of the player to ia​. Especially when some player become AFK on the server. in short, I want a "Sleep Mode", a script that the player or admin can execute.

I searched in the list of commands in vain

 

​thank you in advance

 

 

​

Share this post


Link to post
Share on other sites

It's an interesting question about what governs their choices.

We have about 12 types of offensive grenades in unsung mod, and the ai happily throw the lot about.

We have an rkg-3 that i designed (has a parachute and penetrates armour) and the ai rain these down on your m113 apc, destroying it really quickly if you dont reverse or manouever rapidly.

They us rpg-2 and rpg-7 against infantry as well as land vehicles.

What governs this?

Well im only guessing but here's what we do in our missions/mods:

1. When we spawn ai we run a little script on them that turns down their accuracy but turns all their skills up. Having high skill mkaes them much more like human players - they flank, rush, flee, hide, counter and use full array of weapons against you.

2. The COST of the ammo is set low so they use them frequently - this is in the config for the ammo

3. The DAMAGE of the grenades is much higher in our mods - you can take out a tight squad of 10 men with one well timed grenade. This may have abearing - see below

Ok so a conundrum we have wanted to solve for ages but haven't yet, is how to get ai to fire rpgs at slow moving helicopters - as this was a key factor in vietnam - but also ai often don't fire at helicopters until they land...

My current theory, backed by evidence, is that the cost of the bullet or its damage is inhibiting them firing at the heli because of the value of the helicopters armor or the other variable i cant remember (am on tablet not pc) that affects the ai perception of your armor.

It's something like damageresistance in the vehicle config

I did an experiment in arma 2 and without any mods, i placed a russian group of infantry on utes airfield and flew slowly over them in a littlebird. The guys who fired at me had pks or svds. Nobody with an smg or ak fired at me. So i tested this in unsung and the same thing happened. The vc with mosins, pks and dp28s fired but the guys with smgs sks, or aks did not.

So whats the difference between these weapons? The weapons that were fired at the heli were all 7.62x54 and the weapons that they did not fire were 7.62x39 or lower.

So there is a fine line governing the firing behaviour against armored vehicles etc. I think this time around i will try to lower the damageresistance in the apcs and helis to see if they will fire ak's at the helis etc

As for firing rpg's at helis i imagine trackleadspeed or w/e its called would play a part, but i really have no idea why they dont try to shoot down a heli with an antitank rocket... Anyone got any idea?

Unfortunately I won't be able to help with why/why not AI will use anti tank rockets against helis but I can further the discussion by saying that I've seen it happen. My group of players about 12 of us run our own cocktail of mods whenever it suits or fancy. Unsung 3.0b is actually our current and most favored iteration However in the past we were on a big middle eastern kick and have used a wide range of enemy AI units from CAF aggressors, massis units, etc. if interested I can run some testing as memory fades me at the moment. However this thread was started particularly in mind with CAF aggressors units. Although the mod itself is somewhat older and out of date. The Taliban AI in that moment were amazing. They used all different weapons that had in their arsenal to great affect. INCLUDING shooting RPGs at helos. Now if you were flying relatively high and fast, there wasn't a chance they would hit you. However that certainly didn't stop them from trying. As the pilot of my group flying quickly over an area I could see several intermittent puffs of white smoke and RPGs flying by my helo. However, if we ever wee caught in a situation where I was hovering and off loading troops. You could bet that our black hawk would get an rpg square into the side of it. There may have been another AI unit pack that produced similar results but out of all the different packs we've used certainly only one or two really used grenades and at weapons to the desired "realistic" effect.

  • Like 1

Share this post


Link to post
Share on other sites

So there is a fine line governing the firing behaviour against armored vehicles etc. I think this time around i will try to lower the damageresistance in the apcs and helis to see if they will fire ak's at the helis etc

As for firing rpg's at helis i imagine trackleadspeed or w/e its called would play a part, but i really have no idea why they dont try to shoot down a heli with an antitank rocket... Anyone got any idea?

correct Ammo Usage Flag is required

Share this post


Link to post
Share on other sites

Is it possible to, for example, set allowAgainstInfantry for the vanilla RPG for all units spawned in a mission by script?

Share this post


Link to post
Share on other sites

I have a solution too the question.  I made this a couple of years ago.  The results of this script snippets can be radical and unpredictable.  All units under a commander (AI) will use every weapon at their disposal to destroy targets that  commander instructs the AI to destroy.   haven't tested this in a good while.  Maybe someone will give it a try and let us know if it still works.  Remember, AI commanders give attack and engage orders to unit members.  

 

//Filename: attack_target.sqf
// Description: Orders squad members to attack the cursorTarget (object the players commanding AI and AI commanders are aiming at instructing their team members to attack)

//For AI commanders commanding units with AI Soldiers
// You can replace "east" with whatever faction you like
{
    _x doFire cursorTarget
} forEach units group ((side _unit) == east);



//For player commanding AI

{
   _x doFire cursorTarget
} forEach units group player;

//I would run this as two seperate *.sqf files in your mission folder.  Don't forget to include your init.sqf

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×