The top video has target priority code, but the AI aren't using it correctly. I fixed this bug last night. Videos prior to that show builds without target prioritization, so ships will just shoot whatever they are told to. The AI simply chose the closest target back then.
The behavior now is this:
Flak and AAA beams prioritize bombs, then fighters, then capital ships.
Blob turrets prioritize bombs, then capital ships, then fighters.
If a focus target is selected, these weapons still prioritize bombs and fighters, but if there are none, then shoot the target if it's within firing arc. Otherwise, shoot whatever they can see.
Main beams always fire on nearby capital ships, unless ordered to focus. Main beams do not fire when ordered to focus if they cannot see the target. This is a mechanism that allows for power conservation, since main beams drain a heavy amount of juice. Main beams do not shoot fighters or bombs.
I hope that makes sense. Positioning and planning are very important, as well as knowledge about ship weapon layouts. The fleet builder will eventuallyTM include an inspection window that will show weapon and subsystem placements.
Speaking of subsystems, I just implemented that last night as well. Subsystem damage affects ship effectiveness according to the system type.
Engine systems control maximum speed (and yes, redundant engine systems add protection. Looking at you, Hecate...);
Weapon systems control accuracy;
Sensor systems control visibility range;
Reactor systems influence reactor efficiency (recharge);
Fully destroyed navigation systems prevent a ship from jumping;
Fully destroyed communication systems prevent a unit from accepting orders.
Damage to fighterbays increases the delay between fighter launches. Fully destroyed fighterbay cannot launch fighters.
A damage control ability will be available to allow for repair of subsystems, but the unit must stop moving and stop firing to use it.
If the comms are destroyed, the unit automatically activates damage control to restore functionality.
Communications are not restored until the system reaches 25%.
If an engineering ship is nearby (e.g. Faustus, distance ~1000m), subsystem repair speed is increased slightly.
I think this adds a nice layer of tactical thought; you'll want to protect ships from critical subsystem damage by thoughtful placement
All subject to change of course, but that's my first pass. Let me know what you all think.