Actual intercept mechanics and team work procedures should be introduced into the AI:
Intercept: lag and lead pursuit to set up intercept geometry.
If turnrate(ship)>turnrate(target) then:
Out of weapon range --> lead pursuit and try to maximize speed.
Just in weapon range --> just stay on target and advance to optimal range.
Optimal range --> weapon range * factor - or weapon range - factor. Factor - depends on tracking/turning speed vs. target evasion speed. While ttspeed>targspeed function should spit out a range from the enemy where the ship should ideally be.
Inside optimal range --> alternate lag pursuit to achieve shoot geometry and lead pursuit to maintain range.
Beyond optimal range, ergo too close --> lag pursuit, and decrease speed.
If turnrate(ship)<turnrate(target) then:
If topspeed(ship)>topspeed(target) then:
Energy fighting. This ins't the same in space as it is in air, since in the air it is virtually impossible to reach the high energy plane while the later can attack.
In other words, the ship has to use the fact that it can outrun the other one. Tactic should reflect this:
-Advance to weapon range.
-Max shields for the frontal pass.
-Fire away. Power to weapons.
-Pick a random vector, preferably opposite or at least perpendicular to the target's and disengage and full burn.
-Power down weapons and power goes first to engines than to shields.
If topspeed(ship)<topspeed(target) then:
Disengage unless ordered to or at least 3-1 numerical superiority is available.
Team work:
-Extended wingman system that during dogfights works in pairs. One ship always tags behind the other. If the lead is attacked, the wingman engages the attacker. Works vice-versa. Lead should be a disctinct role in the code and wingman too. These ships stay together no matter what. This would dramatically increase the effectiveness of a numerically superior force.
This would also mean you'd have to actually fly wingman for your mates and you'd need to take all your wingman to pick out someone from a numerically superior force. In this case (form on my wing), you wingman will attack the primary target, but they should peel off (in pairs if possible) to attack anyone who disengaged and turned to attack you. This leaves you free to take your kill.
The code should be revamped with visual cues to allow you to fufill the same function for someone else. A box should be around your "protected" at all times, and his attackers should be auto-targeted the same way asteroids are but with a different color.
The attacker meanwhile should check whether you're in escort position. If you're not and/or not enough guys are flying wingmen for him, he should disengage his run, and help out until he gets proper escort and once again can resume his run.
This only applies for fighters. Bombers should stick to bombing as they have no business chasing down fighters. Instead the lead bomber should check whether the whole wing has enough cover as a whole and disengage (in formation) if they don't and request further cover.
-Redefinition of Attack my Target Order: This isn't strictly a comm's order, it should be possible to put this on a key/button binding. Similar to the fire missiles on my target script of BTRL. This is an attack run. The same as Engage my target (see below), except, once the strafing run is complete (dist--(ship)-(target)<factor), the ships automatically rejoin your formation. You take your wing out, and through the maneuvers you deem appropriate, set up the next run, then once again give the order/push the button.
--Difference from "OLD" Attack my target: Ships auto-bracket (see below) the target (see below) if in a loose formation (see below) and return to formation once the run is complete.
-Bracketing: when engaging a single target, instead mindlessly going after if, your wingman should set up a bracket: he moves away from your vector to the target until his vector and your own form a considerable angle...in the least he should put a 50-100 meter separation between the two of you.
-New selection submenu: Ships in my wing, should be before "All Ships" and after "Alpha", "Beta", "Gamma" etc. in the list.
-New order submenu: Formations
--Tight formation: ships on your wing stay in formation no matter what, default for bombers.
--Rigid formation: ships on your wing stay in formation during the pass (engage target), and only disengage to save themselves or protect the ship they cover.
--Flexible formation: ships on your wing automatically bracket during attacks, disengage to fly cover or evade fire, return to formation if engage order was given.
--Leave formation: selected ships leave your wing. They autoform pairs and wings, with bias toward reforming their original wing.
-New order: Engage my target: Ships act according to the formation given during the initial attack, but they do NOT rejoin formation; instead they remain in the furball. Wingmen still cover their Lead.
-Bracket positions: Alpha 2 - on your left slightly behind you. He should be your default wingman and shoud fly cover for you even while bracketing. Alpha 3 - above you (this is because this way you make your bracket 3 dimensional and harder to escape from), Alpha 4 should be by default Alpha 3's wingman. When bracketing he flys next to Alpha 3. Alpha 4/5- on your right. (We don't want to put ships below you, as you can't quickly check them as most fighters typically can't see in that direction). Alpha 6 - flying wingman for Alpha 5, or below you if separately ordered to attack.
A modification of Protect my target: This makes the ship a wingman of the target if it's a fighter or bomber.
Fighter/Bomber cooperation:
-New order: Protect Wing. The order can only be given to a whole wing. The fighters will spread around the bombers (in pairs) if in flexible formation, or fly in formation slightly behind them if in rigid/tight formation. A "mini strat routine" should determine how many ships to send to each attaker. If only 1-group attacks the protected 3/4-4/5 of the force should be sent keeping at least a pair next to the protected in reserve. If more groups are attacking the 3/4-4/5 "taskforce" is divided between them with at least a pair to each group. A pair should still be kept in reserve.
When in protect wing mode, instead fighting individual targets, the pair should engage each and every ship in the attacking wing. Reason: they break the enemy's formation and force them to go evasive, gaining time for the protected to escape and the other guards to aid in the fight.
--Addition: Strafing run. Should be used if the target wing is in formation. The pair in protect wing mode should fire along a preset line. These lines (and turn rates) should be calculated from the enemy ships's position. Simplest solution: the line between two attackers. The only demand is that the pair should choose a different pair of attackers compared to each other.
-Staggered attack: This should be both used in Engage/Attack and Protect functions. Should be a similar key/button-binding to "Attack my Target" except, this is a "mode selector". When is staggered mode, ships ordered to attack or attacking on their own, will stagger their formation. This should only be used against numerically lesser targets.
The staggering allows the ships delayed behind the front attacker to take advantage of the blunders/changed facing of the engaged enemy and it also makes them better suited to still pursue the target if he somehow escaped the pursuit geometry of the initial attackers.