Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2004:
[freeciv-ai] (PR#9884) AI never breaks alliance
Home

[freeciv-ai] (PR#9884) AI never breaks alliance

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#9884) AI never breaks alliance
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 31 Aug 2004 08:21:18 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9884 >

In current implementation AI will break alliance only if you are not at
war with it's target. AI never considers it's allies as war target. This
should be changed. Attached patch is really simple.
Note that if ai.love == 96 (maximum realistic level), war desire is
divided by 25!. So it will really rarely happen. (You can move your
units into AI's territory if you want to reduce love a little)

I playtested it. AI broke alliance with me when I was four times as big
as he and the second most powerfull nation was two times smaller than
me. I  had also had units on its territory for few turns (love was = 70
in a turn when it broke alliance).
I think this is a step into correct direction.
--
mateusz
Index: advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.30
diff -u -r1.30 advdiplomacy.c
--- advdiplomacy.c      29 Aug 2004 10:06:06 -0000      1.30
+++ advdiplomacy.c      31 Aug 2004 15:03:51 -0000
@@ -766,15 +766,14 @@
     enum diplstate_type ds = pplayer_get_diplstate(pplayer, aplayer)->type;
     struct ai_dip_intel *adip = 
&ai->diplomacy.player_intel[aplayer->player_no];
 
-    /* We don't hate ourselves, those we don't know and those we're
-     * allied to or team members. Defer judgement on alliance members
-     * we're not (yet) allied to to the alliance leader. Always respect
-     * ceasefires the boss has signed. */
+    /* We don't hate ourselves, those we don't know or team members
+     * Defer judgement on alliance members we're not (yet) allied to
+     * to the alliance leader. Always respect ceasefires the boss has signed. 
+     */
     if (aplayer == pplayer
         || !aplayer->is_alive
         || ds == DS_NO_CONTACT
         || (pplayer->team != TEAM_NONE && pplayer->team == aplayer->team)
-        || ds == DS_ALLIANCE
         || (pplayer != ai->diplomacy.alliance_leader 
             && adip->is_allied_with_ally)
         || (pplayer_get_diplstate(aplayer, ai->diplomacy.alliance_leader)->type

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#9884) AI never breaks alliance, Mateusz Stefek <=