Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability a
Home

[Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Cc: gregor@xxxxxxxxxxxxx, Gregor Zeitlinger <zeitling@xxxxxxxxxxxxxxxxxxxxxxx>, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development]
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Sun, 2 Dec 2001 12:02:26 -0500

On Saturday 01 December 2001 07:39 pm, Daniel L Speyer wrote:
> Remember that java can be compiled to native object code (on GNU/Linux, at
> least, using gjc).  I don't know how its performance is that way.
>
> If we look at that sort of massive changes, though, I think we should push
> toward customizability.  It seems to me that units' special powers in
> config files are a pretty ugly setup.  Basically, every special power
> (paradrop, build fortresses...) is written in c, then specified to a unit
> in config.  This makes it impossible for ruleset designers to add or edit
> powers.
>
> I'd like to see a design with the most core/time-critical code in C/C++
> but the bulk of it in freeciv-definition language -- sort of like how
> emacs and mathematica work.

i gotta take a break from the language talk :)

i think you're right - to some degree. clearly there's got to be a separation 
of declaration and instantiation. the declaration defines the capabilities 
and the instantiation defines how they're used in a game. i've been mulling 
this over for some time, and came to this solution:

declaration is performed in modules. for example, unit capabilities are 
written as code and have a couple of associated parameters. each capability 
is type static - that is to say that all units of a certain type have that 
capability (e.g. setters build cities). parameters come in two flavors: type 
static (like before) and instance value. type static parameters define a 
parameter of a capability that is general to all units of a certain type. 
instance value parameters are specific to the units themselves. a good 
example of this is movement. all armor units can move 3 tiles. each unit 
keeps track of how many moves it has left. another good example is ranged 
flight and the dependancy on fuel.

this basically means that the data of capabilities is completely separated 
from the capability itself, meaning that it is just an interface.

there's an option for extending this architecture to allow individual units 
to acquire capabilties (instance capability?). this would provide an 
interesting hook for extension. however, as far as i know, nothing in the civ 
games does this, so i didn't spend time figuring it out.

instantiation comes in the form of a ruleset. a ruleset applies capabilities 
and parameters to units. this is actually pretty similar to freeciv1, but 
generalized.

for a ruleset to include new capabilities, there will have to be supporting 
code. i know, it's not much fun, but that's currently the way it is.

an alternative would be to define a separate language that allowed the 
specification of the extensions and would compile directly into code. 
however, capabilties are pretty unique and it would probably be pretty hard 
to generalize. if you think you can figure out how to do it though, i won't 
complain ;)

andy


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