Changing AI attitudes

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Changing AI attitudes

Post by MikeDuk »

  • Does exploding a nuclear bomb in my enemy's territory reduce my AI allies' love for me?
  • Does having military units inside my allies' cities reduce their AI love for me?
  • Does blocking an AI unit I am in armistice with (blocking means the unit is in my territory and is surrounded by my units, so it can't move. It cannot attack either because of the armistece) reduce my allies' AI love for me?
Initial state:
  • I have 4 allies: A, B, C and P. A, B and C are allies among themselves. P is allied with A and B and hasn't met C.
  • P has 3 other allies: X, Y and Z
I declare war to X, Y and Z, expecting P to break alliance with me, but not expecting to see changes in diplomacy with A, B and C.

In 3 or 4 turns, P's attitude towards me drops from "Worshipful" to "Enthusiastic". It will probably declare war on me after the armistice ends. That I was counting on.

I haven't attacked P, nor sent units into his territory. I have only blocked two of his units in my territory (I thought that would cause those units to be disbanded in a few turns, because of the armistice, or maybe provide a casus belli for A-B-C (my allies) to declare war on P).

I have exploded 2 or 3 nuclear bombs in my enemies' territory, not killing any of A-B-C-P units.

Final state:
  • A, B and C attitude towards me has dropped from "Worshipful" to "Admiring". Is it because of the nukes? I didn't break the alliance with P (P broke it when I attacked Z-Y-Z), and I haven't attacked P (A and B are P's allies).
If P declares war on me, A-B should declare war on P, shouldn't they? C is not P's ally, so that shouldn't change. But A-B-C's AI love for me is decreasing, so there is something I haven't considered...
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changing AI attitudes

Post by cazfi »

The developer who has implemented that part has long gone, so it's likely that nobody knows the details now (I know I've not read that code through). Anyway, "Love" is a more generic counter of how much AI wants war with someone than just the behavior of that other player. E.g. if you appear weaker than itself, it may see conquering your nation as an easy way to expand.

Nobody likes those who use nukes, no matter the target (it's possible, or at least was in some versions, to anger them by exploding nuke on your own territory)
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Re: Changing AI attitudes

Post by MikeDuk »

Thanks, cazfi.

I was talking about "AI attitude" and "AI love" indistinctively, even though they may be different.

I have found this in the Git repository (freeciv/ai/default/daidiplomacy.c):

Nuclear strike against victim.

Code: Select all

receiver->ai_common.love[player_index(violator)] -= 3 * MAX_AI_LOVE / 10;
Nuclear strike against someone else.

Code: Select all

receiver->ai_common.love[player_index(violator)] -= MAX_AI_LOVE / 10;
Somebody else than victim did nuclear strike against self.

Code: Select all

receiver->ai_common.love[player_index(violator)] -= MAX_AI_LOVE / 20;

So it makes sense that my allies' attitude changed a bit for the worse.
Post Reply