Complete.Org: Mailing Lists: Archives: freeciv-ai: March 2005:
[freeciv-ai] (PR#12625) kill desire and teams
Home

[freeciv-ai] (PR#12625) kill desire and teams

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [freeciv-ai] (PR#12625) kill desire and teams
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 25 Mar 2005 00:20:09 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12625 >

kill_desire() doesn't understand teams. You can see AI doing very stupid
things in team games. If 5 teamed players play aginst 5 other players,
the unteamed ones shouldn't fight against each other, but they do.
Here's a patch which improves AI behaviour.
--
mateusz
--- techclean/ai/advdiplomacy.c 2005-03-15 00:48:18.000000000 +0100
+++ ff/ai/advdiplomacy.c        2005-03-15 10:58:07.000000000 +0100
@@ -705,6 +705,15 @@
     kill_desire += pcity->size > 8 ? 1 : 0;
   } city_list_iterate_end;
 
+  /* Destroy teams */
+  players_iterate(eplayer) {
+    if (!eplayer->is_alive || eplayer == aplayer
+        || !players_on_same_team(eplayer, aplayer)) {
+      continue;
+    }
+    kill_desire += city_list_size(eplayer->cities) / 2;
+  } players_iterate_end;
+  
   /* Tech lead is worrisome */
   kill_desire += MAX(aplayer->research->techs_researched -
                      pplayer->research->techs_researched, 0);

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#12625) kill desire and teams, Mateusz Stefek <=