You have the Drengin on one side of you, and the Korath on the other. The Drengin and the Korath go to war with each other. Drengin ships cross your border headed for Korath space, and vice versa. Do you, as a player, immediately declare war on both of them, despite the fact that they don't care one whit about you and would probably beat you senseless if you fought both at once?
By your statements, you're saying that yes, you would declare war on both the Drengin and the Korath, immediately and automatically. Doing otherwise would be stupid!
Here's another one. You have the Torians on one side of you, and the overwhelmingly powerful Yor on the other. You're allied with the Torians. The Yor attack you, triggering the alliance and dragging the Torians into the war. In order to help fight the obscenely strong Yor military, the Torians send their ships across your border. Do you, as a player, immediately declare war on the Torians?
By your statements, you're saying that yes, you would declare war on the Torians, immediately and automatically. Doing otherwise would be stupid!
Sarcasm aside, I hope you can see why programming the AI to be paranoid nutjobs with a hair-trigger "declare war" button would probably just make them even more stupid than they are now.
I have not said that, thats your interpretation. I meant that the AI is being stupid when it waits for all your transports to position yourself just outside their planets, then declares war and then after you already invaded all his planets he starts to react. So its not that the AI should declare war the moment one player ship is in his space.
Also your comparison to what a player should do in the same case is invalid because we know how the AI works and we know that it doesnt do surprise attacks as the AI is very predictable by first declaring war and then starts sending his ships to attack you. Since the AI will not "know" what a human is doing there should be coded in the AI to look for signs that an attack is coming.
So the AI shouldnt be coded to respect other empires space since its already predictable enough to first declare war before starting to invade so there is no need for such mechanism.
But to protect the AI from cheap sneak attacks from a player, if the AI sees a great number of player ships in its space then he should first warn, and then if they are still there it should declare war and react. Or atleast react by having ships ready to defend his planets (besides the sitting ducks in orbit without orbital fleet management).
And if the player gets dragged into a war by an ally, and the only way to help is to go through that ally's territory? "Why thank you for helping me, but I'm afraid I have to declare war on you as well since your ships are close enough to help me."
What if the player's empire is split into pieces by an AI's territory (i.e. a "pocket" surrounded by the AI and possibly map edges), and the Korath declare war on the player? Gee, guess that "pocket" is Spore-fodder since the player isn't allowed to move ships to protect it without their AI neighbor declaring war over it.
And even if you DO give the AI a hair trigger,
a human player will find a way around it. That's the big problem. No matter what you do, the AI will be unable to defend itself from a sneak attack because the human player will find a way to either get around the restriction or, even worse,
use it to sneak attack anyways.
This should give him a couple of turns to prepare for a possible invasion. Just as a human player would do if he was playing against another human player.
This pretty much admits that there's nothing a player - human or AI - can do to stop a sneak attack without being a paranoid psychopath.
In your second example, as Ive mentioned, since you are allied with Torians then this violation in your space should be allowed. There should be some kind of thrust between two allied parties.
A perfect exploit, then! Build up an alliance, then sneak-attack when they least expect it!
ANY leeway the AI EVER gives a player is an invitation to exploit it. Every measure you implement to do away with false positives just opens even more doors to get around the safeguards and do what you were going to do anyways.
The ONLY way to make the AI able to react "in time" to a sneak attack is to declare war the instant one of the player's ships - ANY ship, even unarmed ones - gets within two turns' move of the AI's planets
even if they're still in the player's territory. Anything less, and the player WILL find a loophole, period. But frankly, if the choice is between a bit of naive trust vs. being a foaming, raving psychopath, I'll take the naive version of stupid over the blood-crazed moron version of stupid any day of the week.
Edit: Just for the record, I'm not arguing that they shouldn't make the AI better. In my opinion, the better the AI is, the more I like it. Good AI = Good Thing. What I'm arguing is that it is NOT as easy as "just make the AI do X"