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: Per I Mathisen <per@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: Artillery Patch
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Mon, 1 Jul 2002 22:53:34 +0200

On Sun, Jun 30, 2002 at 07:36:57PM +0200, Per I Mathisen wrote:
> On Sat, 29 Jun 2002, Raimar Falke wrote:
> > > A unit must be able to be member of several classes at once. A horseman
> > > must be both "Land" and "Horse". Bonuses/penalties should be cumulative.
> >
> > How does this differ from the classes created now by flags now?
> 
> It is clean and extensible.
> 
> For example, if we wanted to make a "Moat" improvement that, somehow, gave
> +100% defence vs Horses, there is no way to do this with the current class
> system & impr. gen., since there is no such class as "Horse".
> 
> Now, we could make it check both the flag strings and the ugly class
> structure previously mentioned, to see if the string exists in either, but
> that only makes the ugliness perfect. Furthermore, even then you must
> change the code in order to introduce new classes, which is bad news for
> modpacking.
> 
> My suggestion, on the other hand, removes the need for magic classes
> derived partly from movement and type partly from flags as in the existing
> class system - a system which isn't extensible and whose code is rather
> awkward.
> 
> > I'm also not sure if it is a good to allow a unit type in multiple
> > classes or if a unit type should have only one class.
> 
> Say you have twenty land-moving classes. Either they have one class each,
> and a gen. impr. table for "City Walls" long as a bad year to include them
> all, or you allow them all to be member of the "Land" class in addition to
> their other class, so that gen. impr./gen. units tables can remain short
> and to the point.

> Not a big deal either way, but it is, IMHO, very convenient to be able to
> denote that a unit is { "Land", "Horse" } or { "Sea", "Submarine"  } or {
> "Air", "Helicopter" } or even { "Land", "Horse", "Knightly", "Templar" }
> 
> It is also makes rulesets simpler to read and understand.

You know that you are descibing a tree here? Nice idea but it won't
solve all of our problems. Think about a ShipBuster
flag/group/call/whatever which you want to give to a torpedo plane and
to a sub. Either you have a simple tree without "symlinks" and write
something like:
 double attack for Air/Plane/Torpedo Plane
 double attack for Water/Underwater/Sub

Or you do aliasing:
 new class foo is Air/Plane/Torpedo Plane and Water/Underwater/Sub
 double attack for foo

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"


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