Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2002:
[freeciv-ai] coreai: assess_danger()

[freeciv-ai] coreai: assess_danger()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] coreai: assess_danger()
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 25 Aug 2002 12:30:16 +0000 (GMT)

This is big one.
 - Much rewriting. Almost every line of code touched in some way, since I
unnested several ifs by reversing their condition and doing a continue; on
the loop instead. Much, much cleaner.
 - Fixed case where less dangerous situation would result in lower want
for city walls than a slightly more dangerous situation (danger > defense,
for high values of each, would give less want than the default want in
danger situation). Now gives AI slightly more wall want in some cases.
 - Wrapped up the convoluted military building want algorithms into a more
consise form, and put it into a separate function. Use the more
sophisticated wall algorithm also for coastal, sam and sdi.
 - Did not follow Ross' code all the way in giving all cities a default
danger. This I think is fundamentally wrong, and I will change this later
to use the cached information created by ai_eval_* to only give cities
situated dangerously geographically default danger.
 - Left the "will this enemy city complete a dangerous unit next turn"
cheesiness in the code. I wanted to remove it but had second thoughts.


Attachment: coreai2.diff
Description: Text document

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] coreai: assess_danger(), Per I. Mathisen <=