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

[Freeciv-Dev] Re: Ruleset Development Was: Development Strategies

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andrew Sutton <ansutton@xxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Ruleset Development Was: Development Strategies
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 4 Dec 2001 17:21:06 +0000 (GMT)

On Tue, 4 Dec 2001, Andrew Sutton wrote:

> On Tuesday 04 December 2001 10:49 am, Ben Webb wrote:
> >     Unit types are capped at a maximum of U_LAST (which is 200 at the
> > moment, IIRC). There's no restriction on changing the number of unit types
> > in the rulesets, however, as long as you don't exceed this maximum (in
> > FreecivAC we support - well, kind of - SMAC-style "compound units" which
> > are generated during the game, so we know this to be possible).
> just curious. what's a compount unit?

        In Sid Meier's Alpha Centauri (SMAC) you can design your own units 
by combining a Chassis, Weapon, Armor, Reactor and one (or two, if you 
have discovered Neural Grafting, IIRC) "special" abilities. For example, a 
basic "Scout Patrol" unit combines the "Infantry" chassis with "Hand 
Weapons", "No Armor" and "Fission Plant", and has no special abilities, 
while a "Colony Pod" is the same, but replaces the scout's weapon with a 
colony module. We "AC people" call these "compound" units, and implement 
them by essentially just summing together the attack/defense/moverate 
(etc.) of the various component unit types to give the final unit. 
Governments can be customised in exactly the same way, by combining 
"Economics", "Future Society", "Politics" and "Values", so you could have 
a Planned Cybernetic Fundamendalist Power government if you so wanted.

        It's a nasty hack to the Freeciv code, but it (almost) works. 
_Maybe_ it would benefit from a more modular Freeciv2 rewrite, but I'm a 
diehard C programmer, so couldn't possibly comment on the C++/Java/etc 
debate!

> an additional consideration would be value binding for constant identifiers. 
> if you're going to dynamically register units to determine the max type, then 
> you'd probably want to dynamically set the identifier value of those unit 
> types.

        I'm not sure if you really need to do that. When building new 
units, you'd need to iterate through all unit types anyway (to present the 
user with the choice) and all unit instances contain a unit type pointer 
anyway. Looks pretty neat though. ;)

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"He [Professor Moriarty] is the Napoleon of crime."
        - 'The Final Problem', Sir Arthur Conan Doyle



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