Traits

==AI traits==
AI personality traits are a new feature in Freeciv 2.5. In default rulesets all the nations are equal in terms of trait values, but custom ruleset author can give each nation distinct trait values to affect how they behave.
=== Definitions in freeciv 2.5 ===
Default trait values applicable for all nations are defined in nations.ruleset section default_traits.
[default_traits]
expansionist = 50
trader = 50
aggressive = 50
Nation specific section can override these defaults by introducing trait_<trait> values.
[nation_abkhaz]
...
trait_expansionist = 200
trait_trader = 10
trait_aggressive = 60
=== Definitions in freeciv 2.6 and later ===
In 2.6 traits in rulesets are defined as ranges from which actual trait value is then randomly selected. Where 2.5 had single value, 2.6 has three values with suffices "_min", "_max", and (optionally) "_default".
Players can choose whether to have AI traits randomly chosen between '_min' and '_max', or fixed value '_default', using the 'traitdistribution' server setting (which defaults to 'FIXED'). (Ruleset authors can override or force the default in the usual way.)
By setting both "_min" and "_max" values to same value (having range of just one possible value) you can still force specific value to be used.
"_default" is optional; if not specified, the midpoint of "_min" and "_max" will be used.
Default trait values applicable for all nations are defined in nations.ruleset section default_traits.
[default_traits]
expansionist_min = 50
expansionist_max = 50
expansionist_default = 50
trader_min = 50
trader_max = 50
trader_default = 50
aggressive_min = 50
aggressive_max = 50
aggressive_default = 50
Nation specific section can override these defaults by introducing trait_<trait> values.
[nation_abkhaz]
...
trait_expansionist_min = 170
trait_expansionist_max = 230
; trait_expansionist_default will default to midpoint, (170+230)/2 = 200
trait_trader_min = 10
trait_trader_max = 10
trait_aggressive_min = 60
trait_aggressive_max = 60
==Trait types==
===Expansionist===
Value of trait expansionist defines how much AI wants to settle new territory.
===Trader===
Value of trait trader defines how much AI wants to establish trade routes.
===Aggressive===
Value of trait aggressive defines how easily AI declares war.
==Adjusting traits during game==
It's possible to adjust trait values from lua scripts. edit.trait_mod() function increases or decreases given trait value for given player. See Lua reference manual.
Category:Documentation