I finally got to the point where I feel a little safe in my latest game. I managed to get a battleship with L3-4 systems, 4 weapons(20,20,40, and 50 GJ) and an advanced targeting system before ever seeing space combat (in any game). I thought that I had done this quickly (currently day 100, but I've had the ship for a while now), and there were only a few ways that I know of to improve the ship further, so I thought I would be overprepared for combat. Either that isn't the case, or I don't know how to go about it.
My first fight was with a monster in a gas giant. Once it was within range I fired a full volley from my weapons and missed with all of them (had a L3 gunner). Then the monster attacked my ship and took it from 40 HP to <10 HP in one turn. I fled.
Since then I routinely try to attack pirates, but whenever I attack them I immediately get the message that everyone has fled already. There have been two times that I have been attacked by pirates in a cloud, and both times have been fairly similar - I get off maybe 1 hit, and they immediately bring the best combat ship in the game to near death in one round.
What could I be doing wrong here?