Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] rulesets, part1
Home

Re: [Freeciv-Dev] rulesets, part1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] rulesets, part1
From: Lindqvist Marko <caz@xxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jan 1999 09:07:02 +0200 (EET)

On Tue, 26 Jan 1999, David Pfitzner wrote:

> > A much better (but, I must admit, somewhat harder)
> > approach would be to add two new variables to the wonder
> > struct (and the ruleset file), one which controls the nature
> > of the "effects" of the wonder, and another which controls
> > the implementation of this effect (how many become happy,
> > how many content, if it does this or that etc).
> 
> Yeah, I think I initially planned something like that, but
> then scaled back to something easier to implement!
> 

 You can always make it better later. Probably different variants
should have different scale for future compatibility. Currently
all variants can have values beginning from 0. Instead we should
reserve values 0 and 1 for barracks only, values 2 and 3 for
city walls only (work like values 0 and 1 currently). So it
would later be possible to detect effects building is giving
from variants. Would it be possible to implement variables this way?

> One problem with making things too general is that in 
> some cases it becomes harder for the server and/or AI to 
> do things easily or efficiently.  Eg, currently when the 
> server comes to adjust the granary, it knows to look at 
> B_GRANARY, and possibly B_PYRAMIDS (and possibly variants)
> (and possibly B_AQUEDUCT and B_SEWER).
> If the Granary "effect" was generalized, the server would 
> have to look through all the buildings to see if there was 
> a relevant effect.

 How about making array of pointers to buildings having granary -like
effect at startup and later check only buildings in that array? Same
kind of arrays would be created for all different effects.

 Aqueducts and sewers could be handled with different array too.
It would contain pointers to buildings required to city grow bigger.
Pointers would be places so that their index in the array reflects
maximum size of the city without this building. So array would contain
mainly zeroes but (with present rules) 8:th element (index 7) would be
pointer to aqueduct and 12:th element pointer to sewers. When city tries
to grow, we would just check that it have all the buildings to which
there's pointer at the arrays beginning upto index 'old city size -1'.
That would of course mean that aqueductsize have to be always different
than sewersize, but why would anybody want them to be the same?

> something better.  Eg, Marko Lindqvist (Caz) had some 
> good ideas about parameterising Improvement "requirements"
> (Library->University etc) and Wonder "ranges".
> 

 Btw, I just realised that the original patch I mailed to this list was
buggy. It would not allow you to build anything which requires no
previous buildings.
 At common/city.c new line should be 
if( improvement_types[id].required_building != B_NONE && !
city_got_building( pcity,improvement_types[id].required_building ))

 ( This is against my original patch using B_NONE. B_LAST should be used
instead of it. )

 I have also wonder ranges implementet to my own freeciv compilation,
but I don't think it's worth digging patch out of it. It wouldn't
work with rulesets anyway.

> -- David
> 

 Caz



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