Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2005:
[freeciv-ai] AI defense fix
Home

[freeciv-ai] AI defense fix

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] AI defense fix
From: Per Inge Mathisen <per@xxxxxxxxxxx>
Date: Tue, 5 Apr 2005 19:45:27 +0000 (GMT)

While playtesting Benedict's don't-stack patch, I came across some rather
odd AI behaviour. This patch that I will commit immediately fixes this.

CHANGES:
 - Do not attempt to become a unit bodyguard when assigned to guard duty
   for a city. I noticed defenders defecting from defense to bodyguard,
   leaving behind totally undefended cities with enemy nearby! Yikes.
 - Do not yoyo between cities attempting to defend them all.
   look_for_charge() has the problem that it calculates current defense in
   each city in the world, but forgets to calculate in that once we leave
   the city we are currently in, that city might become the most needy! So
   instead we try harder to stay where we are. (look_for_charge() is
   desperately in need of a cleanup btw)
 - When military code can't find us work to do, actually do go home. Now
   using ai_military_defend() (previously named ai_manage_gohome()). This
   stops the ridiculously looking AI behaviour of leaving units out in the
   field doing nothing when they could be defending its cities. Nevermind
   the happiness penalty!

  - Per

Attachment: defense1.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] AI defense fix, Per Inge Mathisen <=