forked from freeciv/freeciv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.rulesets
180 lines (135 loc) · 6.75 KB
/
README.rulesets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
----------------------------------------------------------------------
Freeciv Rulesets
----------------------------------------------------------------------
(Originally by David Pfitzner, [email protected])
Quickstart:
-----------
Rulesets allow modifiable sets of data for units, advances, terrain,
improvements, wonders, nations, cities, governments and miscellaneous
game rules, without requiring recompilation, in a way which is
consistent across a network and through savegames.
- 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:
./fcser -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. The AI is supposed to understand and
utilize all sane rules variations, so please report any AI
failures so that they can be fixed.
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 the server command "rulesetdir".
The command above of "./fcser -r data/civ1.serv" just reads a file
which uses this command (as well as a few of the standard
server options). The server command specifies in which directory
the ruleset files are to be found.
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 "civ2civ3", "classic", "multiplayer", "alien",
"civ1", or "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.
- Units have a 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
- Rulesets must be in UTF-8; translatable texts should be American English
ASCII.
----------------------------------------------------------------------
Restrictions and Limitations:
-----------------------------
units.ruleset:
Restrictions:
- At least one unit with role "FirstBuild" must be available
from the start (i.e., tech_req = "None").
- There must be units for these roles:
- "Explorer"
- "FerryBoat" (Must be able to move at sea)
- "Hut" (Must be able to move on land)
- "Barbarian" (Must be able to move on land)
- "BarbarianLeader" (Must be able to move on land)
- "BarbarianBuild" (Must be able to move on land)
- "BarbarianBoat" (Must be able to move at sea)
- "BarbarianSea"
nations.ruleset
Restrictions:
- Government used during revolution can't be used as default_government
or init_government for any nation
----------------------------------------------------------------------
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.
----------------------------------------------------------------------
Game settings defined in the ruleset:
-------------------------------------
Game settings can be defined in the section [settings] of the file
game.ruleset. The name key is equal to the setting name as listed by
'show all'. If the setting should be locked by the ruleset, the last
column should be set to TRUE.
set =
{ "name", "value", "lock"
"bool_set", TRUE, FALSE
"int_set", 123, FALSE
"str_set", "test", FALSE
}
----------------------------------------------------------------------
Scenario capabilities:
----------------------
Some scenarios can be unlocked from a ruleset, meaning that they are not
meant to be used with strictly one ruleset only. To control that such
a scenario file and a ruleset are compatible, capabilities are used.
Scenario file lists capabilities it requires from the ruleset, and
ruleset lists capabilities it provides.
Some standard capabilities are:
std-terrains
Ruleset provides at least terrain types Inaccessible, Lake, Ocean,
Deep Ocean, Glacier, Desert, Forest, Grassland, Hills, Jungle,
Mountains, Plains, Swamp, Tundra.
Ruleset provides River extra
----------------------------------------------------------------------
Update information:
-------------------
The information about the changes in the definition of a ruleset between
different versions of Freeciv is kept in the wiki at https://www.freeciv.org/
The URLs below list the differences between the freeciv versions from 2.2.x
to the current version:
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.2_to_3.3
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.1_to_3.2
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.0_to_3.1
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_2.6_to_3.0
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_2.5_to_2.6
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_2.4_to_2.5
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_2.3_to_2.4
https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_2.2_to_2.3