home *** CD-ROM | disk | FTP | other *** search
- ----------------------------------------------------------------------
- Freeciv Rulesets
- ----------------------------------------------------------------------
- (Originally by David Pfitzner, dwp@mso.anu.edu.au)
-
- Quickstart:
- -----------
- Rulesets allow modifiable sets of data for units, advances, terrain,
- improvements, wonders, nations, cities and governments, without
- requiring recompilation, in a way which is consistent across a
- network and through savegames. (In the future there could be other
- categories of rulesets.)
-
- - To play Freeciv normally: don't do anything special; the new
- features all have defaults which give the standard Freeciv
- behaviour.
-
- - To play a game with rules more like Civ1, start the server with:
- ./ser -r data/civ1.serv
- (and any other command-line arguments you normally use; depending on
- how you have Freeciv installed you may have to give the installed
- data directory path instead of "data").
-
- Start the client normally. The client must be network-compatible
- (usually meaning the same or similar version) but otherwise nothing
- special is needed. (However some third-party rulesets may
- potentially require special graphics to work properly, in which case
- the client should have those graphics available and be started with
- an appropriate '--tiles' argument.)
-
- As well as a Civ1 style as above, Freeciv now has a Civ2 style
- similary, although currently it is almost identical to standard
- Freeciv rules.
-
- Note that the Freeciv AI might not play as well with rules other
- than standard Freeciv. (See notes below.)
-
- The rest of this file contains:
-
- - More detailed information on creating and using custom/mixed
- rulesets.
-
- - Information on implementation, and notes for further development.
-
- ----------------------------------------------------------------------
- Using and modifying rulesets:
- -----------------------------
-
- Rulesets are specified using new server options. The command above
- of "./ser -r data/civ1.serv" just reads a file which sets these
- options (as well as a few of the standard server options).
- The new server options are:
-
- techs, governments, units,
- buildings, terrain, nations, cities.
-
- They are special server options in that they take string values, but
- otherwise the behave like normal server options. Eg, try the server
- command "explain techs".
-
- For each of these options, the value of the option specifies a
- subdirectory of the Freeciv data directory, containing a file
- name techs.ruleset, units.ruleset, buildings.ruleset, etc.
-
- Eg, the commands:
-
- set techs default
- set governments default
- set units civ1
- set buildings custom
- set terrain civ2
- set nations default
- set cities default
-
- would specify the files:
-
- data/default/techs.ruleset
- data/default/governments.ruleset
- data/civ1/units.ruleset
- data/custom/buildings.ruleset
- data/civ2/terrain.ruleset
- data/default/nations.ruleset
- data/default/cities.ruleset
-
- (This is just an example, and may not give very sensible rules; the
- directory data/custom and the file data/custom/buildings.ruleset do
- not exist in standard Freeciv.)
-
- The ruleset files in the data directory are user-editable, so you can
- modify them to create modified or custom rulesets (without having to
- recompile Freeciv). It is suggested that you _don't_ edit the
- existing files in the "default", "classic", "civ1" and "civ2"
- directories, but rather copy them to another directory and edit the
- copies. This is so that its clear when you are using modified rules
- and not the standard ones.
-
- The format used in the ruleset files should be fairly
- self-explanatory. A few points:
-
- - The files are not all independent, since eg, units depend on
- advances specified in the techs file.
-
- - Wonders and city improvements have a new field, "variant". This
- allows limited changes to the effects of specific wonders and
- improvements, where such changes have been implemented. See the
- "TODO Variants" section below for which variant effects which have
- been implemented so far.
-
- - Units have a new field, "roles", which is like "flags", but
- determines which units are used in various circumstances of the
- game (rather than intrinsic properties of the unit).
- See comments in common/unit.h
-
- - The [units_adjust] section of the units file deserves some
- explanation. It contains the entries:
-
- max_hitpoints, max_firepower, firepower_factor.
-
- The first two entries (unless zero) override the hitpoints and
- firepower entries for individual units, as a convenience.
- The value of firepower_factor is used when combat is resolved:
- All combat firepower values are multiplied by firepower_factor,
- which means that the effective hitpoints of any unit is really
- (hitpoints/firepower_factor).
- Actually, it is these effective hitpoints which are report to the
- client for all hitpoint values.
- (This complicated setup is so that the AI calculations don't
- blow up when using Civ1 rulesets.)
-
- Properties of units and advances are now fairly well generalised.
- Properties of buildings are still rather inflexible.
-
- ----------------------------------------------------------------------
- The civstyle option:
- --------------------
-
- The server option civstyle still exists, but, as before, it doesn't
- actually do very much. In the server, 'explain civstyle' now gives
- details of what exactly is affected. Rulesets allows Civ1 style rules
- (to some approximation) in a more flexible way than a single server
- option. Currently the civstyle option is used for minor Civ1/Civ2
- differences which are not covered by rulesets, but it may go away in
- future.
-
- ----------------------------------------------------------------------
- The AI:
- -------
-
- An important caveat regarding rulesets is that while rulesets allow
- considerable flexibility, the AI has been designed and tested using
- "standard Freeciv" (effectively Civ2) rules. So the AI may not do as
- well with modified rules.
-
- Some changes to the AI have been made to try to take some of the
- ruleset changes into account, and the combat calculations have been
- fudged to try to avoid core dumps, but in general you should not
- expect the AI to work as well with non-default options (where Civ1 is
- definitely included in "non-default").
-
- Examples of problems which have not been fixed:
- - Units not having hitpoints in Civ1 can make a big difference to
- appropriate combat strategies.
- - City walls are sufficiently different (increased build cost, and
- upkeep; and effect vs sea) to require different handling?
- - Without the Harbour and Offshore Platform improvements, cities with
- many ocean squares are much more limited in Civ1.
- - Wonders which only work on a single continent are not given special
- consideration by the AI.
-
- Hopefully this situation can be improved in the future, but the more
- flexible the rules, the harder to write a good AI...
-
- ----------------------------------------------------------------------
- Implementation details:
- -----------------------
-
- This section and following section will be mainly of interested to
- developers who are familiar with the Freeciv source code.
-
- Rulesets are mainly implemented in the server. The server reads the
- files, and then sends information to the clients. Mostly rulesets
- are used to fill in the basic data tables on units etc, but in some
- cases some extra information is required.
-
- For units and advances, all information regarding each unit or advance
- is now captured in the data tables, and these are now "fully
- customizable", with the old enumeration types completely removed. For
- improvements and wonders, each one has a largely unique effect, so the
- effects themselves are still hardwired in the code. The "variant"
- field now allows some flexibility, though the effects themselves must
- still be hard-coded. There are some plans to improve this situation.
-
- ----------------------------------------------------------------------
- TODO:
- -----
-
- - More improvement and wonder variants for Civ1 (see next section).
- - Other alternative (non-Civ1) variants? (If desired.)
- - Better: Scrap variants completely and do something more general...
-
- - Fix up AI dynamic government choice code.
- - Work on making the AI handle non-default cases better.
- - Could have other information to help the AI?
- Eg, scores for units/techs/buildings, to help the AI know which
- ones to prefer?
-
- - Rulesets for: time progression, ...?
-
- ----------------------------------------------------------------------
- TODO Variants:
- --------------
-
- First, those variants which have been implemented:
- (Note Variant=0 should always be "standard Freeciv" effect.)
-
- Barracks: Variant=0: just works for ground units (Civ2)
- Variant=1: works also for air and sea units (Civ1)
- Barracks II, Barracks III, Sun Tzu:
- These use the same variant value and effect as
- Barracks.
- City Walls: Variant=0: only applies against land and heli units
- Variant=1: applies against sea units too
- Police Station: This uses the same variant value and effect as
- Women's Suffrage (see below).
-
- Pyramids: Variant=0: counts as Granary in every city (Civ2)
- Variant=1: allows all government types and there is
- no transition anarchy (Civ1)
- United Nations: Variant=0: units regain extra hp per turn (Freeciv)
- Variant=1: allows all government types and there is
- no transition anarchy (Civ1) (see note(*))
- Hoover Dam: Variant=0: works on all cities owned
- Variant=1: only works for cities on the same
- continent as where the wonder is built
- J.S. Bach: Variant=0: works on all cities owned
- Variant=1: only works for cities on the same
- continent as where the wonder is built
- Women's Suff.: Variant=0: -1 unit-unhappy per City (-2 under
- Democracy) (Freeciv)
- Variant=1: -1 unit-unhappy per Unit (Civ1)
- Magellan's Exp.: Variant=0: gives sea units 2 extra move points
- Variant=1: gives sea units only 1 extra move point
- Great Wall: Uses same variant and effect as City Walls.
- Leo's Workshop: Variant=0: Upgrades one obsolete unit per game turn.
- Variant=1: Upgrades all obsolete units each turn.
-
- Other differences between Civ1 and Civ2/Freeciv which have not been
- implemented as variants:
-
- Copernicus' Obs.: Freeciv: science output +50% in a city
- Civ1: doubles knowledge production in city, after
- all other effects.
- Isaac Newton's: Freeciv: science output +100% in a city
- Civ1: "increases effects of Libraries and
- Universities" - by how much??
- Michelangelo's: Freeciv: same as a Cathedral in every city
- Civ1: "increases effect of cathedrals" - by
- how much??
-
- There are other more minor Civ1/Civ2/Freeciv differences, which
- could be handled using variants, for:
- Courthouse
- Cure For Cancer
- Hanging Gardens
- Lighthouse
-
- Notes:
-
- Aqueduct and Sewer System:
- The maximum sizes for cities without these improvements is handled
- separately, without using variants. This leaves variants available
- if some other effects are desired.
-
- Colosseum, Cathedral, Temple:
- Note that the technology effects on the effectiveness of these
- buildings are not handled by variants, but by specially noting the
- techs; see game.rtech fields cathedral_plus, cathedral_minus,
- colosseum_plus, and temple_plus. (Also applies to Michelangelo's.)
-
- (*) United Nations:
- I'm not sure what to do here: the diplomatic effect of Civ1,Civ2
- isn't appropriate for multiplayer Freeciv, and the hp effect of
- Freeciv isn't appropriate for Civ1 (no hitpoints). The govchange
- effect seems reasonable -- note there is no Statue of Liberty in
- Civ1, and Pyramids, which has the same effect in Civ1, becomes
- obsolete. Alternatively a Suffrage-like effect would seem sensible:
- your population is more willing to go to war if it has the sanction
- of the United Nations!
-
- ----------------------------------------------------------------------
-