Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12781) Create AI guard API
Home

[Freeciv-Dev] Re: (PR#12781) Create AI guard API

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12781) Create AI guard API
From: "Benedict Adamson" <badamson@xxxxxxxxxxx>
Date: Fri, 15 Apr 2005 12:22:01 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12781 >

Jason Short wrote:
...
> Is it correct that a unit may only have one bodyguard but a city may 
> have many?

It is an implicit assumption of most of the bodyguard code. And multiple 
unit-bodyguards are useless for rule-sets with killstack=1: that is, all 
rule-sets for which the AI has been intended so far.

Perhaps we should allow units to have multiple guards, to provide better 
behaviour for killstack=0 rule-sets?

>  So a similar function for a city wouldn't be useful - nor is 
> there any quick way to find out what units are guarding a city...

We could add a list of guards to the city struct. I did that for my big 
movemap-using guards patch. But it is unnecessary for the existing code. 
However, having each city (and unit?) have a list of its guard units 
might be useful in the future. Is it worthwhile for me to do that? 
Perhaps for version 2 of this API :-)

...
> Wait a minute.  Units and cities can have the same IDs right (even if 
> it's not true it's not a safe assumption)?

They can? The assumption that they can not is made in several places in 
the current bodyguard code. Can someone confirm whether the IDs are 
distinct?





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