Freeciv
Register
Advertisement
Freeciv-modpack

Modpack UI icon

This page partially describes the contents of a ruleset collection. It is intended as developer reference and for people wanting to create/compile alternative rulesets for Freeciv.

The anatomy of a game ruleset file[]

/data/classic/game.ruleset This description follows v.2.6 specifications

Common ruleset header[]

[ruledit]
; Which file to read description in from
description_file = "myruleset/README.myruleset"

[about]
; Ruleset name
name = _("My ruleset")

; There`s no separate versioning in rulesets part of main freeciv distribution
;version = ""

; Summary of the ruleset (translated for standard ones)
; /* TRANS: In the client, this is displayed alongside the contents of
;    README.mytileset, which are not localized. */
summary = _("\
You are playing Freeciv with My Cool ruleset based on civ2civ3 rules:\
\n\n\
...\
")

; Detailed description
; When updating this, update also desciption_file in [ruledit] section to match
description = *myruleset/README.myruleset*

Client preferred settings[]

Three optional fields are not used in default game.ruleset

[tileset]
prefered="fantasy"

[soundset]
prefered="freesounds"

[musicset]
prefered="mqtx"

tileset.prefered will instruct clients to use the given tileset with these rulesets. Currently only gtk and qt clients support this, other clients ignore it. Use this field only if your ruleset really requires a tileset with some special tags. If only standard tags are used, user should be free to choose any of the tilesets providing them.

soundset.prefered will instruct clients to use the given soundset with these rulesets. Currently only gtk (and qt?) clients support this, other clients ignore it. Use this field only if your ruleset really requires a soundset with some special tags. If only standard tags are used, user should be free to choose any of the soundsets providing them. New in freeciv 2.5

musicset.prefered will instruct clients to use the given musicset with these rulesets. Currently only gtk (and qt?) clients support this, other clients ignore it. Use this field only if your ruleset really requires a musicset with some special tags. If only standard tags are used, user should be free to choose any of the musicsets providing them. New in freeciv 2.6

options section[]

You can specify with what initially known technologies and buildings in their first city start all civilizations (global_init_techs, global_init_buildings, usually the former list is empty and the second contains Palace; barbarians don't get free buildings if they conquer their first city). Also, you may specify if players by default get technology help popup when they research something (popup_tech_help), this can be overridden by client setting.

civstyle section[]

This section contains various settings of the ruleset style.

base_pollution
Free amount of pollution per city, subtracted from city pollution value
gameloss_style
What happens if a player loses a gameloss unit (other than the player loses).
happy_cost, food_cost
How many luxuries/food is needeed to make a single citizen happier/less hungry.
;civil_war_enabled:Can any player at all enter civil war (except scripted one)
civil_war_bonus_celebrating, civil_war_bonus_unhappy
Since v.3.1 how much a single celebrating/disorder city changes civil war chance (in earlier versions, fixed to 5%)
base_bribe_cost
Base cost of bribing a unit
ransom_gold
Minimal ransom for a catched Barbarian Leader
pillage_select
Can a unit select which one of several possible extras does it pillage.
tech_*_allow_holes
If in various cases a tech known state change may result in a player technology tree containing technologies without all their prerequisites. Set all to FALSE to disable tech tree holes (save for a targeted gift by a scenario).
upgrade_veteran_loss, autoupgrade_veteran_loss
How many veteran levels a unit loses (if possible) while upgrading for money/by Leonardo.
base_tech_cost
Overall multiplier of technology bulbs
granary_food_ini, granary_food_inc
Array of city granary sizes, and the increment of city granary size for each citizen above this array length.
civstyle.min_city_center_*
Minimal output of city centers of given type, not penalized by tile penalties.
output_granularity
Since v.3.1 How many inner fragments each tile or citizen output of any type point has. This setting changes how output losses/bonuses calculations are rounded.
airlift_from_always_enabled, airlift_to_always_enabled:Since v.3.1 If set to TRUE, when airlifts from or to a city are not counted, they still require nonzero airlift effect to be possible.

Action enablers[]

Each type of an action possible in the game may have one or, for different circumstances, more enablers. Sections names must begin with actionenabler_.

[actionenabler_establish_embassy]
action       = "Establish Embassy"
actor_reqs    = { "type",   "name", "range"
  "UnitFlag", "Diplomat", "Local"
  "UnitState", "OnLivableTile", "Local"
  "MinMoveFrags", "1", "Local"
}
target_reqs  = { "type",   "name", "range", "present"
  "NationGroup", "Barbarian", "Player", FALSE
}

Each new Freeciv version makes more and more actions enabled in a common way with specifying requirements for the actor and the target, see README.actions for the list of what you can put as "action". In v.2.6 to 3.1, the actor is always a unit and the targets may be a unit, a stack of units, a tile or a city, depending on the action. Player is the actor owner and "Local"-ranged "DiplRel" in actor_reqs is calculated towards target owner (in target_reqs vice versa but should not be used there).

The example says: a unit may establish embassy in a city if the unit's type has the flag "Diplomat", it stays on a livable tile amd has any moves left, and the target city's owner is not considered a barbarian.

Action enabler factors
Participant Player City Tile Unit Other
Actor unit Unit owner City where the unit stays (only if it is on the center) Unit tile The unit Unit type
Target unit
Target units
For every unit in the stack
Target city City owner The city City tile - City production (unit type or building)
Target tile Tile owner (if any) Tile city (if it's the center) The tile - -
Target extras
 i  Since v.3.1
Tile extras owner (if any)

Self-targeted actions have no target_reqs.

Many actions have also "hard" requirements that are not listed here but disable the action even if both vectors are true; e.g., while enabler requirements don't care actor home city, limitations for it exist for actions "Establish Trade Route" or "Enter Marketplace". Ability to build or destroy a specific extra (controlled by enablers since v.3.1) depends on the extra's requirements. Also, note that you currently can't handle with an enabler the building that a unit sabotages. Some other actions have mandatory requirements that must be present in the vectors for any enabler of such an action in any ruleset of this version, see again README.actions.

See also[]

Editing Rulesets
Editing BuildingsEditing CitiesEditing EffectsEditing GameEditing Governments
Editing NationsEditing StylesEditing TechsEditing TerrainEditing Units
Advertisement