freghar / arma-additions

Other
4 stars 0 forks source link

Add more advanced AI suppression logic #7

Closed freghar closed 3 years ago

freghar commented 3 years ago

https://github.com/freghar/arma-additions/commit/611da91d2cca6672327b10a1e4d06bd20626f342 was later reverted with https://github.com/freghar/arma-additions/commit/094691097aa37f6657f3209af45d91ff9b7626cc due to how suppression made the unit unable to actually hit a player at almost point blank range. Even at lower suppression coefs (0.5 instead of 0.8), it would still exhibit the problem from just players shooting a lot around it (or onto adjacent walls) in CQB. Accuracy reduction also isn't the best effect for a suppressed unit.

Implement script-based logic instead, around the new Suppressed EH, which passes bullet distance (so we can limit suppression to a ~3m radius, not ~30m) and shooter, which we can maybe use to allow suppression only when fired upon over a distance (ie. >100m) to avoid weird CQB glitches.

The suppression itself can also be more advanced; perhaps the new per-unit setUnitCombatMode could be used to make it temporarily stop shooting back, and, if it is prone, to remain prone for a while (via setUnitPosWeak to let Zeus override it). Or even disableAI on TARGET and/or AUTOTARGET to stop the unit from tracking enemies.

Or something even more advanced like doMove (or moveTo) to a buildingPos of a nearby building (incl. a wall) that doesn't have line of sight (lineIntersects of that position's chest height vs a point 20m away on a line between that pos and the current highest prio target), eg. actually moving into hard cover.

freghar commented 3 years ago

Scratch this, it would break the "I don't touch FSM" barrier and could have a negative effect on AI mods.