Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: patch: Modified can_build_improvment()
Home

[Freeciv-Dev] Re: patch: Modified can_build_improvment()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ben Webb" <ben@xxxxxxxxxxxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: patch: Modified can_build_improvment()
From: sebauer@xxxxxxxxxxx (Sebastian Bauer)
Date: Mon, 20 Aug 2001 14:20:52 +0200

Hi!

> See my impr-gen.patch at
> http://bellatrix.pcl.ox.ac.uk/~stewart/fcindex.html for a more complete
> implementation of generalised improvements. The trouble with impr-gen is
> that it touches a lot of code - hard-coded assumptions about building
> types are everywhere in the Freeciv code, particularly in the AI - which I
> can only assume explains why impr-gen has not already been implemented in
> "proper" Freeciv.

I know. That's why I wanted to start with this small function, to restart
the impr-gen. I didn't know that there are working other people on this
already.

> > May I remove equiv_dupl?
>
> IMHO, no. For example, the Barracks has
> equiv_dupl      = "Barracks II", "Barracks III"
> equiv_repl      = "Sun Tzu's War Academy"
>
> i.e. you're not allowed to have both a Barracks and a Barracks
> II, but if you have the War Academy you can still build a Barracks - it
> just won't have any effect. (Personally I think the two names are
> confusing, but I do see the need for both.)

Hmm...confusing. But then the description which is inside the
buildings.ruleset is not correct, if I haven't misunderstood this. The
description of equiv_dupl is:
"list of buildings that duplicate this building if this city is within that
building's range (may still build this, but will have no effect)". IMO this
is the opposite what you say. So you could (according to the description)
build "Barracks II" and "Barracks III", if there wasn't the obsolette entry.
Another problem here are the differnt power plants:

equiv_dupl = "Power Plant", "Nuclear Plant", "Solar Plant"
equiv_repl = "Hoover Dam"

If I haven't tested it now and I usally don't play Freeciv but if I look
inside the code you can only build one power plant type. In this case it is
the same like you said in the example. But you also cannot build any power
plant if you have the "Hoover Dam". Besides you also cannot build (again
inside the current code) a "Barracks" if you have the "Sun Tzu's War
Academy". Or all the other wonder replacemets (Pyramids,...). Of course you
still could have "Barracks" if you have the "Sun Tzu's War Academy" but you
cannot but them any longer once you have the "Sun Tzu's War Academy" (and
its not obsolette)

All in all I still don't see the sense in these two entries. Equiv_repl is
IMO enough.

> > The current version doesn't implement neighter equiv_dupl nor
> > equiv_repl because of this. I haven't modified yet the functions
> > wonder_replacement() so this part is still hardcoded.
> This is rather more difficult, as you have to check for buildings
> being in the range of others. (Some combinations are actually impossible
> to deal with, since the client doesn't have complete information about all
> cities.) Most of these functions are, however, implemented by my patch - I
> suggest you take a look at it and consider working with the FreecivAC guys
> and myself on this.

Yes, great I will have a look on this. I suggest to do this really step by
step rather than a big patch, there are also lots of places where it is not
so hard to implement the things like the can_build_improvent() or some
functions in cityturn.c. This should be done first because it also doesn't
break something.

bye,
Sebastian Bauer



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