The game allows the creation of alternative nations without changing the game sources. The specification includes the name of the nation, the names of its cities and (optionally) alternative graphics. This text contains the exact tribe building specification. Alternatively or additionally, you might use the tribes which come with the standard package as starting point or as example.
A nation is made up by two parts:
All graphical items have the same size as they have in Civ II, so you can use any stuff that was originally made for Civ II.
If you're going to create new unit graphics, please consider:
The arrangement of the graphic files is slot based. A slot has a size of 65 x 49 pixels. The slot arrangement is seemless, starting at the top left corner of the image. An image can contain up to 10 columns of slots and an unlimited number of rows. Each slot has a unique index, depending on its position in the image: index = column + row*10 (column and row count starting with 0).
Example: The slot with top left corner at (195,49) has index 13 (column 3, row 1).
The program will only use slots which are mentioned in the tribe script. You can do whatever you want within slots which are not listed there. (However, be aware of memory usage. Every single slot consumes 12k of memory, even if unused.)
Two shades of purple represent transparent areas: #7F007F and #FF00FF. Take care on using exactly these color values, even if your image uses a color palette. If you wish to include your tag with an item you made, you might do it in a transparent area using these two colors.
The structure of a slot depends on the slot type. I'll use coordinates (pixel column, pixel row) relative to the top left corner of a slot to describe the slot structure.
The contained unit picture starts at (1,1). White dots (exact color value #FFFFFF) in (x,0) and (0,y) define the desired top left corner (x,y) of the unit status symbol.
The contained city picture starts at (1,1). Yellow dots (exact color value #FFFF00) in (x,0) and (0,y) define the desired top left corner (x,y) of the city size label. White dots (exact color value #FFFFFF) in (x,0) and (0,y) define the desired bottom left corner (x,y) of the capital flag.
If the city picture is a walled one, you can set the bottom left corner pixel of the slot (0,48) to yellow (exact color value #FFFF00) and contain only the wall itself. If you do so, the program will paint the unwalled city picture under the wall. This makes your graphic file a little better compressable.
nation flag - position (1,1), size 13x14
unit status symbol - position (18,1), size 14x12
symbol shade for multiple units - position (33,1), size 14x12
The contained nation picture starts at (1,1) and must have a size of 64x48. Transparency is not supported.
If the bottom left corner pixel of the slot (0,48) is set to yellow (exact color value #FFFF00), a shield graphic will be generated from the picture:
A texture always covers two slots with index i and i+10. The contained texture graphic itself starts at (1,1). The maximum size of a texture is 64x88 pixels. If it is smaller, unused areas must be filled with the transparency colors.
Other contained items:
text highlight color - one pixel at position (1,93)
selection frame color - one pixel at position (4,93)
page color of science book - one pixel at position (7,93)
cover color of science book - one pixel at position (10,93)
lit bevel color - one pixel at position (1,96)
shaded bevel color - one pixel at position (4,96)
lit font color - one pixel at position (7,96)
shaded font color - one pixel at position (10,96)
top left corner - position (30,90), size 8x8
top right corner - position (39,90), size 8x8
bottom left corner - position (48,90), size 8x8
bottom right corner - position (57,90), size 8x8
If you don't want to define special corner graphics, fill the corner graphics area with the transparency colors. Also, note that only outer textures make use of the corner graphics.
The tribe script is a plain text file with a line based structure. All of the key lines described below are a must! If your nation pack doesn't contain single graphic items, reuse graphics from the standard pack (e.g. textures from "StdTextures.bmp"). Key words are case sensitive and must start with the first character of a line.
This line appears only in the tribe selection list. This allows to distinguish nations that would appear under the same name within the game.
A name of your nation. The use of names depends on the translation you make your nation for. A translation can make use of up to 26 names: #a thru #z. This allows to support a grammar that is not as simple as the English one or to use more than one name for the same nation (e.g. "China", "The Chinese" and "The Chinese Empire"). The default (English) translation uses three tribe names:
#n - full name (with article, if applicable) for use in sentences
#s - short name to stand alone
#a - adjective
Example for sophisticated usage:
In English, the sentences "The Babylonians gratefully accept this present." and "You are unworthy to sign state treaties with the Babylonians." can use the same nation name, because the grammatical case does not affect the name of any nation. In contrast, a German translation would have to make a difference between "die Babylonier" and "den Babyloniern". So the creator of the German translation could introduce an additional name #d for the dative form. All tribe scripts for this translation would have to define this name, for Example:
#n die Babylonier
#d den Babyloniern
Defines the nation color. RR, GG and BB are the red, green and blue color components in hexadecimal form (you might know this format from HTML).
#SYMBOLS <file>, <slot>
Tells where the symbol slot for this nation is located. <file> is the name of the graphic file without path and extension, <slot> is the slot index.
#AGEx <city file>, <city row>, <texture file>, <texture slot> [, <nation picture file>, <nation picture slot>]
Tells where the nation's city and texture graphics for the single ages are located (#AGE0 = Ancient, #AGE1 = Renaissance, #AGE2 = Modern, #AGE3 = Future). <city file> is the name of the graphic file for the city pictures without path and extension. The city pictures must be located in the slots with indeces from 10*<city row> to 10*<city row>+3, where the left most picture represents the smallest city and the right most the biggest. The pictures for walled cities must follow at the indeces from 10*<city row>+4 to 10*<city row>+7.
<texture file> is the name of the graphic file for the textures without path and extension. <texture slot> is the slot index for the outer texture, <texture slot>+1 the slot index for the inner texture. Since a texture covers two slots, a complete texture set always takes four neighboured slots: <slot>, <slot>+10, <slot>+1 and <slot>+11.
The nation picture is optional. If you don't specify it, the picture window in the nation dialog will remain black when viewing this nation. <nation picture file> is the name of the graphic file, <nation picture slot> is its slot index.
This line is followed by the city names of the nation. All lines until the next key line resp. the file end are interpreted as a city name, except empty lines. Leading blanks and tabs are ignored here.
This section tells which alternative unit pictures this nation has and where they're located. <file> is the name of the graphic file without path and extension. This is the only key line a tribe script may contain more than once. So your nation can make use of unit pictures from different graphic files.
The key line is followed by lines, each of which declares one unit picture. The syntax of these lines is:
<slot>, <code>, <name>
<slot> is the slot index of the unit picture, <name> the predefined name of the unit class (can be changed by the player). <code> tells what kind of unit this picture represents.
100: Early slow unit
101: Slow defender with Bronze Working
102: Slow defender with Iron Working or Chivalry
103: Slow defender with Monotheism or Gunpowder
104: Slow defender with Explosives, Tactics or Radio Communication
105: Slow defender with Automobile or Robotics
106: Slow defender with Composites or Laser
110: Fast defender with Automobile
130: Early fast unit
131: Fast unit with Bronze Working
132: Fast unit with Iron Working or Chivalry
133: Fast unit with Monotheism or Gunpowder
134: Fast unit with Explosives, Tactics or Radio Communication
135: Fast attacker with Automobile or Robotics
136: Fast attacker with Composites or Laser
170: Early heavy attacker
171: Heavy attacker with Monotheism or Gunpowder
172: Heavy attacker with Automobile or Robotics
173: Heavy attacker with Composites or Laser
200: Early ship
201: Ship with Engineering or Gun Powder
202: Ship with Steam Engine or Amphibious Warfare
203: Ship with Advanced Rocketry
210: Transport with Steam Engine or Amphibious Warfare
300: Early fighter
301: Fighter with Rocketry
310: Early bomber/transport plane
311: Bomber/transport plane with Rocketry
17: City Building Site
21: Special Commando
41: Town Guard
The tribe script doesn't have to define pictures for all possible units. If the program doesn't find an appropriate unit picture defined in the tribe script, it uses a standard picture. However, the tribe script must at least define one unit picture: the Militia (because this one isn't specified in the StdUnits script).
The program will prefer unit pictures that are listed within the tribe script. Only if the script doesn't contain a picture for a particular code, or if the pictures from the script are already in use, a picture from StdUnits.txt is picked. Note that there's no additional way to influence the selection, it's virtually random. Particularly, the order of the lines in the tribe script does not affect the overall probability of a certain picture to be selected.
Project homepage: c-evo.org