I'm (finally) fighting a proper war with fleet engagements and planetary invasions and so on.
When two fleets meet in a star system, I get to choose between auto-resolving or manually commanding the battle or autoretreating. The option to fight it out can be either "Attack" or "Defend", which determines, as far as I've seen so far, the side of the screen you start on and who goes first. (Attacker on the left, defender on the right with planets and space stations as applicable, defender goes first).
What I do not fully understand is the logic that decides who "attacks" and who "defends".
Examples:
-when exploring an unknown star system and finding there hostiles (pirates or star harpies), the message is "Attacked at [STAR]" and the fighting option is "defend". I suppose this is to give the scouts a chance to escape, as by being "defender" they get to move first.
-when attacking a planet with no defending fleet in the system but with planetary defenses, the option is "Attack" and the fight is my (attacking) fleet vs the (defending) planet (and space stations if present). This is straightforward, no questions here.
-when an enemy fleet arrives at one of my planets though, is when things get weird: I have a planet with planetary defenses and a star base (the armed and armored space station). I also have moved my own fleet so that it arrives at the attacked system the same turn that the enemy does. The message I get is "[ENEMY] encounter at [SYSTEM]", with the icons colored yellow rather than red (same as when I end up in a system owned by someone else with whom I'm not at war, or when neutral ships arrive at one of my systems), and the combat option is "Attack", when I would have expected "Defend" (this being my star system). The combat, as the option name says, has my fleet as the "attacker" and the enemy as the "defender". My planet and star base are nowhere to be seen.
I was expecting to have a battle with all of my assets at the system: fleet, planet (planetary defenses) and star base all together. What am I missing or doing wrong?
Or are the star bases and planetary defenses there only as a last defense when no fleet is available? Feels a bit of a waste to spend all that metal (star base) and upkeep (plan. def.) on static defenses that, against mobile attackers, are fundamentally at a disadvantage.
On a side note, it's a nice touch that when civilian transports arrive at a system with hostile warships, the auto-resolve result is that the civilian transports surrender. Now that I know about it, sending even just a small light cruiser to capture long-distance enemy civilian tranports at their arrival is a nice way to get bonus alien populations (and free transports too!).
And with the Ashdar Haduir (Imperial) relic gate that's ridicoulously easy.