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]
To: badamson@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12781) Create AI guard API
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Apr 2005 13:10:02 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Benedict Adamson wrote:
> <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?

I think a guard should have multiple charges.  In an assault you want 
one guard per N assault units.  Like one musketeer for every two cannons 
or something.  Having more than one guard per tile isn't particularly 
helpful.

>> 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 :-)

Nah, not yet.

>>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?

Even if that's true, I don't think the code should make this assumption. 
  Just use separate variables.

-jason





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