This page explains how targeting functions in Warring Factions.
The target value of a ship is based on the design's firepower, speed, armor, shielding and mass. Firepower is only offensive weapons (ones you can start the attack with), so gun batteries do not count in the ship's score other than by virtue of the mass they add. Firepower is multiplied with the other factors, so if you have no offensive firepower, then the ship's targeting score will be 0.
Cap italships tend to be large positive values, and small vessels tend to have large negative values. It is possible to design ships so their target values are positive for small vessels and negative for capital ships. Whether they are useful or not, is another issue completely.
How targeting worksEdit
Single Barrel Guns will always target the largest negative number first, going upwards until there are none left. They spread their damage across all ships of the design they are currently targeting. If there are no targets left with a negative targeting score, they will start firing at the largest positive score, stacking their damage - essentially firing at one ship at a time.
Cannons are simply the reverse of this, and will always target the most positive number before going down.
Ships with a targeting score of 0 will be fired at last.
The formula is not confirmed, but it looks something like this:
firepower * (Hull mass + Base armor + Base shield - Speed)
Ground Defense and TargetingEdit
Ground defense are calculated as if they were ships.
Hybrids and targetingEdit
Hybrids equipped with a cannon will fire according to the rules that govern cannons, no matter what the ratio of single barrel guns to cannons is on the ship.