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: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Ruleset Development Was: Development Strategies
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 4 Dec 2001 15:49:37 +0000 (GMT)

On Tue, 4 Dec 2001, Vasco Alexandre Da Silva Costa wrote:

> I also think that things like number of unit types, etc, shouldn't be
> capped with a small hardwired number.

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

> I see no reason why the server can't at bootup read the rulesets and
> dynamically set a MAX_UNITS variable or something.

...because then you'd have to replace

extern struct unit_type unit_types[U_LAST];

in unittype.h with a pointer, and mess with malloc and whatnot. This isn't 
exactly rocket science, but it's more fiddly and error-prone. Oh, and 
various stuff (worklists spring to mind) use U_LAST for other stuff too. A 
MAX_UNITS (well, game.num_unit_types) variable is indeed set by the server 
at bootup, though.

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"I need a big loan from the girl zone"



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