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

[Freeciv-Dev] Re: Ruleset Development - improvements

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Cc: Josh Cogliati <jjc@xxxxxxxxxxxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Ruleset Development - improvements
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Tue, 4 Dec 2001 16:20:49 +0100

Dear diary, on Tue, Dec 04, 2001 at 02:01:57PM CET, I got a letter,
where Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx> told me, that...
>       Oh come on - we're only human. We haven't got rid of 
> OLD_IMPR_TYPE_ENUM because (as you point out earlier) its use is implicit 
> all through the Freeciv code. In particular, we haven't touched the AI, 
> which uses this extensively. If you're not too bothered about the AI not 
> understanding your new customised buildings, however, the rest of the code 
> should (largely) work; we don't actually rely on OLD_IMPR_TYPE_ENUM for 
> much of the behaviour now.
> 
>       Here's a quick summary of the situation with regard to handling 
> of buildings.ruleset (as I read the situation):-
> 
>       Freeciv-1.12 lets you change the building names (although not 
> everywhere - e.g. "needs an Aqueduct to grow further" is still hardcoded, 
> I believe), the tech requirements, build cost, and upkeep. I'm not sure if 
> the sabotage field is used, but I _think_ it isn't.
pasky@machine:~/src/freeciv/aiciv/freeciv/ai$ grep -r -- "->sabotage" ../server/
../server/ruleset.c:    b->sabotage = secfile_lookup_int(file, "%s.sabotage", 
sec[i]);
../server/ruleset.c:    packet.sabotage = b->sabotage;
> 
>       Current Freeciv CVS does this, plus it incorporates a small part 
> of the AC impr-gen patch, which understands the bldg_req, terr_gate and 
> spec_gate fields (e.g. you can specify "coastal" improvements using 
> "terr_gate=Ocean", and the unusual terrain requirements of the Hydro Plant 
> are now read from the rulesets).
Shouldn't gates for Hoover Dam be the same, BTW?
> 
>       In addition to all of the above, the AC impr-gen patch also does 
> the following:-
> 
> - Understands the equiv_range, equiv_dupl and equiv_repl fields (for 
>   setting behaviour like "Sun Tzu's replaces a Barracks in every city 
>   owned by this civ")
> - Removes the "fixed number of buildings" limitation
> - Understands most of the "effect" parameters - e.g. the following should 
>   be taken directly from the rulesets, and not hardcoded:
>   - Shield/Food/Trade bonuses for city tiles (e.g. effect of Supermarket)
>   - City tax/luxury/science/production bonuses (e.g. effect of Bank)
>   - Pollution modifiers (e.g. effect of Mass Transit)
>   - Content/happy modifiers (e.g. Bach)
>   - Proper selling of "coastal" improvements when city becomes landlocked
>   - Generalisation of capital city and airlift effects
>   - Generalisation of all "veteran making" effects (e.g. Barracks)
> 
>       With this, most of the Alpha Centauri buildings work in 
> FreecivAC. (Some Wonders are still non-functional though.)
That sounds great. Reasons why it wasn't accepted? Raimar? If it's just lack
of review, can you please re-send the patches? (it would be nice to have them
splitted into pieces).
> 
> We still don't do (among other things):-
> 

> - AI support; it should really consider building effects, rather than 
>   considering building types directly
That's very nice to say, but much harder to implement. Basically, it's pretty
hard to tell it universally what granary does, what leonardo workshop does
and what magellan's does. Not mentioning city walls or even palace.
You need either a heap of capabilities similiar to the ones units have, or some
scripting language embedded into the ruleset, and you should be able to modify
desire of particular building that way.

> - Client and server have different ideas of the world (e.g. islands can be 
>   different in the client, due to unexplored territory) and this can give 
>   the client incorrect effects
> - Handling of population size limits (e.g. Aqueduct, Sewer System)
> - Code optimisation; many algorithms are still O(N**2) in number of 
>   cities, and we iterate over effects too frequently for my liking
Anyway, this isn't something so fatal IMHO and can be adjusted on the fly.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
  "A common mistake that people make, when trying to design
   something completely foolproof is to underestimate the
   ingenuity of complete fools."
     -- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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