Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: Advice re making building respect effects in rulesets
Home

[Freeciv-Dev] Re: Advice re making building respect effects in rulesets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Thomas M. Payerle" <payerle@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Advice re making building respect effects in rulesets
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Dec 2002 14:14:46 +0000

On Wed, Dec 04, 2002 at 10:10:05PM -0500, Thomas M. Payerle wrote:
> Over the Thanksgiving holidays, I have been hacking the code to actually try
> to make it honor the effects field of the rulesets, instead of the hard-wired
> by building type that exists currently.  Have had some success, migrating code
> from one framework to the other piecemeal, and will share with the list when
> approaching something usable.

This has been done already. See the impr-gen patches at
http://freecivac.sf.net/. I suggest you work with them, rather than
duplicating what I've done already.

> 1) What is the intended meaning of EFR_BUILDING range?  I did not notice any
> examples of it in use.

See, for example, the Spy_Resistant effect.

> 2) Can someone explain the reason for having both EFT_CAPITAL_EXISTS and
> EFT_CAPITAL_CITY?

No idea. The distinction is removed in impr-gen.

> 3) It looks like wonders which should survive destruction of their city
> get attached to a city id of -1.   This would require that all corresponding
> effects either be EFT_NONE (?) or EFT_WORLD, as it is no longer able to be
> identified with either a player or a continent.  Is this a reasonable 
> limitation?

The current impr-gen code moves destroyed wonders into a player list,
and if that player is killed, into a global list, so such effects can
have either Player or World range.

> 4) Anyone think that a range EFR_ISLAND_ALL effecting _all_ cities on a given
> island, irregardless of owner might be useful?

See the archives for lots of discussion about this.

> How about EFR_DISTANCE and/or EFR_DISTANCE_PLAYER, with a distance
> parameter, affecting all cities (possibly owned by same player) within
> specified distance of the city with improvement

This would be rather hard to code efficiently.

> 5) I am currently hitting problems deciding about additivity and redundancy
> of effects.  I am currently leaning towards looking at a list of all effects
> of a given type affecting the city in question, and then looking if the 
> improvements causing the effect are listed as obsoleting/making redundant one
> of the improvements causing a similar effect

Eurgh. Look to see how the impr-gen code does it. It sounds rather more
simple and efficient than the scheme you describe. Most effects come in
an additive and a multiplicative form. The additive effects are
accumulated before the multiplicative ones.

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"Mars is essentially in the same orbit... Mars is somewhat the same 
distance from the Sun, which is very important. We have seen pictures 
where there are canals, we believe, and water. If there is water, that 
means there is oxygen. If oxygen, that means we can breathe."
        - Vice President Dan Quayle, 8/11/89


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