Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2002:
[Freeciv-Dev] Re: RFC: Artillery Patch
Home

[Freeciv-Dev] Re: RFC: Artillery Patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: Artillery Patch
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 2 Jul 2002 18:26:00 +0100

Whoa... look what happens when I go on holiday... ;)

On Mon, Jul 01, 2002 at 11:42:48PM +0200, Per I Mathisen wrote:
> No, the idea is, for each unit with special attack mods against the class
> "ship", we add a line in the ruleset about this. Not the other way around.

This is the approach I'm going for, anyway.

> BTW I just noticed Ben had a unit classes patch already done at
> freecivac.sf.net.

        The patch isn't finished yet, but it does start to extend impr. gen.
to governments, nations and unittypes. For example, in SMAC different
government types and the different factions (nations in Freeciv
parlance) have science bonuses. Rather than implementing a completely
separate method for applying these, it makes sense (to me at least) to
reuse the Science_Bonus impr. gen. effects.

        The patch as it is right now doesn't actually "work" as such; in
fact, it just breaks a lot of existing impr-gen code. ;) If I'd been
around last week I would have mentioned it, since it seems to do pretty
much what Per has been suggesting. It will become a "gen. unit." patch
in the not-too-distant future, I promise. Just ask me after next
weekend. ;)

        Basically, impr_gen effects currently have an aff_unit field. Each
effect can affect units in one "class", which covers the various movetypes
(air/heli/land/sea) and special flags (nuclear/missile). Any unit can only
be in one class - i.e. nuclear, heli and missile units do not count as "air"
units. I am extending this code so that aff_unit classes encompass the
hard-coded unit movetype and flags fields, plus additional user-defined
classes.

The relevant section of my current units.ruleset reads as

[classes]
names = "Horse", "AEGIS"

i.e. "Horse" and "AEGIS" are user-defined classes, which can be
specified for any unittype.

"Horse" is just a flag for "Pikemen" units to act against, and
all "AEGIS" does is mess with the unit defence against air units. Both
of these can be handled with impr-gen effects without requiring the
flags to be hard coded.

        My current intention is to allow unittypes to belong to multiple
classes, with the existing exception about nuclear/missile units, while
aff_unit can act only on one class. A more complex syntax could be
imagined whereby aff_unit could cover multiple classes, complete with
"not" operators, etc. etc. but I think that a) this is needlessly
complex for current rulesets and b) would be a better application for a
scripting language anyway.

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"And I hate and I hate and I hate and I hate elevator music"


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