The term "tag" means a key word surrounded by angle brackets. For example:>
Each tag is followed by data, then by a closing tag. The closing tag is identical to the opening tag except that the opening angle bracket is followed by a slash, so the closing tag for civilization is
Sometimes a tag has no data - the mere existence of the tag is sufficient. In this case only the opening tag is used, but with a slash at the end. An example occurs in the images file, in which
The term "class" (borrowed from Java) has been used to describe the data generated by an opening and closing tag, and the data inside. If another matched set of tags occurs inside a class, it is called an inner class.
Developers please note that the correspondence between a Java class and a class as defined here as not exact. Many "classes" as defined here are actually Java primitives.
The directories used by Clash of Civilizations are as follows:
The xml formats are given below.
The xml formats are given below.
These file are images only, there is no xml.
These files are images only, the only other file is images.xml.
Outer classes are read through an XML interface, and may have a different storage method from inner classes. The name of outer classes may be different from that of the corresponding Java class. Inner classes use the setting method of the enclosing class, which means they may be treated differently, in different outer classes, depending on what the outer class is.
As an example, the Victory class can be defined globally (in the scenario file), or it can be included as part of a civilization. The reason for this is that in a Punic Wars scenario, a victory condition like "exterminate all other civilizations" would work, however a victory condition like "occupy Rome" does not make much sense if the player is playing the Romans.
Under the files specification below, all the main classes that can be included in each file are listed. In each of the class specifications below, the inner classes allowed are specified.
The tag is <location> for a normal square reference. In the case of a civilization the tag <start> (with the same syntax as location) defines the player's starting square if they pick that civilization.
Subtags are:
| x | the x coordinate of the square |
| y | the y coordinate of the square |
| name | possible name of the square (for example Rome). This can be used to name a square, the name can then be used to find the square. Map squares can be named in this way anywhere that coordinates are expected, and particular as outer classes in map or scenario files. This allows a square to be named (and located) once, and thereafter referred to by name, so if the location is changed while developing a scenario, the coordinates need to be changed in one place only |
Where a reference to a location is made, using the name of the location, the syntax:
<location> <name>actual name</name> </location>can be replaced by:
<location>actual name</location>This is purely a convenience which makes the scenario file look a little better. This abbreviation also applies to the start tag in a civilization.
The inner tags are:
| x | the first occurrence is the lower x coordinate and the second the higher x coordinate |
| y | the first occurrence is the lower y coordinate and the second the higher y coordinate |
The tag varies according to the context (see the scenario class ).
The only subtag is (with an abbreviation for the lazy):
| name | the name to add to the list |
| n | this is an abbreviation for name |
The scenario (exactly one class per scenario file) has the <scenario> tag.
Inner tags are:
| name | the name of the scenario |
| description | the description of the scenario |
| turn | the start turn (calendar year) of the scenario |
| turnLength | the length of a turn (number of calendar years) in the scenario |
| newnames | a name list of names for new civilizations created in the course of the game |
| barbarians | a name list of names for new barbarians created in the course of the game |
| visible | If set, the whole map will be visible. Doesn't have a value, type <visible/> |
| noFogOfWar | If set, there will be no fog of war. Doesn't have a value, type <noFogOfWar/> |
Subtags are:
| minimumRiotProbability | the minimum probability a riot must have before it is even considered: 0.0 means all riots will be considered, while a value of 1.0 means riots won't occur. |
| numberOfPoliciesBlockedTurns | The number of turns during which the player can no longer change the policies after the ruler is murdered or a province capital has been conquered. |
| antidiscrimination | Effects of anti discrimination feeling. |
| badpolicies | Effects of bad policies feeling. |
| politicalchange | Effects of political change (revolutionary) feeling. |
| poorwelfare | Effects of poor welfare feeling. |
| replaceruler | Effects of replace ruler feeling. |
| separatism | Effects of separatism feeling. |
Subtags are:
| riot | Weight of the riot event (most likely and harmless event) |
| rebelDuke | Weight of the Rebel Duke event |
| murder | Weight of the murder ruler event |
| revolutionaryForces | Weight of the Revolutionary Forces Formation event |
| guerillaForces | Weight of the Guerilla Forces Formation event |
| armyBetrayal | Weight of the army betrayal event |
| militaryCoup | Weight of the military coup event |
| independance | Weight of the independance event (least likely and most harmful event) |
Subtags are:
| name | the name of the regime, eg Athenian democracy |
| description | the description of the regime, to be shown in Encyclopedia |
| attractiveness | the attractiveness of the regime (0.0 - 1.0, 1.0 is more attractive) |
| ruler | the ruler influence in this regime (0.0-1.0) |
| human | the human influence in this regime (0.0-1.0) |
| capital | the capital influence in this regime (0.0-1.0) |
| ethics | the ethics influence in this regime (0.0-1.0) |
| warfare | them warfare influence in this regime (0.0-1.0) |
| privateproperty | the private property preference in this regime (0.0-1.0) |
| socialpolicy | the social policy preference in this regime (0.0-1.0) |
Subtags are:
| aggressiveness | the aggressiveness of the moral code |
| ethnictolerance | the ethnic tolerance of the moral code |
| religioustolerance | the religious tolerance of the moral code |
| individualism | the individualism of the moral code |
Subtags are:
| name | the name of the ethnicity, eg Gauls |
| abbreviation | an abbreviation to be used in the map, eg G. This abbreviation must be unique |
| religion | the religion |
| socialclasses | the social classes available for this ethnicity |
| culture | the culture of this ethnicity |
Subtags are:
| name | the name of the ethnicity, eg Gauls |
| population | the number of peoiple of this ethnicity |
Subtags are:
| socialclass | details of a specific named social class social class name |
Subtags are:
| name | the name of the social class, eg Aristocracy |
| value | the proportion of the population (0 - 1) in this social class |
Subtags are:
| nationality | The name of the civilization this ethnicity would like to belong to. |
| culturalprototype | The cultural values of this culture |
Subtags are:
| traditionalism | Importance of tradition |
| nationalism | Nationalism |
| landConnection | The importance of the (sacred) land |
| importanceOfReligion | How important religion is in this culture |
| corruption | corruption |
| aggressiveness | aggressiveness |
| ethnicTolerance | The tolerance of other ethnic groups |
| religiousTolerance | The tolerance of other religions |
| asceticism | asceticism |
| individualism | individualism |
Subtags are:
| name | the name of the religion, eg Nature spirits |
| moralcode | the moral code (see moral code) |
The tag is <globals>.
Inner classes are:
| growthrate | overall growth rate |
| upkeep | upkeep rate |
The tag is <technology>.
Inner classes are:
| name | the name of the technology |
| description | the description of the technology |
| tier | tier (1-3) for this technology |
| growthrate | growth rate |
| upkeep | upkeep rate |
| helper | inner class for helper technology |
| messages | inner class for messages to be displayed as the tech progresses |
The tag is <helper>
Inner classes are:
| name | the name of the helper technology |
| requirement | The knowledge level required to be helpful (more than this value helps, less hinders) |
| effect | effect |
| start | If the helper tech knowledge is below that level, then the helped tech is not active and cannot be researched. Defaults to 0. |
The tag is <messages>
The only legal inner classes are one or more >namedlevel tags:
The tag is <namedlevels>
Inner classes are:
| level | the value the technology must reach in order to display the message |
| name | The name of the technology, which will be displayed as a short message. |
| message | A more detailed message which will be shown if the player clicks to get details. |
The tag is <activity>
Inner classes are:
| name | the name of the activity |
| description | a description of the activity |
| recipient | a recipient technology |
The tag is <recipient>
Inner classes are:
| name | the name of the recipient technology |
| proportion | the proportion it is to receive. Proportions will be summed and scaled so the total of proportions of all contributed technologies is 1. |
Subtags are:
| healAfterFight | the proportion (between 0 and 1) of casualties that heal after one tick of fight. This represents wounded units. It is applied only to non losing sides (winners and ties), wounded and fleeing losers are lost forever. A 0 value will mean deadly fights, 1 means there will be no casualties for the winner. |
| damageDivider | Divides all damage dealt in combat by that amount. Big means long fights, little means fast and deadly. |
| distanceBetweenRanges | Distance between the various ranges of fight (long, medium, short, melee). Units have different strengths at various ranges (distance/attack values). The bigger the figure, the more fights will take place at long range. Note that high mobility elements reach melee range faster (if they want to) or are harder to get close with (if they prefer to fight from afar). |
| maxRoundsOfFight | An integer parameter indicating how many computations are made in one tick of fight. Each tick is made of that number of rounds at most. Increasing the number will mean longer and deadlier fights. It will also mean fights will be fought longer at close range. Note that increasing this indefinitely doesn't change many things, as all losing units eventually flee. Beware when lowering to decrease distanceBetweenRanges too if you don't want fights to be reduced to ranged skirmishes with no melee. |
| researchDivider | Divide number of research points received from combat by this factor. |
| engineerDivider | Defense provided by in-fields fortifications is equal to (number of engineers (units capable of Build order)) / this divider. Note fortifications are built only if manoeuvering phase has been won (thus generally requires elements with Skirmish order in order to succeed). |
Subtags are:
| name | the name of the unit, eg Phalanx |
| flavorText | text to be displayed in the encyclopedia |
| description | the description of the unit, shown when the unit becomes available |
| image | the logical name of the imahe to be used (that is, the name specified in the
images.xml file). It can be either a string or a technology
dependant string. For example: <image>Archer</image> or <image> <default>Archer</default> <technology>...</technology> </image> |
| element | inner class specifying an element, with two inner inner tags:
the name of an element as, say, <name>Archer</name> the number of these elements in the unit, for example <number>9</number> |
| obsolete | the name of the unit which renders this unit obsolete |
| forceObsolete | if set to true <forceobsolete/>), then the unit becomes obsolete as soon as the obsoleting unit becomes buildable, even if it is not as efficient as this one. |
Subtags are:
| name | the name of the element, eg Warrior |
| flavorText | text to be displayed in the encyclopedia |
| default | the name of another, previously specified element to be used as the default for
this element. Example: This means all values of the element are set to the default element value. For instance if BigWarrior is a better version of Warrior, instead of repeating all the Warrior values and having to change them both in Warrior and BigWarrior, you can say that BigWarrior defaults to Warrior, and then override the one or two figures you're interested in. |
| category | must be one of: foot, horse, wheel, lightwheel, track, coastal, naval, air() |
| manpower | a number setting the number of people in this element |
| attack | element attribute affects the amount of damage dealt. |
| defense | element attribute reduces the amount of damage taken. |
| movement | element attribute affects strategic speed. |
| distance | element attribute affects both damage at non melee range and support fire. |
| armor | element attribute reduces damage taken, can be countered by armorpen. |
| armorpen | element attribute reduces opponent armor. |
| boardspace | element attribute is the amount of personnel that can be carried by one personnel of this element (used for specifying transport ships capacity). |
| health | element attribute |
| morale | element attribute affects the chance to flee during a fight. Also, low morale elements will disband themselves earlier when severely damaged. Morale should be in a 0-20 value range, with 10 as an average. |
| mobility | element attribute affects speed during combat, particularly speed at which the element can close range or stay at long range. |
| flankereffectivity | element attribute affects the efficience of the element when flanking (outnumbering) opponent. Must be at least 1. |
| dispersion | element attribute represents the dispersion of the element, which in turns determines its frontage in fights: An element with dispersion of 2 will face two elements of dispersion 1 in clsoe combat. Dispersed elements should have better defense against area attacks (bombs...) |
| cost | cost of the element |
| order | Allows the unit to perform given order. The orders used include: Attack, Garrison (no effect now), Skirmish (allows better deployment of units in early combat phase), Carry (to carry other elements), Build (to be able to build field fortifications, also means this element will try to avoid close combat), Support (means the unit can perform support fire and willl try to do so rather than fight hand to hand), Scout (allows better reconnaissance, giving an edge in combat scouting phase) |
| civilization | optional. If present, only the civilization whose name follows can build the units containing this element. You can put several civilization tags to allow building by several civilizations. |
Subtags are:
| value | the starting value of the attribute |
| technology | helper technology |
Subtags are:
| food | the amount of food required |
| production | the amount of production resources required |
| services | the amount of services required |
| decay | The rate at which food/production/services put in the building decays. |
| training | Cost of training the element by +1 on a 0-5 scale. Training is not used as of D7. |
| foodmultiplier | the amount of food required computed as this value times the default element food cost |
| productionmultiplier | the amount of production resources required computed as this value times the default element food cost |
| servicesmultiplier | the amount of services required computed as this value times the default element food cost |
| trainingmultiplier | Cost of training the element by +1 on a 0-5 scale computed as this value times the default element food cost. Training is not used as of D7. |
| upkeepfactor | Fraction of the total cost to be paid each turn in otder to maintain the unit. If this price is not paid, unit will be at 25% firepower. |
Subtags are:
| name | the name of the wall type |
| defense | element attribute |
| armor | element attribute |
| health | element attribute |
| cost | cost of the wall. Note it should have food = 0 and production = 4 times services right now because there is a single econ category to hold all walls costs. Changing the proportion will result in waste, putting food will never get the wall built. |
| sightrange | Sight range of the wall. This range is the range in squares that the wall unveils (no fog of war). Note that only the integer part is taken into consideration. |
| image | name of the image |
Subtags are:
| name | the name of the technology concerned |
| knowledge | the required knowledge |
Subtags are:
| name | the name of the technology concerned |
| baseknowledge | the starting knowledge required to help |
| knowledgeeffect | multiply effect by this amount times (knowledge - baseknowledge) |
Subtags are:
| default | the default value of the string |
| technology | One or many technology tags, each having three subtags, for the technology name like <name>Military Tactics</name>, the minimum tech level for it to have an effect, like <knowledge>15.0</knowledge>, and the value of the string, like <image>Archer</image>. The image tag is used because these strings will usually refer to image names. |
Inner tags are:
| name | the name of the civilization, eg Merovingian Empire |
| noun | the noun used for the civilization, eg Rome |
| adjective | the adjective used for the civilization, eg Carthaginian |
| selectable | no data, if <selectable/> is present, the civilization is selectable by the human player, otherwise it is computer controlled only |
| victorymessage | the message displayed if a human player wins with this civilization |
| defeatmessage | the message displayed if a human player loses with this civilization |
| recruitment | the proportion of the population in a square which will be available for recruitment into a military unit |
| dispersion | the proportion of the personnel of a disbanded unit which will wander away and not join the population of the square |
| government | the government of the civilization |
| highcommand | the high command of the civilization |
| ai | the artificial intelligence of the civilization |
| start | a location the starting square if the Player selects this civilization |
| city | a city in this civilization |
Subtags are:
| name | the name of the government, eg SPQR |
| province | an inner class defining a province |
| ruler | the ruler |
| regimename | the name of the regime |
Inner class is: <abbreviation>. Where there is no abbreviation the shortened form using just the <province> tag for the name may be used.
Subtags:
| name | the name of the province, eg Gaul |
| abbreviation | the abbreviation used in the map |
| capital | the name of the location of the capital |
| port | the name of the location of the main port |
These names and abbreviations are used when the map is defined.
Subtags:
| name | the name of the ruler, eg Scipio |
| age | the ruler's age |
| preferences | the preferences of the ruler |
Subtags:
| ruler | the preference for ruler |
| taxrate | the preferred tax rate |
| civilrights | the preferred civilrights level |
| ethnicdiscrimination | the preferred ethnicdiscrimination level |
| religiousdiscrimination | the preferred religiousdiscrimination level |
| slavery | the preferred slavery level |
| foreignpolicy | the preferred foreignpolicy level |
| privateproperty | the preferred privateproperty level |
| socialpolicy | the preferred socialpolicy level |
Subtags:
| plan | several plans dictating the military attitudes available to the highcommand, and the repartition of task forces between them. |
| army | several armies |
| wall | several walls |
Subtags:
| attitude | the name of the militaryattitude |
| proportion | the proportion of resources to be spent on this attitude. This is a relative figure, the meaningful figure being the ratio comparison with the proportion of other plans. |
Subtags:
| type | the type of wall or fortification |
| size | the size of the wall - the bigger the stronger |
| location | the name of the location of the wall |
Subtags:
| name | the name of the army |
| taskforce | a task force in the army |
| attitude | the attitude this army obeys. If not specified, an attitude based on the highcommand plans will be used. |
Subtags:
| name | the name of the task force |
| location | the name of the location of the task force |
| unit | a series of units within the task force. It is a series of tags containing either just the name of the unit (Legion, Phalanx, ...) or scenario unit tags. |
Subtags:
| name | the name of the unit used. |
| settlers | the name of the ethnicity of settlers attached to the unit. |
| population | the amount of settlers attached to the unit. |
| unitethnicity | the name of the ethnicity of the unit personnel. Useful when disbanding the unit and to compute whether the unit will join in riots when a given ethnic group revolts. |
Subtags:
| buildorders | the building orders that this ai will have. |
| allvisible | if set, means this ai will have explored the whole map. Useful if you want to give map knowledge to one articial intelligence in particular. |
Subtags:
| militaryProduction | A number between 0 and 1: The amount of production used on military units. |
| unitsProfile | a profile by units, describing each unit the ai wants in its army. Use this or abilityProfile instead. |
| abilityProfile | a profile specifying abilities rather than units. This profile will find units best fit to their role rather than relying on the unit names being hardcoded in the scenario file. This means units can change with time, which is not the case with unitsProfile. |
Subtags:
| production | A list of production tags. Each tag has two inner tags, order which is the name of the Unit, and level, which is a figure. The level fives a proportion. For instance if you have two production tags with levels 1 and 2, units will be built with twice as much cash used for the second unit. |
Subtags:
| production | A list of production tags. Each tag has two inner tags, ability which describes the Unit, and level, which is a figure. The level fives a proportion. For instance if you have two production tags with levels 1 and 2, units will be built with twice as much cash used for the second unit. |
Subtags:
| name | Name you give to this ability. A name will automatically be generated if none is provided. This is the only value which shouldn't be a figure. |
| attack | Whether the unit should be good at attacking. |
| breach | Whether the unit should be able to breach walls. |
| cost | Whether the unit should be cheap. You'll often want to include this tag in addition to others in order to provide cost-effective units. |
| defense | Whether the unit should have good defense. |
| movement | Whether unit should have a high strategic movement value. |
| support | Whether the unit should be able to provide support fire. |
Subtags:
| name | the name of the city |
| image | the logical image to display |
| location | the name of the location of the city |
| capital | no data, use <capital/> if this is the capital |
| ethnicgroup | one or more ethnic groups in the city |
While it is not required, it is highly recommended for the sake of clean and correct code to include all the diplomatic statuses within the <diplomaticstatuses> tag.
The tag for one diplomatic status is <diplomaticstatus>
The Inner classes are as follows:
| civilization | Specifies the name of a civilization involved. There should be exactly two instances of this tag. The reason being that there are two civilizations bound by any diplomatic status. If only one <civilization> tag is supplied, then the data is useless. If more than two are supplied, the status is considered to bind the first two civilizations. |
| strength | A string representing the status, can be any
one of the following three values (case independent):
|
<diplomaticstatus>
<civilization>Rome</civilization>
<civilization>Carthage</civilization>
<strength>-1</strength>
</diplomaticstatus>
The pairs of civilizations, for which the diplomatic status is not specified, will be assigned the default status of No Contact.
The inner classes for this tag are:
| location | the name of the location of the square |
| x | The x coordinate of the square -don't use if you used location |
| y | The y coordinate of the square -don't use if you used location |
| terrain | the map terrain of the square |
| province | the province name of the square |
| people | an ethnicity to add to the square, inner classes are <ethnicity> (with the name of the ethnic group) and <population> (with the population) |
Note that the map may overwrite these values if the map tag comes later in the scenario file. Similarly the square tag will overwrite the map it it comes after the map tag.
The width, height, and, for each row in the map a row tag, are compulsory (though a terrain could be specified using the square tag for each square in the map, this is unlikely to happen).
Currently available terrain (see the terrain.xml file) are, with their abbreviations:
Otherwise the entry for a single square should be four characters:
This system allows only a single ethnicity per square, however, others may be added using a square tag for individual squares.
Otherwise the entry for a single square should be four characters:
This system allows only a single economic special per square, which should be sufficient. The delenda scenario has an example (MPE 20030108)
Subtags:
| name | the name of the feature |
| image | the logical name of the image to use |
| location | the name of the location of the army |
Subtags:
| goodname | the name of the good, FE Food |
| basicgooditbecomes | All special goods, like gold are converted into one of the four basic goods (Food, Resources, Manufactured Goods, and Services). This tag specifies the basic good to which a special commodity is converted. The basic goods simply have themselves entered as <basicgooditbecomes>. |
| goodconversionrate | Sets the rate of conversion for a good into the basic good it becomes. This rate is only used for small amounts of a special good, and decreases for larger amounts. For the four basic goods this value should be set to 1.0. |
Subtags:
| sectorname | the name of the sector of the economy, FE farm, |
| sectoroutputname | the good that the sector produces, FE Food |
| techactivityname | sets tech activity to which RPs from this sector are sent, FE Food (which shows in the econ gui as "Food Tech") |
| techforproductivity | sets the technology that productivity in this sector is based upon. For now each sector can only be based on a single tech. FE Farming |
| yieldx | yield multiplier used in the production function that determines production in the sector. For most sectors this is one, but since production has 2x yield (because it requires another sector's output [resources in this case] as its input) this will be 2.0 for prod - perhaps others later |
| lowtechlaborexponent | Labor exponent used in production function in this
sector for a subsistence economy. Sum of low tech exponents for labor, sites and kapital must = 1.0 or the production function will have odd scaling properties with size of economy that are best avoided. |
| lowtechsitesexponent | Sites exponent used in production function in this sector for a subsistence economy. |
| lowtechkapitalexponent | kapital exponent used in production function in this sector for a subsistence economy. Kapital (capital) is investment put into an economic sector. Buying tools for farms is one example of increasing kapital in the farm sector. |
| hightechlaborexponent | Labor exponent used in production function in this
sector for a modern economy. Sum of high tech exponents for labor, sites and kapital must = 1.0 |
| hightechsitesexponent | sites exponent used in production function in this sector for a modern economy. |
| hightechkapitalexponent | kapital exponent used in production function in this sector for a modern economy. |
| lowtechcostf | Proportion of kapital (capital) cost investment for
the given sector in a subsistence economy that requires Food (f) Sum of low tech cost for food (f), production (p) and services (s) should = 1.0 for the system to function reasonably, although it is not as critical as for the exponents above. FE if you have: lowtechcostf = 0.2; lowtechcostp = 0.3; and lowtechcostp = 0.5 a purchase of one unit of kapital in the sector will cost 0.2 units of food, 0.3 units of Manufactured Goods, and 0.5 units of Services |
| lowtechcostp | Proportion of kapital (capital) cost investment in a subsistence economy that requires Production (p) [aka Manufactured Goods] |
| lowtechcosts | Proportion of kapital (capital) cost investment in a subsistence economy that requires Services (s) |
| hightechcostf hightechcostp hightechcosts |
Proportion of kapital (capital) cost investment for
the given sector in a modern economy that requires Food (f), Production(p) or Services(s) Sum of low tech cost for food (f), production (p) and services (s) should = 1.0 for the system to function reasonably, although it is not as critical as for the exponents above. |
| siteabbreviation | Single Character that represents sites for this sector when read in from scenario file. These are currently only needed for special goods since sites are set for basic commodities elsewhere. Use first letter of sector when possible, but almost any character, FE '1' can be used if necessary. Abbreviations are used in setting the Map economic special sites . |
Subtags:
| name | Name of the BuildableInfrastructure, will also apply to the InfrastructureInfo. FE "farm kapital" |
| cost | The cost associated with building a point of this infrastructure. The only parameters of cost generally used here are persistant, food, production, services and decay. Generally food + production + services = 1.0 should be maintained, although no great stability problems will be caused if this constraint is violated. |
| ordertypename | Name of the specific order type, "Phalanx" or "farm kapital". FE salt mine kapital |
| orderclass | High-level type of order, FE kapital.
Currently the list of high-level classes is restricted to the following.
Examples of all are available in econmics.xml.
|
| ordersubclass | (optional) Sub-class of the order, like "army unit" is a subclass of "military" (default is ""). Look in economics.xml to see what the valid sub-classes are for each high-level class. |
| hidden | (optional) Identifies which orders are hidden (not shown in GUI). FE true. (default is false, meaning orders are shown) |
| ordertypeitmasks | (optional) not implemented yet FE "gold mining kapital" masks "Special kapital", if we invest specifically in gold mines here, then we won't apply any overall government spending in any Special commodity production areaFE Special kapital (default is false) |
| genericorder | (optional) Generic orders are blanket orders like "invest in any Special". They order investment of the size specified for ANY order of the same class and subclass that is valid locally. FE see the "Specials kapital" order in economics.xml. It invests in any special commodity sector (gold, tin, cloths, salt. . .) present. |
The delenda scenario has an example (MPE 20030108)
Subtags:
| location | the name of the location for the merchant |
| cash | the starting capital of the merchant |
The tag depends on the actual event.
There are several classes of event. In particular there are general events, civilization events, location events (which are also civilization events). They are described in separate sections below.
In addition to the inner tags listed in these tables, every event can have <action> tags.
| afterturn | this has an integer parameter, and disables the event from being tested until after the turn specified by the integer |
| cancelcondition | this has a string parameter, the name of a condition which cancels this event |
| cancelturn | this has an integer parameter the turn on which to cancel the event |
| centerview | this is an action which centers the view on the given <location>, it is listed here, rather than with the actions because it always occurs first, before any other actions |
| name | this gives the event a name so some actions can refer to it |
| negative | this reverses the sense of the event test, so that the event is fired if the condition is not met |
| turnevent | event fired at the end of the turn specified |
| yearevent | event fired at the end of the year specified |
| eventjoin | contains a series of inner events (any from this table), is fired if any of the inner events has occurred |
| eventunion | contains a series of inner events (any from this table), is fired if all of the inner events has occurred |
| eventnegativejoin | contains a series of inner events (any from this table), is fired if any of the inner events has not occurred |
| eventnegativeunion | contains a series of inner events (any from this table), is fired if all of the inner events have not occurred |
| buildunitevent | event fired by building a particular type of unit.The event should have inner class <unit> (the unit archetype name). <civilization> is optional. |
| civilizationsizeevent | event fired if the civilization reaches the <size> given in the inner tag |
| conditionevent | event fired if the condition <condition> exists. <civilization> is optional. |
| destroyarmies | event fired if the civilization has no armies. <civilization> is mandatory. |
| technologyevent | event fired if the technology <technology> has reached the <level> (level is a floating point number). <civilization> is mandatory. |
| controllocation | event fired if any location is controlled. If the civilization is specified, it must be the controlling civilization. If the civilization is not specified, any civilization will fire the event. |
| isfoggedevent | event fired if any location is either hidden by the fog of war or visible (typically fired when it is first seen). The civilization is automatically that of the player. Since a unit may move 2 squares at once before events are checked, I want the event to be triggered when the location first becomes uncovered. |
| isvisibleevent | event fired if any location is visible. The civilization is automatically that of the player. |
| settledevent | event fired if the civilization settles any of the locations. |
| singlevisitevent | event fired if the civilization eneters any of the locations |
| unitcountevent | event fired if the civilization, in any of the locations, has a unit count equal to the integer parameter of the <count> tag |
| zeropopulationevent | event fired if any of the locations zero population. Civilization is not used |
The tag depends on the actual action:
| activateevent | activate an event. Inner classes are <event> containing the name of the event to activate, and an optional <delay> which has an integer parameter giving the number o fturns before the activation is to take effect |
| bulletin | display a series of HTML formatted bulletins. Inner classes are:
|
| displayaction | display a message immediately. The action should have inner classes <title> and <message> |
| enabletechnology | set a technology to active. Inner class is any <technology> |
| eventaction | set a new turn event in the future. The event can only set a named condition. Inner classes are <delay> (the number of turns to delay) and <condition> (the named condition to set) |
| giveresearch | set a technology to active. Inner classes are any <activity> and <amount> |
| removeeevent | remove an event. Inner class is <event> containing the name of the event to activate |
| removefeature | remove the named feature from its square. The name of the feature to be removed should be given in an inner <feature> class |
| savecondition | save a condition or series of conditions. Inner class is any condition. It is always a named condition |
| units | create a new task force. Inner classes are <location>, <civilization>, this special inner class is described below, <militaryattitude> (random choice if missing), and one or more of <unit> naming the archetype to use |
| productionaction | Changes the production orders for a civilization. Inner classes are <civilization> (name of the civilization), a list of <productionorder> giving the actual orders, and a <replace/> tag if the orders are not in addition to existing ones, nut to replace them. |
| addpopulationaction | Changes the population in a square. Inner classes are <ethnicity> (name of the ethnicity), <population> (amount of people to add), and <location> |
The productionOrder has two inner tags, both mandatory: <level> which must be between 0 and 1, is the proportion of resources to be spent, and <order> is a string giving the name of the order to be executed.
The <civilization> inner class is different from the main <civilization> class, though it has much in common. If the parameter is a single string, that is taken as the name of a civlization previously defined (in the scenario file). If, on the other hand, it has inner inner classes, it defines a new civilization. The inner classes are:
| name | the name of the new civilization |
| adjective | the adjective describing the new civilization |
| description | description of the new civilization |
Conditions are identified by their name. The name is the only characteristic it has.
The tag is <condition> and the only parameter is the name.
The tag is <victory> and the <win>, <lose> and <extermination> are the only inner classes, though <civilization> is allowed.
The <victory> tag can occur inside a civilization class (in which case the <civilization> tag should be omitted). If the <victory> tag is not in a civilization class and no civilization is specified, the win or lose conditions are global.
A game is always lost if the player's civilization is wiped out.
Scenario files are kept in the scenarios subdirectory.
This file specifies the size of the tiles used, and assigns logical names to the tiles. The <mapparameters> tag specifies the size of the images used. The size includes width, height and inter tile height, the latter being typically 2/3 of height and half of width. It must have the following inner tags:
| tilewidth | the width of terrain images |
| tileheight | the height of terrain images |
| intertileheight | the height between tiles (less than the tileheight to allow pseudo 3D terrain) |
This file allows a tag which assigns a logical name to an image. An image that is not listed in this file will not be recognized by the program.
One class, not used anywhere else, is used in this file. The tag is <image>. Each image code MUST have both of the following inner tags:
| name | the symbolic name of the image |
| gif | the actual file name, inluding an extension of .gif or .jpg or .jpeg |
A single class, not used anywhere else, is used in this file. The tag is <terrain>. Each terrain must have the following inner tags (unless marked as optional):
| name | the type of terrain, for example flat | mandatory |
| abbreviation | an abbreviation for the name, used in maps | optional, but always present |
| image | the symbolic name of the image to use | mandatory |
| rougher | the type of terrain, for example flat | optional |
| movement | a floating point number giving the movement multiplier for this terrain | mandatory |
| roadcost | the cost of raod building | if roads are possible |
| mobilityMalus | the malus to mobility on this terrain - also decreases attack strength. | mandatory |
| category | a troop category | optional, defaults to 1.0 if missing |
| farms | the default number of farms in the terrain | optional |
| resources | the default number of resources in the terrain | optional |
Inner classes are:
| name | the type of category, from the list above |
| movement | a floating point number giving the movement multiplier. If this is missing the category cannot enter this terrain |
| mobilityMalus | the mobility malus for this category on this terrain. |
The inner tags are:
| name | the name of the military attitude |
| random | weighting factor for this attitude if an attitude is randomly selected |
| owncapital | probability of moving to own capital |
| owncity | probability of moving to nearest own city |
| owncity | probability of moving to nearest own square |
| ownarmy | probability of moving to nearest own army |
| wait | probability of doing nothing |
| enemycapital | probability of moving to enemy capital |
| enemyprovince | probability of moving to enemy nearest province's capital |
| enemycity | probability of moving to nearest enemy city |
| enemycity | probability of moving to nearest enemy square |
| enemyarmy | probability of moving to nearest enemy army |
| merge | probability of merging with another TaskForce in the same square, or waiting if no taskforce is available. Important for the ai to be able to do some correct attacks later. |
The military attitude file also contains constant ai data, enclosed in the tag <AIConstants>
| breachFactor | This number represents how many times the defenders' strength the ai will try to put when attacking a besieged city. By default, worth 1. |
| aiConfidence | This is the confidence the ai has in a single fight simulation. When the sum of confidence for simulated fights reaches 1, no more simulations are needed. The smaller te number, the more the ai will ponder. Default value is 0.4. |
| MaxTaskForcesInSquare | Over this number, the ai will always consider mergeing idle task forces in the same square rather than giving them other orders. |
| moveBeforeReinforced | This is a multiplier applied to the 'none' order weight to the task forces that await reinforcements. |
The military attitude tag can also be placed in the scenario file.