Nations

From Freeciv

Jump to: navigation, search
edit

Nations | Editing Rulesets | Editing tilesets | Themes | Sounds | Events
Rulesets and modpacks forum | Art and tilesets forum

Back to Game Mods page | Talk:Game Mods


This page describes (though not fully) the contents of a nation ruleset. It is intended as developer reference, and for people wanting to create/compile alternative nation files for Freeciv.

Contents

[edit] Overview of Editing a Nationset

The purpose of the nationsets is to provide a flexible and detailed but not hard-coded way to descibe the nations available within Freeciv games. This enables everyone to create add-ons to conveniently introduce additional nations for Freeciv. A nation consists of a nation rulesets file and a flag in the tilesets.
i The <nationname> bit used below is to be replaced with the nations name (duh). Please don't use whitespaces and special characters. Underlines are OK though.

[edit] The nation ruleset file

This file contains all the attributes of the nation you want to define. See the aztec.ruleset file for a introducing example and feel free to examine the other nations files. It may help to copy one of them over and edit it.
i Your newly created file should be located under data/nation/<nationname>.ruleset.
i The file name should be the same as the name of the nation inside the ruleset file.


[edit] The anatomy of a nation ruleset file

The following table shows you all the attributes a nation should provide to characterise it comprehesively. The first three columns of a table row form one single line inside the nations ruleset file.
Attribute Example Content Explanation
name = _("Aztec") The name of the nation, an adjective.
plural = _("?plural:Aztecs") The plural form of the nations name, a noun.
groups = one ore more of: "Medieval", "American" These groups are used to categorize the playable nations in the Freeciv client. It facilitates the outline of nation selection.
legend = _("The Azteca, a Nahuatl speaking people from the Sonoran desert,\

seized control of the Toltec-derived civilizations of Central Mexico\
during the 15th century AD, reviving the practice ...")

A summary of this nation shown by the Freeciv client. Possible topics are historical, geological, religious and other particular information about the nation.
leader = "Moctezuma II", "Cuauhtémoc", "Itzcóatl", "Axayacatl" A collection of leader names associated to the nation. These are used as proposal to he human player for nation customization during game start.

i When you think about introducing leaders with questionable attributes or history, keep in mind how others might react to playing as or against them.

leader_sex = "Male", "Male", "Male", "Male" Here you define the sex of the leaders numerated above. The sequence of the list follows the leader name list.
flag = "aztec" This is the reference to the flag image file. Hence it has to be named after the image file.
flag_alt = "mexico" ; Used previously Another reference to a flag image file. This is used as fallback position if the primary flag file was not found.
city_style = "Tropical" Here you can define which city images package will be used to visualize the cities for this nation. This attribute is only relevant when the nation gets used for computer players.
ruler_titles = { "government", "male_title", "female_title";

"Despotism", _("Tlatoani"), _("Tlatoani");
"Monarchy", _("Huey Tlatoani"), _("Huey Tlatoani")
/* TRANS: Tlatoani = Speaker */
/* TRANS: Huey Tlatoani = Great Speaker */}

This enumeration of ruler titles helps to adjust the leaders prefix depending on the currently used government of a civilization.
init_techs = This list sums up the technologies one nation brings into game. The techs will be available to the nation directly after beginning.
init_buildings = This list sums up the buildings one nation brings into game. The buildings can be built by the nation directly after beginning.
init_government = "Despotism" This is a single value attribute. A valid value would be one of the global defined governments.
init_units = This list sums up the units one nation brings into game. The units can be built by the nation directly after beginning.
civilwar_nations = "inca", "mayan" Here you can give a list of references to other nation files. These information will be used for civil war scenario games.
cities = "Michoacan", "Axaca", "Tuxpan", "Metztitlan", "Otumba", "Tlacopán", "Theotihucanán", "Tezcuco", "Jalapa", "Tlaxcala", "Cholula", "Tenochtitlán", "Yopitzingo", "Teotitlán", "Theuantepec", "Chiauhtia", "Chapultepec", "Coatepec", "Ayotzinco", "Itzapalapa", ... This list sums up the cities one nation used during their 'historical' evolvement. The city names are used as proposals to the human player for naming newly created cities.

[edit] How to introduce your nation ruleset file

There are several files where you will have to unveil the existence of your nations ruleset file before you are able to choose it inside a Freeciv game.
Since these files will have to be edited before your nation can be included in the main distribution it will have to be done anyway. But unless you know what you're doing you shouldn't need to worry about this. If you're not capable to apply the needed changes feel free to submit your creations and help will be on the way for the remaining steps.
If you want to try it on your own just add a reference to your nation ruleset file to the lists in the following files:
[edit] Changes related to game playing

data/default/nations.ruleset

This lists all nation files and is read by the game engine on startup. A existing nation file which didn't get introduced in here will never apear in your game. Add your nation (nation/<nationname>.ruleset) to this list.
[edit] Changes related to software development

data/nation/Makefile.am

A list of all Freeciv project related files. This file tells the project build machinery which files to pack into installable (and executable, of course) Freeciv packages. Lookup the already enumerated nation ruleset files and append yours.

po/POTFILES.in

Here is yet another list of nations files; the reference in here will be used for translating purposes. Add your nation (data/nation/<nationname>.ruleset) to it.

[edit] Further posibilities for nation definition

data/scenario/*

In this folder you can deposit scenario files. These files help to adjust further options for game play.
  • You are able to define a scenario map to play on.
  • You can add starting position for your nation on that scenario map.
  • You can define to amount of ressources available at game start.
... and many more things.

[edit] The nation flag image file

A new nation needs a new flag. You should provide a unique flag for your nation. It may help to copy one of the other flag files over to be able to start a nations development. But using a flag that is already used by another nation in the game is only acceptable as contribution if there are profound reasons existent.
If you are creating a real-world nation you can probably find a Free or public domain flag that can be used. One good place to look is the Sodipodi clipart section. Other good sources for nation flag data are Wikipedia and Flagspot.
We also welcome improvements to existing flags. Most of our existing flags come from the Sodipodi clipart collection, and some of them are less than perfect. One common problem is that the colors are wrong. If you fix a flag for a real nation be sure to cite your source so we can be sure it's accurate. If you want to add or improve a flag for a fantasy nation, this is also welcome.
We recommend you first contact the original author of the flag (see the CREDITS file) to discuss your ideas for changes.
i Remember that any flags we add must be licenced under the GPL and should be attributed to their original author, so make a note of where you found the flag, what its licence is, and who made it.

[edit] Flag Guidelines

Here are a few guidelines for flags:
  • Flags should be rectangles, since an outline is added to them automatically.
  • Flags often come in multiple aspect ratios. A 3:2 ratio looks best for Freeciv and all current flags use this ratio. Other common ratios are 2:1, 1:1 or 4:3.
i Please note that Freeciv no longer uses XPM files. As of Freeciv 2.1 all flags are stored in SVG (Scalable Vector Graphics) format. PNG is the preferred form for graphics, and flags should be made exclusively in SVG. Sodipodi and Inkscape are two good SVG editors.

[edit] Flag Specifics

To add a flag you'll have to edit the following files:

data/flags/<nationname>.svg

This is your nations flag image file in SVG format. This is not used directly by Freeciv but is rendered into PNG files (at various resolutions for different tilesets). The SVG file is not used in Freeciv 2.0 but all the other steps for adding flags are the same.
i The <nationname> should be the same as the name of the nation in the ruleset (although currently many flags do not follow this).

data/flags/<nationname>.png
data/flags/<nationname>-shield.png

These are the flag images that are used by Freeciv. They are rendered automatically from the SVG file. The conversion program is not included in Freeciv 2.0 so you should download the development version which does have it. Once this file has been created it can be used with older versions of Freeciv as well. To run the conversion program you will need to install Inkscape, ImageMagick, and (optionally) pngquant. Once these are installed change to the data/flags directory and run ./convert_png <nationname>.svg.

data/misc/flags.spec

This file has a reference to the flag PNG graphic. The "tag" here must match the flag tag you put in the nation.ruleset file (usually f.<nationname>, and the "file" should point to the PNG image at flags/<nationname>.png.

data/misc/shields.spec

Just like flags.spec, this file must include a reference to the flag PNG graphic. The only difference is that the file should point to the "shield" graphic, flags/<nationname>-shield.png.


i Changes to the .spec files can be submitted as a patch (created using diff -ruN). Even though the *.spec files may need to be changed, please include them in the diff -- this should be easier for you, and it provides a convenient place for us to grab the sprite name. See the section on How to Contribute for more instructions.

[edit] How to introduce your nation flag image file

There are two files where you will have to unveil the existence of your nations image file. Add your nation flag file to the following files:
[edit] Changes related to game playing

data/nations/<nationname>.ruleset

Here you should have already referenced your image file via the 'flag=<nationname>' attribute.
[edit] Changes related to software development

data/flags/Makefile.am

This file tells the project build machinery which files to pack into executable Freeciv installation packages. Perceive the already enumerated nation flag files and append yours. You will have to append it two more times since there are separate lists for your nations shild image file and the image source file (the svg file).

[edit] Nations Mini-FAQ

These address a few problems and questions about adding nations.
[edit] In what order should I list cities in Nation ruleset files?
A discussion of city ordering appears in the freeciv-dev archive: http://arch.freeciv.org/freeciv-dev-199910/msg00030.html
There is even a perl script available to do the job in the same thread: http://arch.freeciv.org/freeciv-dev-199910/msg00074.html
[edit] What nations can be added to Freeciv with a ruleset file?
Freeciv supports a classification of nations in modern, historical, and fictional. Modern nations are existing (independent) states, historical nations existed in past times but have ceased to exist (or have encountered a substantial change in their territory), and fictional nations are those that are products of the fantasy of a book writer.
You should make a clear decision about the group of a nation you add. A modern nation must be restricted on the actual today's territory; you should leave out any cities not on this territory. Choosing leader names is not that restrict, but there should be a strong historical relation to the nation you create.
The reason for this is, we don't want Freeciv to be used as a political vehicle for discussions about the borders or independence of nations and avoid trouble with other ruleset authors.
[edit] What about geographical order of cities?
Cities are not in geographical order. But there is a feature in Freeciv that supports city placement according to the geological environement of the (real) city. So it would be nice if you add some attributes to the city names like hills, forest, river. A leading exclamation mark ! expresses the absence of that type of geological environement.
The syntax for this is like this:
"Mannheim (grassland, forest, river, !ocean)",
"Bonn (plains, forest, river)",
At this point, it is useful to put one city per line, only.

From Freeciv, a Wikia wiki.
Personal tools
.