You
can get AI allies. Popping the occasional scout isn't an obstacle to that either. Relations do not drop to zero goodwill as soon as you shoot at one ship... unless that was the empire's
only ship

. You certainly do not have to micromanage turrets or anything like that.
If you are trying to make alliances at 31%, that is where you are going wrong. You can get a ceasefire sometimes at 50%, anything less than that and your AI opponent isn't serious about it and will break it off. Better is to wait until you've done more missions and reached 75% for a sound peace treaty. From about 80% up you can expect to get a real alliance.
Never push things too fast with AI diplomacy. Unless you are really desperate for a ceasefire then wait for a comfortable surplus of goodwill. Sometimes the AI will offer the ceasefire or peace treaty a bit early. It's safe to accept, but you will still need to keep improving the goodwill score.
As for trade alliances... the AI makes and breaks them based on the cash benefits. Don't ever bother to accept one if you haven't got a chain of trade stations that touches your trading partner's empire. Also, never expect a stale offer to work out. I mean that if you don't accept an AI offer as soon as it is made there is an excellent chance that the AI will have changed its mind between making the offer and you getting around to accepting.
If you do get a trade alliance, try to follow it up with a ceasefire or full peace treaty. They're much more stable if you can do that.
If you're struggling to raise the AI's goodwill despite faithfully and quickly meeting the mission demands then the reason will usually be that you are currently repelling an attack by that AI. Sometimes there are other reasons such as you having parked your fleet on a trade route the AI is using (perhaps a cross-border route to an ally they already made), but usually it is because you are destroying their ships. One or two here and there won't stop you making peace, but if you are destroying a big invasion fleet you might as well finish that before you try to make peace.
In the late game it may be too late to form alliances - your culture pressure may be too great a threat for the AI to risk trusting you in case you subvert their planets. That's another reason that the AI goodwill can drop in the late game, but it is usually less of a factor than the missions and the combat.
In the game you described I would suggest you pick one AI as a mortal enemy and simply commit to attacking him. If it is a strong AI that usually causes the other AI players to give you missions based on destroying that AI's ships and planets and by the time your campaign is in full swing you can probably get an alliance, assuming you've been meeting the easy resource requests. It helps a lot to sic the pirates on to one of the AIs you are not attacking personally - even on to your preferred ally. You just want to keep them busy so they don't invade you and sour relations.
Finally... if you want a late-game alliance, always make it a priority to research your diplomatic research projects. You can make an early-game alliance before getting them, but it will be a more stable alliance once you reduce the penalty for a failed "mission" demand.