[Freeciv-Dev] Re: (PR#2521) general effects framework
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, Jan 13, 2003 at 03:46:59AM -0800, Ben Webb via RT wrote:
>
> > > I don't like the ranges argument at all. There are very few occasions
> > > (two or three, from memory, in FreecivAC) when you wish to exclude
> > > ranges, and the choice of ranges is largely determined by the pplayer,
> > > pcity and id arguments anyway.
> > Well, I don't think that you should have to get down to nuts and bolts
> > simply to take care of those few cases.
>
> I'm not talking about nuts and bolts; I'm talking about your interface
> being consistent. What's to stop a user feeding in a NULL city pointer
> and then saying he wants City-range effects? You need to add error
> checking to the function to enforce this. impr-gen just assumes that if
> you put in a NULL city pointer you don't want City-range effects.
with a city of NULL, then we'll iterate over all cities at City-range.
> How does this iterator function deal with unit effects, by the way?
in version 1 and the upcoming version 2, we don't. But if we demand that
all unit effects are Local, I don't think it'll be much of a problem.
> Speed cost? I'd imagine it'd be faster if anything. (By bitfield, I mean
> that defined in the C language - e.g. int active:1; int pending:1 etc.)
I'll do this.
> > > a) FreecivAC makes such a distinction between Player-range effects that
> > > affect units in cities, and similar effects that also affect units in
> > > the field, and b) the impr-gen iterator code is generalised in just this
> > > way.)
> > Please give me some examples of these AC effects and I'll see what's the
> > issue.
>
> See the documentation of the ".outside" member in
> data/default/buildings.ruleset in FreecivAC. They're not AC-specific
> effects, but more a consequence of the improvement-centric way in which
> effects were originally defined. For example, the Unit_Defend effect at
> Player range actually only affects units in all of a player's cities.
> You could imagine a similar Player-range effect that affects units in
> the field as well (e.g. a tech that improves armour). A similar
> distinction is made by AC for city Science or Tax bonuses - does a
> Player-range Science bonus boost the Science output of each city (like
> the Civ SETI Program) or the total Science output of your Civ (as the AC
> government science bonuses do) ?
I can well imagine such an effect. Why not an additional effect if that's
what you want? that would be considerably easier than special casing a
single effect. Besides, that's going to be useless on the majority of
effects.
for the bonuses, can you give me an example where the two results will
be different?
> No, I mean the effect of a destroyed Apollo. That won't be added in when
> you load the savegame, because the improvement itself is never added.
> (See FreecivAC for handling of Player- and World- range destroyed
> effects.)
oh, yes. I've given some thought to this problem. Obviously we do not want
to store effects in the savegame, so I'm thinking that the best way to do
this is to add another Impr_Status I_DESTROYED or something similar, so
that both the client and server know that the improvement's effects (that
survive) should be added, but the building should not. This will also care
of unique buildings that can't be rebuilt.
|
|