Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: patch: make ai understand peace and alliances 2 (PR#12
Home

[Freeciv-Dev] Re: patch: make ai understand peace and alliances 2 (PR#12

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx, "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch: make ai understand peace and alliances 2 (PR#1277)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Mon, 25 Feb 2002 13:16:52 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Mon, Feb 25, 2002 at 02:07:00AM -0800, Per I. Mathisen wrote:
> 
> So we have now active diplomacy and passive diplomacy. The question
> is: is it worth implementing passive diplomacy because you have to
> reaudit the code when active diplomacy is implemented?

Raimar, 

I am fully supportive of what Per is doing.  My reasons:
1. Passive diplomacy is useful, fx for scenarios
2. "Reaudit" is a strong word.  To add active diplomacy on top of passive, you
wouldn't need to touch most of the existing code.  It would probably amount to
profit estimation and hysteretic decision making.  To substitute every
is_enemy call in AI with is_enemy_or_worth_breaking_treaty_with is wasteful
and not at all clever.
3. What Per is doing is a first step towards full diplomacy, it has to be
done, and we want have to redo a significant portion of this.

Per,

I haven't yet looked at your patch but I will.  Raimar's list would probably
be a great help.  There is also place in savegame.c where state of war is
brutally
forced upon AI.  If you switch it off (as I proposed some time ago), you can
actually have a savegame with allied AI and load it and AI stay allied, which
is a good testing ground for you!  But you have probably know it by now
anyway.

Best of luck,
G.


> 
> Nevertheless you have to deal with the remaining cases:
> ./ai/advmilitary.c:693:  if (acity && acity->owner == pplayer->player_no) {
> ./ai/aicity.c:1026:    if(acity && acity!=pcity &&
> acity->owner==pcity->owner)  {
> ./ai/aihand.c:449:    if (DEBUG_AMG_RATING &&
> prev_rating[pplayer->player_no][i] != rating && (rating > 0 || rating >
> prev_rating[pplayer->player_no][i]))
> ./ai/aiunit.c:1283:         (acity && acity->owner == punit->owner &&
> acity->ai.urgency &&
> ./ai/aiunit.c:1645:      pcity->owner != punit->owner && pcity->ai.invasion
> == 2 &&
> ./ai/aiunit.c:2353:      if ((dist == 1) && (pplayer->player_no !=
> ctarget->owner)) {
> ./ai/aiunit.c:516:  if (pcity->owner != punit->owner) return FALSE;
> ./ai/aiunit.c:612:    if (pcity && pcity->owner != punit->owner)
> ./ai/aiunit.c:647:      if (aunit == punit || aunit->owner != punit->owner)
> continue;
> ./ai/aiunit.c:665:      if (aunit == punit || aunit->owner != punit->owner)
> ./ai/aiunit.c:690:      if (aunit == punit || aunit->owner != punit->owner)
> ./ai/aiunit.c:714:      if (aunit == punit || aunit->owner != punit->owner)
> ./ai/aiunit.c:871:      if (pcity && pcity->owner != pplayer->player_no
> ./ai/aiunit.c:914:  if (aunit && aunit->owner == punit->owner) { x =
> aunit->x; y = aunit->y; }
> ./ai/aiunit.c:915:  else if (acity && acity->owner == punit->owner) { x =
> acity->x; y = acity->y; }
> ./client/packhand.c:341:  if (pcity && (pcity->owner != packet->owner)) {
> ./client/packhand.c:574:  if (pcity && (pcity->owner != packet->owner)) {
> ./common/city.c:1929:   && punit->owner == pcity->owner)
> ./common/city.c:838:      || (pc1->owner == pc2->owner
> ./common/city.c:875:    if (pc1->owner==pc2->owner)
> ./common/combat.c:231:    if (pcity && (city_owner(pcity) != owner)
> ./common/game.c:312:      if (owner != no_owner) {
> ./common/player.c:240:  if (punit->owner==pplayer->player_no)
> ./common/player.c:247:        if (punit2->owner == pplayer->player_no)
> ./common/player.c:252:      if (pcity && pcity->owner == pplayer->player_no)
> ./common/player.c:270:  if(pcity && (pcity->owner==pplayer->player_no)) {
> ./common/player.c:286:  if(punit && (punit->owner==pplayer->player_no)) {
> ./common/player.c:301:    if (pcity && (pcity->owner == pplayer->player_no))
> ./common/player.c:56:  return (pcity->owner==pplayer->player_no);
> ./common/unit.c:109:    if(pcity->owner!=pdiplomat->owner &&
> ./common/unit.c:169:  if(city1->owner != pcity->owner) 
> ./common/unit.c:189:    && punit->owner==pcity->owner
> ./common/unit.c:452:  if (pcity->owner != punit->owner)
> ./common/unit.c:471:  return pcity && pcity->owner==punit->owner;
> ./server/cityhand.c:416:  if (!pcity || pcity->owner != pplayer->player_no)
> return;
> ./server/diplhand.c:160:        if (pcity->owner != pplayer->player_no) {
> ./server/diplhand.c:236:        if (pcity->owner != other->player_no) {
> ./server/plrhand.c:116:    if
> (pplayer->player_no==find_city_wonder(B_GREAT)->owner) {
> ./server/settlers.c:414:      if (punit->owner!=pplayer->player_no)
> ./server/srv_main.c:943:      if (other_player->player_no !=
> pplayer->player_no
> ./server/unithand.c:1437:  if (!punit || punit->owner != pplayer->player_no)
> ./server/unithand.c:176:    if (punit->type == packet->type && pcity &&
> pcity->owner == pplayer->player_no) {
> ./server/unithand.c:208:  if (pcity->owner != pplayer->player_no) return; /*
> Allied city! */
> ./server/unithand.c:363:    if (new_pcity && new_pcity->owner ==
> punit->owner) {
> ./server/unithand.c:922:      && pcity->owner != punit->owner
> ./server/unittools.c:1363:  if (pcity && pcity->owner == punit->owner)
> ./server/unittools.c:1415:  if (pcity->owner == punit->owner){
> ./server/unittools.c:1525:      if (is_ground_unit(wunit) && wunit->owner ==
> vunit->owner) {
> ./server/unittools.c:250:    if (punit2->owner == punit->owner) {
> ./server/unittools.c:2808:      if (tocity->owner == punit->owner) {
> ./server/unittools.c:2827:      if (fromcity != homecity && fromcity->owner
> == punit->owner) {
> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>   Windows: From the people who brought you edlin...
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


[Prev in Thread] Current Thread [Next in Thread]