We would like to create NPC airplanes that have the ability to engage in air combat.
Since these airplanes do not have missiles, they can win only if they can bring their guns to bear on you at close range. This does not mean that they have to get on your tail. They can also win with a deflection shot - made when you cross in front of them. Or, if things get too bad for them, they can escape and re-engage under more favorable circumstances.
Here is a simple program which we can use to visualize the results. In this case you are controlling the blue airplane and the NPC airplane is simply copying your moves.
The NPC airplane must be able to handle 3 different situations:
We will start with the simplest. We will assume that both airplanes have identical performance and starting speed.
We will start where the NPC has an advantage. The easiest is where the NPC is directly on your tail and you want to escape. We can use this program to help visualize the results.
In the program, the NPC airplane is simply copying your moves. This is only helpful up to a point because the NPC will have the first shot at you. However, if the NPC misses and you both continue the turn, you will end up on the NPC's tail. Once they have had their shot, the NPC must find a way to prevent this from happening.
Another option is for the NPC to try to follow your flight path. This requires them to wait before copying your maneuver. The success of this strategy depends on how far ahead you are from the NPC. If you are a long way ahead, having the NPC wait could result in you performing a 180 degree turn and neutralizing their advantage. Or, worse, you could perform a full 360 and end up on their tail! Thus, this strategy makes sense only if you are a short distance from the NPC.
Another factor that comes into play is that, assuming you are making maximum performance turns, and the NPC is right on your tail, they will eventually have to
A blended approach is required.
If the NPC is within firing range, your best option is to make "break turns" in random directions and hope that you can "shake" the NPC. In this case, the NPC most likely wants to follow your flight path and hope that you are eventually flying the same direction again. In the real world, there is the possibility that you can break the NPC line of sight and change directions while hidden. But, for now, we will assume that you cannot break the NPC line of sight and that the NPC will always be able to match your bank angle.
If the NPC is just outside of firing range the NPC can delay following your turn since that will give them a chance to intercept and take a shot at you. But once they have taken their shot, the NPC will have to avoid overtaking you, which could give you a chance to turn the tables on the NPC.
One NPC response is to try to escape by diving away in the opposite direction. An NPC that wants to continue the fight could slow down by climbing - which preserves the NPC energy. But you could also do the same thing, in which case the fight could devolve into what is called a "Rolling Scissors", where both airplanes are performing barrel rolls around the other and hoping that one hoping that the other plane squirts out in front.
As you can see, even the simplest situation can turn complicated very quickly, especially if the NPC misses an opportunity to shoot you down. Maneuvering into position to take a shot while in a turning fight can put the shooter at a disadvantage, which the shooter must try to minimize.