Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn
Home

[freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 13 Sep 2004 02:42:27 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [per - Mon Sep 13 09:15:49 2004]:
> 
> On Mon, 13 Sep 2004, Mateusz Stefek wrote:
> > The reason is that ai_players_can_agree_on_ceasefire() isn't
> restrictive
> > enough.
> > This patch fixes it.
> > Also change the method of calculating ai.love gravitation. Now it's
> > better rounded.
> 
> -          (player1 == ai1->diplomacy.alliance_leader ||
> -           !pplayers_at_war(player2, ai1->diplomacy.alliance_leader))
> &&
> +          ai1->diplomacy.player_intel[player2-
> >player_no].at_war_with_ally &&
> 
> Stealth removal of the alliance leader concept??
> 
>   - Per
> 
!pplayers_at_war(player2, alliance leader) => at_war_with_ally.
I just hardened the condition, because AI _always_ breaks ceasefire if
the second player is  at war with ally.

From ai_diplomacy_actions:
  /*** Declare war - against enemies of allies ***/

  players_iterate(aplayer) {
    struct ai_dip_intel *adip =
&ai->diplomacy.player_intel[aplayer->player_no];

    if (aplayer->is_alive
        && adip->at_war_with_ally
        && !adip->is_allied_with_ally
        && !pplayers_at_war(pplayer, aplayer)) {
      notify(aplayer, _("*%s (AI)* Your aggression against my allies was "
                        "your last mistake!"), pplayer->name);
      ai_go_to_war(pplayer, ai, aplayer);
    }
  } players_iterate_end;

Alliance leader concept is still used in many places.
--
mateusz



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