Page MenuHomeFeedback Tracker

AI Units will not target nor fire on an enemy when in "MIDDLE" stance during certain conditions.
Closed, ResolvedPublic

Tags
Subscribers
F2kSel, Unknown Object (User)
Assigned To
Authored By
Unknown Object (User), Mar 10 2015

Description

As the title describes, I have found conditions where AI units will not target nor fire on enemies in sight while in "MIDDLE" stance, and changing stance to "UP" or "DOWN" and then testing the same scenario reveals the units all of the sudden behaving as normal, firing on enemies as they should. I have tested this probably 20 times, it happened every time when the AI unit is in "MIDDLE" stance. This issue is found in both the current Standard Arma 3 version and the Arma 3 Development version. {F25735}

Details

Legacy ID
4080953787
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
AI Aiming / Shooting
Steps To Reproduce

In the mission, just wait a few seconds for the Opfor unit nearby to go into crouch stance, and then hit him in the leg, or hit nearby him, or run out into his view - as long as you are more than 20 meters out - any of these actions will reveal the issue, as the unit will just sit there and stare at the player, and will not target (lift weapon) nor fire. I have tested this out to 150 meters with the same results. The only time I have gotten the unit to fire is when I came within 10 meters of him, where he stands up and then fires.

If attempting to re-produce the issue in ones own mission, just set a lone enemy units init code to: This setBehaviour "SAFE"; This setUnitPos "MIDDLE"; And then set the player unit 50 meters away, and be sure initially that the enemy unit is not facing the player, so that when the test is started the enemy unit does not know about the player. Then from there, do the same as what the description at the top says for the provided test mission.

Event Timeline

Unknown Object (User) edited Steps To Reproduce. (Show Details)Mar 10 2015, 7:26 PM
Unknown Object (User) set Category to AI Aiming / Shooting.
Unknown Object (User) set Reproducibility to Always.
Unknown Object (User) set Severity to None.
Unknown Object (User) set Resolution to Fixed.
Unknown Object (User) set Legacy ID to 4080953787.May 8 2016, 11:38 AM
Unknown Object (User) edited a custom field.
F2kSel added a subscriber: F2kSel.May 8 2016, 11:38 AM

I tried your test mission and can confirm the issue.

I dug a little deeper and noticed that if you delay the setbehaviour command for a fraction of a second the problem doesn't happen.

this will delay all the commands but it works just as well if you only delay setbehaviour

null=this spawn {sleep 0.01;_this setUnitPos "middle";_this setBehaviour "safe";_This allowFleeing 0};

Unknown Object (User) added a subscriber: Unknown Object (User).May 8 2016, 11:38 AM
Unknown Object (User) added a comment.Mar 21 2015, 11:29 PM

F2k Sel's method I can confirm works for initially placing units in the game that are set to be in Middle stance:

null=this spawn {sleep 0.01;_this setUnitPos "middle";_this setBehaviour "safe";};

Unfortunately, after a lot of testing, it seems there are still some big issues with units bugging out and not firing on enemies when setting units to MIDDLE stance after any significant delay in game while a unit is in safe mode:

Using Middle position after a significant delay with SAFE Mode does NOT work (Unit will not fire on enemy):
null=this spawn {sleep 0.01;_this setBehaviour "SAFE";Sleep 10;_This SetUnitPos "MIDDLE";};

With no micro second inital delay makes no difference in result when the stance is executed after a significant time:
This setBehaviour "SAFE";null=this spawn {Sleep 10;_This SetUnitPos "MIDDLE";};

Using Middle position after a significant delay with AWARE Mode does work:
null=this spawn {sleep 0.01;_this setBehaviour "AWARE";Sleep 10;_This SetUnitPos "MIDDLE";};

With no micro second inital delay makes no difference in result when the stance is executed after a significant time:
This setBehaviour "AWARE";null=this spawn {Sleep 10;_This SetUnitPos "MIDDLE";};

At this point it seems clear that the combination of SAFE mode and MIDDLE stance is causing the issue, and further tests reveal that SAFE mode set in advance can set the stage for constant AI threat response failure in MIDDLE stance when it is set later on due to various combat situations.

More tests:

Does not work:
This setBehaviour "SAFE";null=this spawn {Sleep 10;_This SetBehaviour "COMBAT";_This SetUnitPos "MIDDLE";};

Does not work:
This setBehaviour "SAFE";null=this spawn {Sleep 10;_This SetBehaviour "AWARE";_This SetUnitPos "MIDDLE";};

With inital micro delay before setting SAFE mode. Does not work:
null=this spawn {Sleep 0.01; _This SetBehaviour "SAFE";Sleep 10;_This SetBehaviour "AWARE";_This SetUnitPos "MIDDLE";};

1.0 delay before Middle stance After Behaviour change randomly works and fails to allow unit to respond to threats.
This setBehaviour "SAFE";null=this spawn {Sleep 10;_This SetBehaviour "AWARE";Sleep 1.0;_This SetUnitPos "MIDDLE";};

5.0 delay before Middle stance After Behaviour change works every time. It seems this works because the unit has enough time to completely process/accept going into the new behaviour before the stance switch.
This setBehaviour "SAFE";null=this spawn {Sleep 10;_This SetBehaviour "AWARE";Sleep 5.0;_This SetUnitPos "MIDDLE";};

Ran same tests with setting combat mode before stance change, same results.

Tried an inital micro delay before setting SAFE, same results:
null=this spawn {Sleep 0.01; _This SetBehaviour "SAFE";Sleep 10;_This SetBehaviour "AWARE";Sleep 1.0;_This SetUnitPos "MIDDLE";};

Conclusion:

With the unit in SAFE mode, and then after any significant delay, switching stance directly to MIDDLE while he is still in SAFE mode causes him to not fire on a visually identified enemy. Manually setting a behavior change to Aware or combat before switching stance to middle will *NOT* fix this unless a significant delay is set before changing the stance, meaning the main purpose of setting stance to middle in reaction to a combat situation is far too slow to work.

So, right now I do not see a reasonable fix for this, except for that hopefully the developers will fix this at some point.

This means that this can happen in any mission where units in safe mode are scripted to go into middle stance.

Examples : Units in safe mode that are scripted to take cover, using middle stance. Units in safe mode that are scripted to respond to some sort of base alert that sends them into middle stance. Patrols that are in safe mode that are scripted to go into middle stance due to combat conditions.

Testing has also revealed these bugged units do not recover from it, they will not fire on a nearby sighted enemy unless the enemy gets very close to them or their stance is changed manually.

I have tried to compress this message, but I feel all of the information is important, as it eliminates the need for others to re-test these various scenarios, and provides all the testing information I have gathered regarding the issue.

Thank you for the report and the investigation!

Unknown Object (User) added a comment.Mar 22 2015, 4:20 PM

I have just discovered that this bug can happen to AI units in safe mode that go into middle stance through their own AI behavior as well, so this issue is not just limited to a scripted stance switch to Middle. The issue here is randomly reproducible due to random behavior from the AI, but I am able to get it to happen roughly 20% of the time by just planting an opfor unit nearby the player, in safe mode, facing away from the player, and then fire off a shot into the air (let the sound alert the unit) and let the unit respond shortly after.