Re: (PR#10694) AI Builds Doomed Ferries and Passengers
"Per I. Mathisen" <per-0/[email protected]> Sat, 1 Jan 2005 15:59:13 -0800
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10694 > On Thu, 30 Dec 2004, Benedict Adamson wrote: > I've implemented the change to the AI bodyguard and city guard code I > outlined in early November. The attached patch is applicable to the CVS > development version of 2004-12-29. This isa large change, so it will of > course require review and amendment before being committed. I welcome > your comments. I like it a lot. Thank you for documenting it well. aiguard_find_charge() : Why not use movemap here to avoid a costly pf iteration over the map? If two turn radius is not enough, movemap can be extended. assault_conquest_chance() : Doesn't this fall into the trap I fell into previously, in that I did not account for loss of hitpoints during combat? Win chance is fine for one vs one combat, but for larger battles involving multiple units, you also want defenders that can hurt the enemy units, not just kill them. One patch of mine that only looked at win chance, made the AI figure that diplomats was the by far best defender, since its win chance was almost as good as the other available defenders at the time, but it was far cheaper. However, this ignores the fact that these other defenders were far more likely to reduce the attacker to low hp and thus save the city from repeat attacks. So at times, instead of counting loss in shields, we might want to count loss in hp. stack_cost(): all uses of this should use #define'd values unit_list_has(): yes, speclist.h is the place for it More comments and playtesting feedback later. - Per