Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2002:
[freeciv-ai] bodyguard cleanup#3

[freeciv-ai] bodyguard cleanup#3

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] bodyguard cleanup#3
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 2 Sep 2002 01:54:42 +0000 (GMT)

This introduces a lot of changes:
 - moves some functions only used in advmilitary over from aicity
 - creates a separate unit selection function for bodyguards, since they
   have special needs and limitations
 - adds create_unit_virtual() and destroy_unit_virtual(), lifted
   shamelessly from Greg's flying ai patch. much cleaner code now.
 - military_advisor_choose_build() mostly cleaned up
 - we now always build Port before building ships, _if_ we can build it
 - ** we build and use bodyguards for transports! ** this code leaves much
   to be desired, but we try to snatch up a bodyguard (cruiser or aegis)
   on our way to deliver military guys, and then release it and call its
   attack function when we've dropped them off, making it try to whack
   the target city a bit first. this works very well when it happens, though,
   not often, as the meeting of charge and guard is rather hard. need to do
   this better, and also consider using all kinds of city-whacking ships to
   bodyguard us and then whack our target after we've unloaded. this
   should make the ai appear a bit more "coordinated". ferry and its guard
   should probably be acquired at the same time and head to the same pick
   up point, instead of ferry acquiring a guard after it has picked
   someone up. but this is hard and need to clean up ferry code first.
 - general cleanup of bodyguarding code. now it should work, period.
 - removed the stupid "set all units to AIUNIT_IDLE in the
   beginning of the turn" piece of crap code. the AI seems to cope well
   but expect bugs from this one (this also done in diplomats patch).
 - you will no longer see mech inf bodyguarding riflemen, or mech inf
   bodyguarding mech inf. now you will see the ai building howitzers and
   bodyguarding them with mech inf! yay.

Please review & comment. I consider this the final bodyguard cleanup, and
intend to have a go at the ferryboat code next.


"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra

Attachment: bodyguardclean3.diff
Description: Text document

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] bodyguard cleanup#3, Per I. Mathisen <=