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: Sebastian Bauer <sebauer@xxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: patch: Modified can_build_improvment()
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 10:41:00 +0100 (BST)

On 18 Aug 2001, Sebastian Bauer wrote:

> This patch changes can_build_improvement() and similiar functions to
> use the definitions from the buildings.ruleset instead to hardcode this.

<snip>

> I don't really understand the differnt between equiv_dupl and
> equiv_repl. The text in buildings.ruleset says that you may still build
> the building even if there are the buildings listed in equiv_dupl within
> the range. But this is only used for the Barracks and for the Power
> Plant types in current rules.

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.

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

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

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"Power tends to corrupt and absolute power corrupts absolutely."
        - Lord Acton



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