How the AI retreats on an "attack gone south" (from either waves or regular threat, in fact, they use the same logic IIRC) is rather odd.
Some observations:
-As already reported elsewhere, sometimes the AI retreats way too early, as little as 2 seconds in some cases
-Some shiptypes take "worse odds" to trigger a retreat than other types. In particular, starships, bombers, and carriers are more likely to hang around even when everything else on the planet is trying to get out of there
-The retreat logic isn't consistent even within a ship type. Sometimes, some of the, say, fighters will try to retreat, while others will continue to seek out stuff to attack.
-Sometimes, the retreat logic doesn't kick in when it clearly should. I have had cases where they would turn tail when they are out powered 3 to 1, but will try to stick around when they are out powered 10 to 1. (and yes, I am remembering to count turret firepower in these comparisons)
-Although the AI seems more likely to retreat to an allied (AI owned) planet, they will sometimes "retreat" to another hostile (human owned) planet. (IIRC, this one is intentional though)
I'll try to get some saves demonstrating some of these.
Anyone else observe some oddities or have saves demonstrating these or other oddities in AI retreat logic?