Speaking as someone whos interest is a game design, a lot of games implement so called “grace shot”. Most famous example of this is BioShock where AI was programmed to intentionally miss first couple of shots to give player a warning.
This should be straight forward to implement for AI SPAA in game. However it would not solve fundamental problem of death zone as after first burst AI would turn into death machines again. This requires implementation of deteriorating accuracy using vector math. Which for any game programmer is childs play as vector math is fundamental in all games. Let me explain.
Each Vector (as you probably know from math and physics) have direction and length. Direction of the vector is represented by scalar (value of 1) and length is magnitude of said vector. Now how I would implement it would be to measure change of vector direction (where plane is heading) over time and proportionally lower accuracy value of SPAA. This would result in behavior where if player fly straight (does not change travel vector direction) SPAA gets more accurate, however when player performs manuvers to shake it off (changing travel vector direction) SPAA accurarcy gets lowered.
You might think that it would result in situation where SPAA would always miss as long as you making manouvers. However there can be implemented a threshhold to the change in travel vector where AI is accurate enough to shot you down.
This would result in behavior as follows:
- You have enough time to approach targets and aim your munitions thanks to “grace shots”
- Once munnitions where deployed you must manouver in order to shake off AI
- After attack you would need to disengage from area by zooming out and prepare for another pass (simulating how planes would engage targets in real life)
- Staying in the “danger zone” by constantly manouvering would result in your death as you would bleed speed and energy, manouvers would become less impactful. So as such changes in your travel vector would lower and eventually they would become so low that it would trigger “perfect aim” threshhold.
But thats how I would implemented it if I ever was working on SPAA AI for game like Warthunder.