Ace3: AI will heal right after being shot if they've not shot recently

Created on 19 Apr 2020  路  23Comments  路  Source: acemod/ACE3

Mods (complete and add to the following information):

  • Arma 3: 1.98 (profiling)
  • CBA: 3.15.0
  • ACE3: 3.13.1
    _Make sure to reproduce the issue with only CBA and ACE3 on a newly created mission!_

Description:
AI starts healing instead of fighting back if you suprise them and shot them before they can shoot back..

Steps to reproduce:

Expected behavior:
AI does not heal right after being shot.

Where did the issue occur?

  • SP/MP

Log Files:

kinbug

Most helpful comment

but what if the wound is serious and the ai is bleeding too much and may not make it to the 30s delay?

Then it dies, which is fine. You shouldn't just stop in the midst of combat and start healing yourself. That only makes you an easy target and helps noone.

lets say for example an enemy group call reinforcements and they will be there after 30s

The group that called in the reinforcements would have to completely die for the AI not to be shooting or being shot at anymore. Then the 30s timeout starts. And when the reinforcements arrive, the AI stops healing and continues fighting, I really don't see what's wrong here.

but if it gets delayed again i can assure you that the ai will not survive with in another 30s and will go unconscious and die, if you apply this in long combat scenarios the ai will never heal

Which is completely fine. The AI will only heal when it's safe, which is exactly what's intended here. Get into safety, heal yourself, then heal others. This works for AI and players and is exactly what should happen.


Maybe decrease the timer the further the enemy is away.

I don't see how that makes any sense. How is a tank or an Browning M2 that's firing at you from 1km out any less dangerous than a soldier firing at you from 20m?


When you get shot, you don't wait until you can see your enemy to shoot back, because most of the time he is concealed and you know that. So you use the general direction the shoot came from, perhaps the bang if you can hear it, and you shoot back in that direction even if you don't see the enemy.

I would not include any "shoot back" logic into this, because that's really out of scope for the medical AI and leads into AI-mod territory. That might cause conflicts and unintended behaviour which I would like to avoid. Besides, vanilla Arma already does this to some degree. When you shoot an AI, the AI receives some knowledge of your position. This is why an AI will try to shoot at you even when you're hiding behind a bush or when you are too far away and it cannot see you.

All 23 comments

This is a quite annoying issue.

It can come with an easy fix. Either by making a more extensive enemy nearby check in fnc_isSafe.sqf (don't heal with an enemy is within 35 meters or so) and by extending the use of the "_ace_medical_ai_lastFired_" variable in other events.

It could trigger with a shorter timer on actually getting injured. Something like:
(_this setVariable [ace_medical_ai_lastFired, CBA_missionTime - 27]);
On an appropriate event. Hence preventing AI from immediately bandaging after getting hit.

It is something we are able to enhance in LAMBS Danger fsm in some interesting manners. Which of course goes beyond the scope of ACE3.

-k

(don't heal with an enemy is within 35 meters or so)

I often shoot AI's at ~100m. Especially relevant considering the

if you suprise them and shot them before they can shoot back..

More likely to surprise them while far away, and the AI just standing in the open where they were just shot, and healing themselves is also very helpful.
While at larger distance away they are more likely to actually get away if they'd choose to run instead.

IMO we can create a 30s timeout after being hit or being suppressed instead of _just_ testing if the unit is currently suppressed. There might be rare cases where the suppression from a single shot cannot be caught by the state machine because it would decay too fast, but it's a performance friendly solution that should already be quite an improvement.

30s is overkill? Like 5 would be enough already if I understand all this correctly.

I think 30s is good. With 5s you end up with the same thing, you finish your reload, get around the corner and he is healing yet again, just didn't start right away.

30s is the timeout for we use for shooting, so I'd use the same timeout for this case.

how about checking line of sight for wounded ai whether if they see the enemy or not, if not they are probably taking cover and safe to heal, maybe checkVisibility can be handy i guess?

No, that is not feasible.

When wounded, does the ai know the general direction it came from (provided the shot was not silenced/subsonic) ?

Reaction to contact is simple actually : If you know where it came from, shoot back first for a few seconds. Then find cover, and heal when in a safe position.

You don't heal when you're in the open, because you will be shot again and you're just wasting medical supplies.

30s from latest hit/suppression seems reasonable, also means AI is more likely to have ran to cover by that time which helps stop healing in the open

When wounded, does the ai know the general direction it came from (provided the shot was not silenced/subsonic) ?

The shooter is revealed to the AI to some degree. However, the AI knows about all targets of its group, even those it can't see itself but those only a different unit of the group can see.

So in order to check if you're visible, you need to check visbility of all of the known targets, factor in additional visibility factors such as overcast, fog, daylight, distance, etc. In order to check if you're "in the open", you need to _addtionally_ do raycasts in all directions, check all nearby objects and their bounding boxes and so on. All of that in one frame.

Reaction to contact is simple actually

We know that ideally the AI should find cover and hide before it treats itself. It sounds so simple. But if it was that easy, we would have already done that and I don't understand why that's not obvious.

but what if the wound is serious and the ai is bleeding too much and may not make it to the 30s delay?
10-15 seconds may be enough tbh at least for most situations

Then they die, how often is that going to happen? It would be an interesting occurrence as well.

i really dont see this as the right thing to do because it differs from situation to another, it will also break some scenarios, lets say for example an enemy group call reinforcements and they will be there after 30s, so the ai will heal just when the enemy arrives, you will see really awkward moments were ai will heal in the wrong situations, the delay is not suitable for this...
however, this is just my opinion just make sure to add a cba setting to disable it.

I mean, people heal in wrong situations too. And it's not a hard 30s, if he gets shot in the meantime, it gets delayed again to my understanding.

but if it gets delayed again i can assure you that the ai will not survive with in another 30s and will go unconscious and die, if you apply this in long combat scenarios the ai will never heal

Edit: unless you make another ai heal him instead

@AirShark07 That makes thematic sense, would you stop to heal if you're actively taking fire? The only possibility would be if you're well covered, but there is no trivial solution to determining that in sqf.

To clarify the current situation, it is intended in the code already that an AI waits 30s since the last time they fired their gun before healing. So really the problem point is when they're first shot (i.e. they heal before they fire back, thus nullifying that timer). By adding another timer since last hit, we're just saying in the time period between getting shot and returning fire we don't want the AI to heal.

Maybe decrease the timer the further the enemy is away.

So in order to check if you're visible, you need to check visbility of all of the known targets, factor in additional visibility factors such as overcast, fog, daylight, distance, etc. In order to check if you're "in the open", you need to _addtionally_ do raycasts in all directions, check all nearby objects and their bounding boxes and so on. All of that in one frame.

The question was not much about visibility, but general knowledge of the direction the shot came from (front/back/left/right). When you get shot, you don't wait until you can see your enemy to shoot back, because most of the time he is concealed and you know that. So you use the general direction the shoot came from, perhaps the bang if you can hear it, and you shoot back in that direction even if you don't see the enemy.

but what if the wound is serious and the ai is bleeding too much and may not make it to the 30s delay?

Then it dies, which is fine. You shouldn't just stop in the midst of combat and start healing yourself. That only makes you an easy target and helps noone.

lets say for example an enemy group call reinforcements and they will be there after 30s

The group that called in the reinforcements would have to completely die for the AI not to be shooting or being shot at anymore. Then the 30s timeout starts. And when the reinforcements arrive, the AI stops healing and continues fighting, I really don't see what's wrong here.

but if it gets delayed again i can assure you that the ai will not survive with in another 30s and will go unconscious and die, if you apply this in long combat scenarios the ai will never heal

Which is completely fine. The AI will only heal when it's safe, which is exactly what's intended here. Get into safety, heal yourself, then heal others. This works for AI and players and is exactly what should happen.


Maybe decrease the timer the further the enemy is away.

I don't see how that makes any sense. How is a tank or an Browning M2 that's firing at you from 1km out any less dangerous than a soldier firing at you from 20m?


When you get shot, you don't wait until you can see your enemy to shoot back, because most of the time he is concealed and you know that. So you use the general direction the shoot came from, perhaps the bang if you can hear it, and you shoot back in that direction even if you don't see the enemy.

I would not include any "shoot back" logic into this, because that's really out of scope for the medical AI and leads into AI-mod territory. That might cause conflicts and unintended behaviour which I would like to avoid. Besides, vanilla Arma already does this to some degree. When you shoot an AI, the AI receives some knowledge of your position. This is why an AI will try to shoot at you even when you're hiding behind a bush or when you are too far away and it cannot see you.

Then it dies, which is fine. You shouldn't just stop in the midst of combat and start healing yourself. That only makes you an easy target and helps noone.

that's what smoke grenades are made for using them when in the open to heal and cover, the safety of units are the highest priority and not the shooting

Which is completely fine. The AI will only heal when it's safe, which is exactly what's intended here. Get into safety, heal yourself, then heal others. This works for AI and players and is exactly what should happen.

it depends on team work as well, IRL they will cover each other while healing, it makes only sense for individuals but not for a group of ai's, if you are covered by the rest of the team = good to heal it doesnt need to be covered behind objects or obstacles, i make the ai suppressing the enemy for me while healing, or poping smokes at least that how i play,

The group that called in the reinforcements would have to completely die for the AI not to be shooting or being shot at anymore. Then the 30s timeout starts. And when the reinforcements arrive, the AI stops healing and continues fighting, I really don't see what's wrong here.

i think you misunderstood this one

however i know this is beyond the scope of ace, i just want to be sure that there is a setting to disable it as im using my own complex system.

Could you maybe use targetsQuery or targetKnowledge and get the last time seen, and distance to the most recent target? Maybe take into account injury severity, distance, target type, and time elapsed, in order to start healing?

No.

Was this page helpful?
0 / 5 - 0 ratings