Civ1 • Civ2 • Civ2civ3 • Classic • Experimental • Multiplayer • Sandbox
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 an effects ruleset file
- The
effects.ruleset
file contains all effects in play in a Freeciv scenario. - Typically an
effects.ruleset
contains*include ai_effects.ruleset
as cheat sheet for AIs.
They have the following form:
[effect_hydro_plant] name = "Output_Bonus" value = 25 reqs = {"type", "name", "range" "Building", "Factory", "City" "Building", "Hydro Plant", "City" "OutputType", "Shield", "Local" }
- The text in the brackets is the entry name, which just has to be unique, but is otherwise not used.
- The name field tells Freeciv which Effect Type you are defining. The value is the effect's value, which depends on which effect it is. The reqs table contain a list of requirements for this effect being in effect. You need to satisfy all requirements listed here for this effect to take effect in the game.
- The value field is the integer amount parameter for many effects (must be in the range -32767 to 32767; some do not handle negative numbers well).
- The reqs table consists of sets of Requirement Type, Requirement, and Requirement Range.
- Some requirement types may only work at certain ranges. In particular, at present, "Continent" range effects can affect only cities and units in cities.
- 2.4 Negation
- There is the nreqs table which is the opposite of the reqs table, these are conditions which prevent the effect from taking place. Any one of the nreq conditions will prevent the effect from taking effect.
nreqs = {"type", "name", "range" "Building", "Factory", "City" }
- 2.5 Negation
- A requirement may have a negated field, and if this is 'TRUE', the requirement is negated.
reqs = {"type", "name", "range", "negated" "Building", "Factory", "City", TRUE }
- 2.6 Negation
- The negated field is replaced with present field, defaulting to 'TRUE', but if 'FALSE' requirement must not be fulfilled.
reqs = {"type", "name", "range", "present" "Building", "Factory", "City", FALSE }
- Survives
- A requirement may have a survives field, and if this is 'TRUE', the effect survives destruction (wonders only).
[effect_plastics_slowdown] type = "Slow_Down_Timeline" value = 1 reqs = { "type", "name", "range", "survives" "Tech", "Plastics", "World", TRUE }
Requirement Ranges
- Requirement Range may be one of:
Requirement range | Explanation |
---|---|
"None" | |
"Local" | |
"CAdjacent"
i New in 2.4 |
Cardinally Adjacent omits diagnally adjacent tiles |
"Adjacent" | |
"City" | |
"Continent" | |
"Player" | |
"Alliance"
i New in 2.6 |
|
"Team"
i New in 2.6 |
|
"Traderoute"
i New in 2.6 |
|
"World" |
Requirement Types
- Requirement Type may be one of:
Requirement type | Supported Ranges | Explanation |
---|---|---|
"None" | (default) | |
"Tech" | World, Alliance, Team, Player | |
"TechFlag"
i New in 2.5 |
World, Alliance, Team, Player | |
"Gov" | Player | |
"Building" | World, Alliance, Team, Player, Continent, Traderoute, City, Local | |
"Extra"
i New in 2.6 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"ExtraFlag"
i New in 2.6 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"Special"
i Replaced by "Extra" in 2.6 |
??? | |
"Base"
i New in 2.2 i Replaced by "Extra" in 2.6 |
??? | |
"BaseFlag"
i New in 2.6 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"Road"
i New in 2.5 i Replaced by "Extra" in 2.6 |
??? | |
RoadFlag"
i New in 2.5 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"Resource"
i New in 2.5 i Replaced by "Extra" in 3.0 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"Terrain" | Local, Adjacent, CAdjacent, Traderoute, City | |
"UnitType" | Local | Effect Types "Veteran_Combat" and "Defend_Bonus" only. "Defend_Bonus" evaluates Attacker only. |
"UnitFlag" | Local | Effect Types "Veteran_Combat" and "Defend_Bonus" only. "Defend_Bonus" evaluates Attacker only. |
"UnitClass" | Local | Effect Types "Veteran_Combat" and "Defend_Bonus" only. "Defend_Bonus" evaluates Attacker only. |
"UnitClassFlag"
i New in 2.? |
Local | Effect Types "Veteran_Combat" and "Defend_Bonus" only. "Defend_Bonus" evaluates Attacker only. |
"Nation" | World, Alliance, Team, Player | |
"Nationality"
i New in 2.5 |
Traderoute, City | |
"OutputType" | Local | |
"MinSize" | Traderoute, City | Minimum size of a city required. |
"MinCulture"
i New in 2.6 |
World, Alliance, Team, Player, Traderoute, City | |
"AI"
i New in 2.2 |
Player | AI player difficulty level |
"TerrainClass"
i New in 2.2 |
Local, Adjacent, CAdjacent, Traderoute, City | Either "Land" or "Oceanic" |
"TerrainFlag"
i New in 2.5 |
Local, Adjacent, CAdjacent, Traderoute, City | |
"TerrainAlter"
i New in 2.? |
Local | |
"Achievement"
i New in 2.6 |
World, Alliance, Team, Player | |
"CityTile"
i New in 2.? |
Local, Adjacent, CAdjacent | |
"MinYear"
i New in 2.? |
World | |
"DiplRel"
i New in 2.6 |
World, Alliance, Team, Player, Local | |
"Style"
i New in 2.6 |
Player | Civilization Style |
"UnitState"
i New in 2.6 |
Local | "Transported", "OnLivableTile",
i New in 3.0: "Transporting", "OnDomesticTile", "HasHomeCity" |
"MinMoveFrags"
i New in 2.6 |
Local | Minimum move fragments the unit must have left |
"BuildingGenus"
i New in 3.0 |
??? | "Wonder", "SmallWonder", "Improvement", "Special" |
"MinTechs"
i New in 3.0 |
??? | |
"Age" | Local, City | Unknown |
"Specialist" | Local | Unknown |
"Topology" | World | Unknown: overhead, isometric, hexagonal, isohex? |
Effect Types
Effect Type | Value Range | Explanation |
---|---|---|
Tech_Parasite | Gain any advance known already by amount number of other players. Note that if you have two such effects, they combine into one much worse effect (the number of players required to gain an advance is increased). | |
Airlift | Allow airlift to/from a city. Starting from 2.2 amount of units can airlift each turn. | |
Any_Government | Allow instant government changes. | |
Capital_City | The city with this effect is the capital city. | |
Enable_Nuke | Allows the production of nuclear weapons. | |
Enable_Space | Allows the production of space components. | |
Specialist_Output | Specify what outputs a specialist is producing. Should be used with an OutputType requirement. | |
Output_Bonus | City production is increased by amount percent. | |
Output_Bonus_2 | City production is increased by amount percent after Output_Bonus, so is multiplicative with it. | |
Output_Add_Tile | Add amount to each worked tile. | |
Output_Inc_Tile | Add amount to each worked tile that already has at least 1 output. | |
Output_Per_Tile | Increase tile output by amount percent. | |
Output_Waste_Pct | Reduce waste by amount percent. | |
Force_Content | Make amount unhappy citizens content. Applied after martial law and unit penalties. | |
Give_Imm_Tech | Give amount techs immediately. | |
Growth_Food | Food left after cities grow or shrink is amount percent of the capacity of the city's foodbox. This also affects the 'aqueductloss' penalty. | |
Have_Contacts i New in 3.0. |
Provides contact with all the other players. | |
Have_Embassies | Like having embassies with all the players one has ever had contact with. In 2.6 and prior provided embassy-like effect with all the players (like having both Have_Contacts and Have_Embassies) | |
Make_Content | Make amount unhappy citizens content. Applied before martial law and unit penalties. | |
Make_Content_Mil | Make amount unhappy citizens caused by units outside of a city content. | |
Make_Content_Mil_Per | Make amountper unit of unhappy citizens caused by units outside of a city content. | |
Make_Happy | Make amount citizens happy. | |
No_Anarchy | No period of anarchy between government changes. (This also neuters the Has_Senate effect.) | |
No_Sink_Deep | Triremes no longer sink when on dangerous seas. | |
Nuke_Proof | City is nuke proof. | |
Pollu_Pop_Pct | Increases pollution caused by each unit of population by amount percent (adds to baseline of 100%, i.e. 1 pollution per citizen). | |
Pollu_Prod_Pct | Increases pollution caused by shields by amount percent. | |
Reveal_Cities | Immediately make all cities known. | |
Reveal_Map | Immediately make entire map known. | |
Incite_Cost_Pct | Increases revolt cost by amount percent. | |
Unit_Bribe_Cost_Pct i New in 2.6. |
Increases unit bribe cost by amount percent. | |
Size_Adj | Increase maximum size of a city by amount. | |
Size_Unlimit | Make the size of a city unlimited. | |
Health_Pct i New in 2.2. |
Reduces possibility of illness (plague) in a city by amount percent. This has no effect in rulesets which do not have plague enabled. | |
SS_Structural, SS_Component and SS_Module | A part of a spaceship; this is a "Local" ranged effect. It (for now) applies to improvements which cannot be built unless "Enable_Space" is felt. Buildings which have this effect should probably not be given any other effects. | |
Spy_Resistant | If a spy specifies a target for sabotage, then she has an AMOUNT percent chance to fail. Also in diplomatic combat defending diplomatic units in cities will get an AMOUNT percent bonus. All Spy_Resistant's are summed before being applied. | |
Stealings_Ignore i New in 3.0. |
When determining how difficult it is to steal a tech from enemy, AMOUNT
previous times tech has been stolen from the city is ignored. | |
Move_Bonus | Add amount movement to units. Use UnitClass' requirement with range of 'Local' to give it a specific class of units only. | |
Unit_No_Lose_Pop | No population lost when a city's defender is lost. | |
Unit_Recover | Units recover amount extra hitpoints per turn. | |
Upgrade_Unit | Upgrade amount obsolete units per turn. | |
Upkeep_Free | Improvements with amount or less upkeep cost become free to upkeep (others are unaffected). | |
No_Unhappy | No citizens in the city are ever unhappy. | |
Veteran_Build | New units of this type start with veterancy. In 2.4 and prior, the amount value is ignored, so that you can have multiple Veteran_Build effects, and units will only get 1 free veterancy level. In 2.5 and later, amount specifies the initial veteran level and is cumulative. | |
Veteran_Combat | Increases the chance of units of this type becoming veteran after combat by amount percent. | |
HP_Regen | Units that do not move recover amount percentage of their full hitpoints per turn. | |
City_Vision_Radius_Sq | Increase city vision radius in squared distance by amount tiles. | |
Unit_Vision_Radius_Sq | Increase unit vision radius in squared distance by amount tiles. | |
Defend_Bonus | Increases defensive bonuses of units. Any unit requirements on this effect will be applied to the _attacking_ unit. The defensive bonus is ignored by attackers with "IgWall" flag (up to 2.5). Attackers with "BadWallAttacker" flag will have their firepower set to 1. | |
Attack_Bonus i New in 3.0. |
Increases offensive bonuses of units. | |
No_Incite i Replaced with the Incite City action in 2.6 |
City cannot be incited. | |
Gain_AI_Love | Gain amount points of "AI love" with AI(s). | |
Slow_Down_Timeline | Slow down the timeline based on the AMOUNT. If AMOUNT >= 3 the timeline will be max 1 year/turn; with AMOUNT == 2 it is max 2 years/turn; with AMOUNT == 1 it is max 5 years/turn; with AMOUNT <= 0 the timeline is unaffected. The effect will be ignored if game.spacerace isn't set. | |
Civil_War_Chance | Base chance in percent of a nation being split by civil war when its capital is captured is increased by this amount. This percentage is increased by 5 for each city in civil disorder and reduced by 5 for each one celebrating. | |
Empire_Size_Mod i Removed in version 2.2. |
Once your civilization has more cities than amount + the server setting 'cityfactor', each city gets one more unhappy citizen. | |
Empire_Size_Base i New in 2.2. |
Once your civilization has more cities than the value of this effect, each city gets one more unhappy citizen. If the sum of this effect and Empire_Size_Step is zero, there is no such penalty. | |
Empire_Size_Step | After your civilization reaches Empire_Size_Base size, it gets one more unhappy citizen for each amount of cities it gets above that. Set to zero to disable. You can use Empire_Size_Step even though Empire_Size_Base is zero. | |
Max_Rates | The maximum setting for each tax rate is amount. | |
Martial_Law_Each | The amount of citizens pacified by each military unit giving martial law. | |
Martial_Law_Max | The maximum amount of units that will give martial law in city. | |
Rapture_Grow | Can rapture grow cities. | |
Unbribable_Units i Replaced with the Bribe Unit action in 2.6 |
Units cannot be bribed. | |
Revolution_When_Unhappy i Replaced with Revolution_Unhappiness in 2.6 |
If a city owned by this player is in revolt for more than two turns, government falls. | |
Revolution_Unhappiness i New in 2.6 |
If a city is in revolt for more than value turns, government falls. | |
Has_Senate | Has a senate that prevents declarations of war in most cases. | |
Inspire_Partisans | Partisan units (defined in units.ruleset) may spring up when this player's cities are taken. | |
Happiness_To_Gold | Make all Make_Content and Force_Content effects instead generate gold. | |
Fanatics | Units with "Fanatics" flag incur no upkeep. | |
No_Diplomacy | Cannot use any diplomacy. | |
Not_Tech_Source i New in 2.5 |
Tech cannot be received from this player by any means. | |
Trade_Revenue_Bonus | Trade revenue is multiplied by pow(2, amount/1000). The amount value is taken from the caravan's home city. | |
Traderoute_Pct i New in 2.6 |
Percentage bonus for trade from traderoutes. This bonus applies after the value of the traderoute is already calculated. It affects one end of the traderoute only. | |
Unhappy_Factor | Multiply unhappy unit upkeep by amount. | |
Upkeep_Factor | Multiply unit upkeep by amount. | |
Unit_Upkeep_Free_Per_City | In each city unit upkeep is deducted by this amount. As usual, you can use with OutputType requirement to specify which kind of upkeep this should be. | |
Output_Waste | Base amount in percentage that each city has in waste. Waste can be used with any output type, use an OutputType requirement to specify which. | |
Output_Waste_By_Distance | For each tile in real distance that a city is from your capital, it gets amount of extra waste. | |
Output_Penalty_Tile | When a tile yields more output than amount, it gets a penalty of -1. | |
Output_Inc_Tile_Celebrate | Tiles get amount extra output when city working them is celebrating. | |
City_Unhappy_Size i New in 2.2. |
Each citizen after amount of citizens are unhappy instead of content. | |
Turn_Years i New in 2.2. |
Calendar advances amount years each turn unless Slow_Down_Timeline effects override this. | |
Turn_Fragments i New in 2.6. |
Calendar advances amount fragments each turn, in addition to years advanced by Turn_Years. | |
Upgrade_Price_Pct i New in 2.2. |
Increases unit upgrade cost by amount percent. This effect works at player level. You cannot adjust upgrade costs for certain unit type or for units upgraded in certain city. | |
Tech_Cost_Factor i New in 2.2. |
Multiplier for research cost. | |
Shield2Gold_Factor i New in 2.2. |
Factor in percent for the conversion of unit shield upkeep to gold upkeep. A value of 200 would transfor 1 shield upkeep to 2 gold upkeep. The range of this effect must be player or world. Note that only units with the "Shield2Gold" flag will be affected by this. | |
Tile_Workable i New in 2.2. |
If value != 0, city can work target tile. | |
Visible_Walls i New in 2.1 |
Positive amount only instructs clients to use wall graphics for city.
i New in 2.6: Exact amount tells wall set to draw | |
Migration_Pct i New in 2.2 |
Increase the calculated migration score for the a city by amount in percent. | |
City_Radius_Sq i New in 2.3 |
Increase the squared city radius by amount. Currently, this can only usefully have "MinSize", "Building", or "Tech" requirements. | |
City_Build_Slots i New in 2.3 |
Increase the number of units with no population cost a city can build in a turn by amount. The required shields must be available. | |
Tech_Upkeep_Free i New in 2.3 |
If this value is greater than 0, the tech upkeep is reduced by this value. For tech upkeep style Basic this is total reduction, for tech upkeep style Cities (new in 2.6) this is applied to every city. | |
City_Image i New in 2.4 |
The index for the city image of the given city style. Allows to align the city image with the city radii. | |
Irrig_Possible i New in 2.4 |
If value of this effect > 0, target tile can be irrigated. In addition to requirements of this effect, there's still hardcoded requirement that unit doing the irrigation has "Settlers" flag, and terrain.ruleset controls which terrain types can be irrigated at all. | |
Transform_Possible i New in 2.5 |
If value of this effect > 0, target tile can be transformed. In addition to requirements of this effect, terrain.ruleset controls which terrain types can be transformed at all. | |
Mining_Possible i New in 2.5 |
If value of this effect > 0, mine can be built to target tile. In addition to requirements of this effect, terrain.ruleset controls which terrain types can have mines at all. | |
Irrig_TF_Possible i New in 2.5 |
If value of this effect > 0, tile terrain can be changed by irrigating action. In addition to requirements of this effect, terrain.ruleset controls which terrain types can be transformed this way. | |
Mining_TF_Possible i New in 2.5 |
If value of this effect > 0, tile terrain can be changed by mining action. In addition to requirements of this effect, terrain.ruleset controls which terrain types can be transformed this way. | |
Irrigation_Pct i New in 2.6 |
This effect controls how much of the terrain specific irrigation bonus applies. | |
Mining_Pct i New in 2.6 |
This effect controls how much of the terrain specific mining bonus applies. | |
Output_Tile_Punish_Pct i New in 2.6 |
Reduce the output of a tile by amount percent. The number of units to remove is rounded down. Applied after everything except a city center's minimal output. | |
Max_Trade_Routes i New in 2.5 |
Value of this effect tells how many trade routes city can establish. It affects only attempts to establish new routes, existing routes are not removed if value gets smaller than current number of routes. Maximum value, to which this value is clipped itself, is 5 routes. | |
Gov_Center i New in 2.5 |
City with non-zero effect value is considered Governmental center. Unless corruption is flat for entire nation, it depends on distance to nearest such center. In earlier versions this effect was coupled in to Capital_City effect. | |
Enemy_Citizen_Unhappy_Pct i New in 2.5 |
During war, citizens of enemy nationality are more unhappy. Value of this effect tells how many percents of the enemy citizens in cities get unhappy because of the war. | |
Victory i New in 2.6 |
When value of this effect gets positive, player wins the game. In simplest case you'll have just one such effect with value 1 (or any positive value) and thus requirements of that effect are requirements for winning the game. | |
Performance i New in 2.6 |
Value of this effect is how much Performance-type culture the city is producing. Performance is not persistent culture, but affects only
current turn. | |
History i New in 2.6 |
Value of this effect is how much cumulative History-type culture the city is producing. | |
National_Performance i New in 2.6 |
Value of this effect is how much Performance-type culture the nation is producing in addition to that produced by individual cities. | |
National_History i New in 2.6 |
Value of this effect is how much cumulative History-type culture the city is producing in addition to that produced by individual cities. |
Template:UpdateNavbox