home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xconq55.zip / xc5.5 / period.ms < prev    next >
Text File  |  1992-02-09  |  42KB  |  796 lines

  1. .SH
  2. PERIODS
  3. .LP
  4. Historical periods are the most complicated way to customize xconq,
  5. and can be difficult to get right.
  6. There are many hundreds of numbers,
  7. each of which must be in balance with every other.  At best, a mistake will
  8. result in a period whose winning strategies are quite simple;  at worst,
  9. \fIxconq\fP will hang or core dump.
  10. (\fIxconq\fP will make some efforts to check the numbers.)
  11. Although most historical periods are defined 
  12. in the period sections of mapfiles,
  13. one period is compiled into \fIxconq\fP
  14. (usually a version of WW II, since it is most familiar).
  15. Compiling other periods (using the utility \fIper2c\fP) is straightforward,
  16. and there is no problem with making unusual default periods for the
  17. program, but in practice, periods do not take very long to read.
  18. .LP
  19. The header of the period section has the form
  20. .IP
  21. \fBPeriod \fIextension\fR
  22. .LP
  23. where \fIextension\fP is a flag indicating whether the period info
  24. is to replace (= 0) or add to (= 1) any existing period info.
  25. .LP
  26. The remainder of the description is in a postfix language similar
  27. to Forth or Postscript(tm), but even simpler.
  28. \fIxconq\fP includes an interpreter
  29. for this language, and program execution results in a filled-in period
  30. description.  There is a compiler, called \fIper2c\fP; it is used
  31. to produce a C version of the period definition which is then
  32. compiled into \fIxconq\fP.
  33. .LP
  34. The objects of this language are quite simple.  There are only integers,
  35. strings, and vectors of integers.  Integers and strings have direct
  36. representation as tokens, as do symbols, while integer vectors must be
  37. constructed using square brackets or one of the predefined vector-returning
  38. words.  Tokens are always separated by whitespace, which means whitespace
  39. may \fInever\fP be part of a token (backslash may be used for this purpose
  40. at some future date).
  41. Thus, the syntax for a token is fairly simple:
  42. .IP
  43. token -> [+-]*[0-9][0-9]*[%]* | "[~"]*" | [~"+\-0-9].*
  44. .LP
  45. In other words,
  46. numbers are digits optionally preceded by +/- and followed by %,
  47. while strings are anything enclosed in double quotes, and symbols are
  48. anything else that is not white space.  A semicolon is the comment character;
  49. the characters from the semicolon to the end of the line are discarded.
  50. Numbers are limited to the typical range for signed shorts; -32768 to 32767.
  51. The percent sign % is just for readability (since many numbers are
  52. percentages), and its presence or omission has no effect on anything.
  53. .LP
  54. Numbers and strings merely get pushed on the stack, while symbols are
  55. assumed to be defined words.  The reader looks them up in the dictionary
  56. and executes the associated C function, if one is defined (otherwise, the
  57. symbol gets pushed).  Nearly all words take a fixed number of arguments
  58. from the stack and push nothing, although there are some exceptions.
  59. The program is terminated by the word \fBend\fP.
  60. .LP
  61. Integer vectors are useful for filling in large parts of arrays.
  62. They are individual objects, built using the words \fB[\fP and \fB]\fP.
  63. .LP
  64. Usage of these depends on the word, but typically words with two or more
  65. arguments may include two vectors among them.  For instance, the line
  66. .IP
  67. \fB [ 1 1 2 8 ]  [ i a b B ]  hp \fP
  68. .LP
  69. sets the hit points for four types of units;
  70. \fB1\fP for unit type \fBi\fP, \fB8\fP for unit type \fBB\fP, and so forth.
  71. .LP
  72. The words below generally follow some extremely regular patterns.
  73. Most one-argument words define things for the entire period.
  74. Most two-argument words define attributes of units or resources, and
  75. may be thought of one-dimensional array operations, while three-argument
  76. words usually fill in two-dimensional arrays.
  77. In the two-argument and
  78. three-argument cases, the first argument (deepest in the stack) is the
  79. value, while second and third arguments are indices.
  80. At present, there are no words with four or more arguments.
  81. .LP
  82. One-dimensional operations allow three cases of the four possibilities for
  83. vectors and scalars: scalar value and index(set), 
  84. scalar value/vector index (fill), vector value and index (mapping).
  85. Two-dimensional operations offer six of the eight possible combinations
  86. (encoded here with S for scalar and V for vector,
  87. in the order value,index,index),
  88. disallowing only a vector value with either two scalar or two vector
  89. indices (VSS and VVV), since these combinations are not very meaningful.
  90. The six other combinations are SSS (element set), SVS and SSV (row fill),
  91. SVV (array fill), VVS and VSV (row mapping).  All of these combinations
  92. are useful - see existing periods for examples of their use.
  93. .LP
  94. The following descriptions cover all the predefined words of the period
  95. language.  Most words correspond to period attributes, and
  96. thus have an associated default value; when not explicitly mentioned, the
  97. default is \fB0\fP.
  98. For arguments of type \fIbool\fP, both \fB1\fP and \fB0\fP or \fBtrue\fP
  99. and \fBfalse\fP are valid (an argument characterized as \fIbool\fP may
  100. still be a vector of 1s and 0s).  Arguments of type \fIn\fP, \fIn%\fP,
  101. and \fIn.01%\fP are all just integers.
  102. .LP
  103. First, there are some useful words not specific to period
  104. definition.
  105. .IP \fBtrue\fR 5
  106. .IP \fBfalse\fR 5
  107. Pushes a \fB1\fP and a \fB0\fP on the stack, respectively.
  108. .IP \fB[\fR 5
  109. Marks the beginning of a vector.  The following objects must all evaluate
  110. to numbers only.
  111. .IP \fB]\fR 5
  112. Marks the end of a vector.  All numbers going back to the last \fB[\fP
  113. are popped and collected into a vector, which is pushed back on the stack.
  114. .IP \fIvalue\ name\ \fBdefine\fR 5
  115. Define the string \fIname\fP to be a word
  116. that pushes the object \fIvalue\fP onto the
  117. stack.  This is especially useful for assigning names to vectors, for
  118. instance a vector of all cities or all ships.
  119. .IP \fBprint\fP 5
  120. Print the current contents of the stack onto standard output, surrounded
  121. by /* */.  Very useful for debugging!
  122. .LP
  123. The global period definition words.
  124. .IP \fIstring\ \fBperiod-name\fR 5
  125. Defines the name of the period that will be displayed on startup.
  126. Defaults to \fB"unspecified"\fP.
  127. .IP \fIstring\ \fBfont-name\fR 5
  128. Defines the name of the font that will be used.  This is not needed
  129. if bitmaps are being used instead.  Defaults to the name of the text font.
  130. See below for a discussion of bitmaps and fonts.
  131. .LP
  132. The words to define new kinds of units, resources, and terrain all add
  133. new words that push the number of their unit,
  134. resource, or terrain type onto the stack.  The numbering is in order;
  135. the first of each type will be numbered \fB0\fP.  Most of the period
  136. definition words use these values as indices when filling up arrays
  137. of numbers.
  138. .IP \fIchar\ name\ string\ \fButype\fR 5
  139. Define a type of unit.
  140. The arguments are unit character (a string of length one),
  141. full name, and a
  142. one-line help string.  The unit may thereafter be referred to by either
  143. its character (as a one-char symbol) or by its name.
  144. Things will not work if a blank or any other special characters (such as plus
  145. and minus signs) are used as a unit character.  Mixing terrain characters
  146. and unit characters is also a bad idea, since both may be used by a
  147. graphical display.
  148. At present, up to 30 or so unit types may be defined.
  149. .IP \fIchar\ name\ help\ \fBrtype\fR 5
  150. Define a type of resource, by both name and character, and supply a help
  151. string for it.  The characters must be distinct from unit characters,
  152. otherwise this word is identical to \fButype\fP.
  153. .IP \fIchar\ name\ color\ \fBttype\fR 5
  154. Define a type of terrain.  Unlike the other two definers, the terrain
  155. character does \fInot\fP become a new word, although the name still does.
  156. The character should be defined in the basic \fIxconq\fP font (the one named
  157. \fBxconq.onx\fP, in the X10 interface), if the
  158. period is to be used with an interface that needs it (monochrome X only,
  159. at this writing).  The color may be either approximate ("brown") or exact
  160. ("#334455"), but in any case, the interpretation is up to the interface.
  161. .IP \fBu*\fR 5
  162. Push a vector of all unit types in order.
  163. .IP \fBr*\fR 5
  164. Push a vector of all resource types in order.
  165. .IP \fBt*\fR 5
  166. Push a vector of all terrain types in order.
  167. .IP \fBnothing\fR 5
  168. Push the index of a non-unit onto the stack.  This word cannot be used for
  169. unit attributes, but it is useful for certain attributes whose values are
  170. unit types (\fBfirst-unit\fP, \fBfirst-product\fP).
  171. Use of this as an index with any word that sets unit attributes is
  172. guaranteed to cause nasty coredumps...
  173. .IP \fIstring\ unit\ \fBicon-name\fR 5
  174. Set the name of the icon for the given unit type.  If undefined, then
  175. the unit's character will be used in whichever font is being used for
  176. unit icons (which may even be the text font - works but not too attractive).
  177. Definition of an icon overrides any character in any font.
  178. As with the terrain, the exact interpretation of this word is up to
  179. the graphics interface - for instance, the curses interface ignores
  180. both the \fBfont-name\fP and \fBicon-name\fP words entirely.
  181. In X, the name is the name of a file in the usual bitmap format, as
  182. produced by the \fIbitmap\fP program.  The actual file name is produced
  183. by appending \fB".b"\fP for X10 bitmaps and \fB".b11"\fP
  184. for X11 bitmaps.  The X11 interface will also look for X10 bitmap files.
  185. .IP \fIterrain\ \fBdefault-terrain\fR 5
  186. Set the type of terrain to be substituted while reading a map
  187. with incomprehensible terrain characters.  Occasionally useful,
  188. if the set of terrain types is a subset of the standard set.
  189. .LP
  190. Initialization characteristics of a period are used only during synthesis
  191. of maps, sides, and units,
  192. which happens when they are not supplied from a mapfile.
  193. Periods that are used only with complete scenarios
  194. need not use any of these words.
  195. .IP \fIn%\ terrain\ \fBmin-alt\fR 5
  196. Set the minimum percentile of terrain elevations that result in the given
  197. terrain type.  Together with the other three words following, it is possible
  198. to subdivide all the possible altitudes and moisture levels into different
  199. kinds of terrain.  For instance, desert in the standard period ranges from
  200. sea level (\fB70 desert min-alt\fP)
  201. to high elevations (\fB93 desert max-alt\fP) but only
  202. in the lowest percentiles of moisture (\fB0 desert min-wet\fP,
  203. \fB20 desert max-wet\fP).  It is important that all percentiles be assigned
  204. to some terrain type, or the map generator will complain; when designing
  205. terrain combinations, it is helpful to make a graph with altitude percentiles
  206. 0-100 on one axis and moisture percentiles on the other.
  207. .IP \fIn%\ terrain\ \fBmax-alt\fR 5
  208. As for \fBmin-alt\fP, but set the maximum altitude percentile.
  209. Defaults to \fB100\fP.
  210. .IP \fIn%\ terrain\ \fBmin-wet\fR 5
  211. .IP \fIn%\ terrain\ \fBmax-wet\fR 5
  212. Set the minimum and maximum percentiles
  213. of world moisture levels that result in the given
  214. terrain type.  Deserts should range in the low percentiles (0-20), while
  215. rain forests should be high (90-100).
  216. The minimum defaults to \fB0\fP, while the maximum is \fB100\fP.
  217. .IP \fIn%\ \fBalt-roughness\fR 5
  218. Set a rather mysterious number that controls whether a random map tends
  219. toward large continents or archipelagos of small islands.  It must range
  220. between \fB0\fP and \fB100\fP.  Altitude roughness of \fB0\fP will result
  221. in a map with one large continent, while \fB100\fP produces dozens of tiny
  222. random islands, and drastic altitude variations from one hex to the next.
  223. Defaults to \fB80\fP.
  224. .IP \fIn%\ \fBwet-roughness\fR 5
  225. Set the "moisture roughness", which is like altitude roughness, but affects
  226. the distribution of wet and dry areas.  Defaults to \fB70\fP.
  227. .IP \fIterrain\ \fBedge-terrain\fR 5
  228. Set the type of terrain to fill in on the northern and southern edges of
  229. a map.  Best user-friendliness is to have a type that is scarce elsewhere,
  230. so the edges are not mistaken for normal terrain.
  231. .IP \fIdistance\ \fBcountry-size\fR 5
  232. Set the radius of a randomly-placed country, in hexes.
  233. The country is always hexagonal in shape, and the center hex is not counted
  234. in the radius.  The radius should be sufficient to accommodate all the
  235. initial units, without crowding them.  For radius r, the number of hexes
  236. is 3/4*(2r+1)**2.  Keep in mind that terrain may reduce
  237. the number of available hexes even further.
  238. If one type of unit can occupy another, then they are free to be placed in
  239. the same hex.
  240. Defaults to \fB3\fP.
  241. .IP \fIdistance\ \fBcountry-min-distance\fR 5
  242. .IP \fIdistance\ \fBcountry-max-distance\fR 5
  243. Set the minimum and maximum
  244. distances of country centers from each other, in hexes.
  245. These values are sometimes tricky to set properly.
  246. If too small, countries will mostly overlap;
  247. if too large, then attempts to use
  248. small maps will fail; if too close to each other, placements can also fail.
  249. Default to \fB7\fP and \fB60\fP hexes, respectively.
  250. .IP \fIunit\ \fBfirst-unit\fR 5
  251. Set the type of unit that player will be started off in.
  252. Setting this to \fBnothing\fP has the effect of giving every unit in
  253. the country to the player at the outset.  Production will not be
  254. set automatically, so this is not recommended for novices, who tend
  255. to find large numbers of units confusing at the outset.
  256. Defaults to \fBnothing\fP.
  257. .IP \fIunit\ \fBfirst-product\fR 5
  258. Set the type of unit that will be built automatically first.
  259. A "cheap" (quick to build) type is usually best,
  260. although interesting situations could result from, say, the
  261. automatic production of one atomic bomb at the outset (note that all sides
  262. start out in exactly the same way).
  263. Defaults to \fBnothing\fP.
  264. .IP \fIn\ unit\ \fBin-country\fR 5
  265. Set the number of units of the given type in a player's country.  These
  266. units are randomly scattered, with some bias towards the middle of the
  267. country, and subject to terrain limitations via the \fBfavored\fP parameter
  268. (see below).
  269. .IP \fIn\ unit\ \fBdensity\fR 5
  270. Set the total number of units appearing throughout the map, at the rate
  271. of one per ten thousand hexes.  The numbers of units appearing in countries
  272. is subtracted first,
  273. so that the final density of units is independent of the
  274. number of players.  If this value is nonzero, then at least one unit will
  275. appear on the map, even if the map is very small (i.e. the calculation of
  276. numbers rounds up not down).  Units not assigned to countries to meet 
  277. the quota set by \fBin-country\fP always become neutral.
  278. .IP \fIbool\ unit\ \fBnamed\fR 5
  279. Set a type of unit to get a random name during initialization.  The
  280. names are usually the names of towns,
  281. so this flag should be used judiciously
  282. (A battleship named "Wankers Corner" is only briefly amusing!).
  283. The value can also be set to \fB2\fP, in which case the unit name
  284. will be displayed by itself, without side name or unit type name.
  285. .IP \fIname\ \fBuname\fR 5
  286. Define the string \fIname\fP to be a plausible name for random assignment
  287. to an initial named unit.  The name will be included with any previously
  288. defined, including possibly ones in the compiled-in period.
  289. This behavior, which is unlike any other period word except for \fBsname\fP,
  290. is intended to ensure that each period need not define its own list of
  291. names.
  292. .IP \fBclear-unit-names\fR 5
  293. Reset the list of unit names.  This is appropriate if the compiled-in list
  294. is completely wrong for the period.
  295. .IP \fIn%\ terrain\ unit\ \fBfavored\fR 5
  296. Set the probability of the unit being on the given type of terrain at the
  297. outset.  The default of \fB0\fP is an absolute prohibition against placing
  298. the unit on that type of terrain, thus every period must specify at least
  299. one non-zero value for some terrain type and some initial unit type.
  300. (Note that this does not preclude a unit type with no favored terrain,
  301. but it must be able to occupy some other unit already placed.  In fact,
  302. this is a useful way to force one initial unit to start out inside another.)
  303. .IP
  304. This parameter is tricky to use properly, and not very flexible.  The problem
  305. is a widely differing favored terrains for initial units may be too
  306. constraining to work with the typical random map.  For instance, very few
  307. small countries will include both ice and open sea, or deserts and forests
  308. and swamps.  Failure to find such combinations will result in games exiting
  309. while still initializing, thus frustrating erstwhile players of the period.
  310. Best results will be had if the favored terrains are the same for all initial
  311. types of units, and the terrain types are common on random maps.
  312. (At present, the most-favored, or the lowest-numbered type among
  313. equally-favored terrains should be plentiful on the map;
  314. this is to get around a bug.)
  315. .IP \fIn\ \fBknown-radius\fR 5
  316. Set the area of the world known about, in those cases where the world is not
  317. already known.  \fIn\fP is measured in hexes,
  318. and represents a radius which will be seen around each of the starting units.
  319. .IP \fIbool\ unit\ \fBalready-seen\fR 5
  320. Set the type of unit that is or is not seen at the outset.
  321. This should usually be true of things like cities, independently of their
  322. \fBalways-seen\fP setting.
  323. .IP \fIn%\ resource\ unit\ \fBstockpile\fR 5
  324. Set the percentage of capacity for the given resource that each unit will
  325. start out with.  Defaults to \fB100\fP.
  326. .IP \fIname\ \fBsname\fR 5
  327. Declare the string \fIname\fP to be a plausible name for random assignment
  328. to a side.  The name will be added to the others already defined, including
  329. ones from the compiled-in period.
  330. .IP \fBclear-side-names\fR 5
  331. Reset the list of side names.  This is appropriate if the compiled-in list
  332. is completely wrong for the period, but if used, you must supply at least
  333. as many side names as there are possible sides (7 or so).
  334. .IP \fIn\ terrain\ \fBinhabitants\fR
  335. Set the number of inhabitants in each hex of a country with the given type
  336. of terrain.  The number is relative, and at present is only treated as a
  337. boolean value.
  338. .IP \fIn\ terrain\ \fBindependence\fR
  339. Set the "independence" of the inhabitants in the given type of terrain;
  340. how they react to enemy units in terms in attrition, supply, etc. [not implemented yet]
  341. .LP
  342. The first phase in a turn is devoted to spying.  This is the revealing of
  343. all or part of a side's unit positions to another randomly-selected side.
  344. It is controlled by only two parameters.
  345. .IP \fIn%\ \fBspy-chance\fR 5
  346. Set the percentage chance of spying occurring on this turn.  If the chance
  347. is low, then the player doing the spying will get a message, otherwise the
  348. display will be silently updated.  The player spied upon is never informed.
  349. Defaults to \fB1\fP.
  350. .IP \fIn%\ \fBspy-quality\fR 5
  351. Set the percentage of enemy units that will be seen when spying is
  352. successful.  Defaults to \fB50\fP (i.e. on the average about half of the
  353. side's units will be seen).
  354. .LP
  355. .IP \fIn%\ \fBleave-map\fR 5
  356. Can the units leave the map?
  357.  
  358. .LP
  359. The second phase in a turn determines any revolts or surrenders, attrition,
  360. and disasters.  Since these are (usually) rare events, the probabilities
  361. are set in one-hundredth percent increments.  Revolts happen anywhere, while
  362. surrender happens only if enemy units are nearby.  Attrition is the loss
  363. of single hit points, without actually destroying a unit, while disaster
  364. is the complete destruction of the unit (both of these depend on terrain).
  365. .LP
  366. Note that
  367. with 100 units in play, the lowest possible nonzero chance of 1 for a value
  368. still results in an occurence of that sort of
  369. disaster every 100 turns or so, so these parameters require a "light touch".
  370. .IP \fIn.01%\ unit\ \fBrevolt\fR 5
  371. Set the base chance for the unit to revolt spontaneously in that turn.
  372. This chance is reduced by better morale and maybe other things.
  373. .IP \fIn.01%\ unit\ \fBsurrender\fR 5
  374. Set the base chance for surrender to some adjacent enemy unit.
  375. Each enemy unit present adds to the chance by this amount.
  376. .IP \fIn.01%\ unit\ \fBsiege\fR 5
  377. Set the additional chance for surrender when the unit is completely
  378. surrounded by enemy units.  This is added to the basic surrender chance.
  379. .IP \fIn.01%\ terrain\ unit\ \fBattrition\fR 5
  380. Set the chance of a unit losing a single hit point while in the given
  381. terrain.
  382. .IP \fIn\ unit\ \fBattrition-damage\fR 5
  383. Number of hit points lost when attrition happens.  Defaults to \fB1\fP.
  384. Note that repair is in the following phase, and 1 hp of attrition damage
  385. might be repaired immediately, and appear not to have happened.
  386. .IP \fIstring\ unit\ \fBattrition-message\fR 5
  387. Set what to say when unit is hit by attrition.
  388. Defaults to \fB"suffers attrition"\fP.
  389. If the string is \fB""\fP, then the message will be suppressed entirely.
  390. .IP \fIn.01%\ terrain\ unit\ \fBdisaster\fR 5
  391. Set the chance of completely losing the unit while in the given terrain.
  392. Accidents should be restricted to definite hazardous situations, to go along
  393. with movement constraints - for instance, carriers in shallow water should
  394. move more slowly and have a nonzero accident rate.
  395. See random movement for another way to achieve similar effects.
  396. .IP \fIstring\ unit\ \fBdisaster-message\fR 5
  397. Set what to say when unit is lost in a disaster.
  398. Defaults to \fB"has met with disaster"\fP.
  399. .LP
  400. The next phase of a turn handles creation of new units and repair of damaged
  401. units.
  402. Units can only be created by certain other
  403. kinds of units, limited both by time and raw materials.  Also there are
  404. startup and research times.
  405. .IP \fIn\ unit2\ unit\ \fBmake\fR 5
  406. Set the time in turns needed for a unit of type \fIunit\fP
  407. to build one unit of type \fIunit2\fP,
  408. assuming sufficient resources to do so.
  409. .IP \fIbool\ unit\ \fBmaker\fR 5
  410. Set the unit type to be a "maker".  Makers always build unless
  411. explicitly idled, and may move while building.  If a period starts with
  412. no movers, then it needs at least one maker in the country, who will prompt
  413. for a unit type at the beginning of a game.
  414. .IP \fIbool\ unit\ \fBoccupant-produce\fR 5
  415. If true, then a unit may produce as the occupant of another unit.
  416. Default is FALSE.  Makers ignore this flag and always produce.
  417. .IP \fIn%\ unit\ \fBstartup\fR 5
  418. Set the extra time needed to build the first unit, if the maker was
  419. producing something else before.  Startup time should be higher for
  420. high-tech or large units, for instance to represent tooling or production
  421. pipeline startup.
  422. .IP \fIn%\ unit\ \fBresearch\fR 5
  423. Set the extra time needed for a side to build the very first unit of
  424. that type.  This time is in addition to the startup time for the first unit.
  425. Long research time is a good way to keep a unit type out of play for awhile.
  426. .IP \fIn%\ unit2\ unit\ \fBresearch-contrib\fR 5
  427. Percent of research on \fIunit2\fP to count towards \fIunit\fP.  All
  428. research contributions are summed and will never do more than
  429. eliminate research on a unit type.  Only completed research is counted
  430. (i.e., a unit must already have been produced).
  431. .IP \fIn\ resource\ unit\ \fBto-make\fR 5
  432. Set the total amount of a resource type needed to build a unit.
  433. This amount is amortized over the normal construction schedule, which
  434. means that extra resources are consumed by startup or research times
  435. (representing mistakes and experiments).
  436. .IP \fIn\ unit2\ unit\ \fBrepair\fR 5
  437. Set the time needed for the unit type \fIunit\fP
  438. to repair \fBrepair-scale\fR hit points of damage to unit type \fIunit2\fP.
  439. One of the two units must be able to occupy the other;
  440. It is also legitimate for a unit to repair itself.
  441. If the unit being repaired was crippled,
  442. its repair will require the same kinds and amounts of resources that
  443. were used to build it.
  444. .IP \fIn\ \fBrepair-scale\fR 5
  445. Set the "scale" of repairs, meaning the overall amount that individual
  446. repair rates are relative to.  So for instance a repair-scale of 4 means
  447. that a repair time of 2 results in the recovery of 2 hp/turn.  Defaults to 1.
  448. .LP
  449. The supply phase of a turn handles both the production of resources and
  450. their distribution via supply lines.  Resource production involves a
  451. three-dimensional array indexing unit type, resource type, and terrain
  452. type, but supply lines are measured only by length and resource type.
  453. Supply lines are always interrupted by enemy presence.
  454. .IP \fIn\ resource\ unit\ \fBproduce\fR 5
  455. Set the basic amount of each resource produced by each unit in one turn.
  456. .IP \fIn\ terrain\ unit\ \fBproductivity\fR 5
  457. Set the percentage productivity of a unit on a type of terrain.
  458. This is multiplied with the basic production rate to get actual
  459. production, so productivity of \fB0\fP completely disables production on
  460. that terrain type, and productivity of \fB100\fP is yields the maximum rate
  461. specified by \fBproduce\fP.
  462. .IP \fIn\ resource\ unit\ \fBstorage\fR 5
  463. Set the unit's capacity to carry each sort of resource.
  464. Amount carried does not affect unit's performance.
  465. When the value is \fB0\fP, displays for that type of unit will not mention
  466. this resource type at all.
  467. .IP \fIn\ resource\ unit\ \fBconsume\fR 5
  468. Set the amount of resources consumed by the unit in a turn, even if it
  469. doesn't move or do anything else.  This includes riding as a passenger.
  470. This only comes into play if the unit has used less than its base
  471. consumption while moving.  In other words, the total supply usage for
  472. one unit in one turn is max(#moves * to-move, consume).
  473. If the unit runs out of a resource that it must consume,
  474. it dies due to starvation.
  475. .IP \fIn\ resource\ unit\ \fBin-length\fR 5
  476. .IP \fIn\ resource\ unit\ \fBout-length\fR 5
  477. These two are used together to determine the length (in hexes) of supply lines
  478. between units.  The given type of resource can only be transferred from
  479. unit type A to unit type B if the distance is less than the minimum of
  480. the in-length of B and the out-length of A.
  481. For instance, the in-length
  482. for a fighter's fuel might be 3 hexes, while the out-length of fuel from
  483. a city is 4 hexes.  If the fighter's out-length is 0, then it will be
  484. constantly supplied with fuel when within 3 hexes of a city, but will never
  485. transfer any fuel to the city unless it actually lands there.
  486. An in- or out-length of \fB0\fP
  487. means that the two units must be in the same hex,
  488. while a negative length disables the automatic transfer completely.
  489. Long out-length
  490. lines should be used sparingly, since the algorithm uses the out-length to
  491. define the radius of search for units to be resupplied.  Supply lines are
  492. not affected by terrain at present.
  493. .IP \fIbool\ unit\fBconsume-as-occupant\fR 5
  494. If this is true, than this type of unit does not consume any supplies
  495. as long as it is an occupant on some transport.  This is useful for
  496. units such as planes which always consume fuel in the air but not on
  497. the ground.  This defaults to TRUE.
  498. .IP \fIn%\ unit\ \fBsurvival\fR 5
  499. Chance that a unit type can survive on no supplies.  The test is made once
  500. per turn.
  501. .IP \fIstring\ unit\ \fBstarve-message\fR 5
  502. Set what to say when unit has no more of some supply to consume.
  503. Defaults to \fB"runs out of supplies and dies"\fP.
  504. .LP
  505. The movement phase is the main part of a turn in \fIxconq\fP, and the only part
  506. involving interaction with players.  All combat happens during the movement
  507. phase.
  508. .IP \fIn\ unit\ \fBspeed\fR 5
  509. Set the maximum theoretical speed of a unit, in hexes/turn.
  510. If the unit cannot move on any sort of terrain, it will never be prompted
  511. about - thus every period should define at least one type of moving unit.
  512. .IP \fIn\ terrain\ unit\ \fBmoves\fR 5
  513. Set extra moves used up on each type of terrain. \fB0\fP indicates no
  514. decrease from theoretical max, \fB2\fP indicates a move into that type
  515. of terrain uses up 3 moves instead of 1, and \fB-1\fP indicates that
  516. movement on that type of terrain is not possible.
  517. Defaults to \fB-1\fP.
  518. .IP \fIn.01%\ terrain\ unit\ \fBrandom-move\fR 5
  519. Set the randomness of movement of a unit on the terrain.  This is different
  520. from disaster and attrition, since it is not always fatal, and happens only
  521. during attempts to move.  However, collisions with other units or with
  522. impassable terrain, due to random moves, are always fatal.
  523. .IP \fIbool\ unit\ \fBfree-move\fR 5
  524. Set whether the unit can move even if there is insufficient movement
  525. allowance remaining in this turn.  Defaults to \fBtrue\fP.
  526. (Most board wargames make this false - if you don't have enough movement
  527. points to meet the entry requirement for a hex, that's too bad.)
  528. Can be useful to make "double movement phases", if
  529. attack time is equal to movement allowance; a unit can only attack units
  530. that it is adjacent to at the start of the movement phase.
  531. .IP \fIbool\ unit\ \fBone-move\fR 5
  532. Set whether the unit can make exactly one move before dying (appropriate
  533. for rockets and other automatic equipment). [not implemented yet]
  534. .IP \fIbool\ unit\ \fBjump-move\fR 5
  535. Set whether a unit can jump over another unit to get somewhere. [not implemented yet]
  536. .IP \fIn\ resource\ unit\ \fBto-move\fR 5
  537. Set the amount of resource used by a unit to move one hex.
  538. The amount taken is independent of the terrain in the hex.
  539. If the unit is out of any movement resource, it is immobilized
  540. until it gets more.
  541. .LP
  542. Transportation-related parameters.  Capacity is measured both by number
  543. and volume of occupants.  For instance, if you wanted a transport to carry
  544. up to 8 infantry and/or armor, but no more than 4 armor units, then capacity
  545. for infantry should be 8 and capacity for armor 4, the volumes for each 
  546. should be 1, while the transport hold-volume should be 8.
  547. .IP \fIn\ unit2\ unit\ \fBcapacity\fR 5
  548. Set the basic carrying capability of a transport type \fIunit\fP
  549. for its occupants of type \fIunit2\fP.
  550. .IP \fIn\ unit\ \fBhold-volume\fR 5
  551. Set the volume capacity of a transport.  Volume measure is quite arbitrary,
  552. and is used only
  553. for comparison.
  554. The default value of \fB0\fP implies infinite capacity, volume-wise.
  555. .IP \fIn\ unit\ \fBvolume\fR 5
  556. Set the volume of a unit.  The volume of a unit may be smaller than its
  557. hold-volume, the code will not care about this.
  558. .IP \fIn\ unit2\ unit\ \fBenter-time\fR 5
  559. Number of moves needed to enter a transport.  This is a time measure;
  560. extra supplies are not used up.
  561. .IP \fIn\ unit2\ unit\ \fBleave-time\fR 5
  562. Number of moves needed to leave a transport; similar to \fBenter-time\fP.
  563. .IP \fIn%\ unit2\ unit\ \fBalter-mobility\fR 5
  564. Set the effect of an occupant on the transport's speed as a ratio of the
  565. transport's usual speed.  Defaults to \fB100\fP;  smaller values slow the
  566. transport, and \fB0\fP prevents it from moving entirely.  To simplify the code,
  567. only the effect of one (randomly chosen) type of occupant has this effect.
  568. If a transport has two types of
  569. occupants each of which alter its speed differently, the resulting transport
  570. speed will be unpredictable.
  571. The total slowdown is multiplied by the number of occupants of all types.
  572. .LP
  573. Seeing is an important part of \fIxconq\fP, and needs parameters to accommodate
  574. submarines, radar installations, and Indians hiding in the woods.
  575. The visibility of a unit and the intensity of viewing are computed separately,
  576. and compared to get the final decision on seeing something.  This doesn't
  577. allow for much differential between two types of units viewing a third,
  578. but that's life.  For units seeing things at a distance, the chances are
  579. interpolated linearly, from the best conditions (adjacent hex) to worst
  580. (maximum range).
  581. .IP \fIbool\ \fBall-seen\fR 5
  582. If true, then all sides see all of each other's units.  If secrecy unneeded
  583. (as in a board game), this will speed up the display process somewhat.
  584. .IP \fIn%\ unit\ \fBsee-best\fR 5
  585. Set the basic chance of one unit seeing any other,
  586. under best possible conditions.  Defaults to \fB100\fP.
  587. .IP \fIn\ unit\ \fBsee-range\fR 5
  588. Set the maximum distance in hexes at which the unit can see anything.
  589. Defaults to \fB1\fP (adjacent hexes only).
  590. .IP \fIn%\ unit\ \fBsee-worst\fR 5
  591. Set the chance of seeing a unit at the maximum range.
  592. Defaults to \fB100\fP.
  593. .IP \fIn\ unit\ \fBvisibility\fR 5
  594. Set the basic chance of a unit to be seen.
  595. Crippled unit is more visible, in proportion to hp loss.
  596. Defaults to \fB100\fP.
  597. .IP \fIn%\ terrain\ unit\ \fBconceal\fR 5
  598. Set the percent effect of terrain on seeing the unit.  This is subtracted
  599. from the basic chance, since it is a "concealment factor".
  600. .IP \fIbool\ unit\ \fBalways-seen\fR 5
  601. Declare the unit to be of a type that is always seen and up-to-date.
  602. This applies only to units whose underlying hexes have been seen.
  603. This is useful for units like towns,
  604. which are unlikely to disappear secretly.
  605. .LP
  606. Combat is part of movement, and has its own large set of parameters.
  607. The basic plan of combat is for attackers and defenders to hit each other,
  608. then attackers to attempt to capture.
  609. Success of a hit attempt depends on a number of attributes, including
  610. chances, terrain, and the availability of the correct sort of ammo.
  611. .IP \fIbool\ unit\ \fBmulti-part\fR 5
  612. Set a unit to be treated as an aggregate of smaller identical units.
  613. Affects various things. [not implemented yet]
  614. .IP \fIn\ unit\ \fBhp\fR 5
  615. Set the maximum number of hit points for each part of a unit.
  616. Defaults to \fB1\fP, may never be set any lower.
  617. .IP \fIn\ unit\ \fBcrippled\fR 5
  618. Set the hit point level below which the unit is considered to be crippled.
  619. Below this level, repair and construction ceases, supply production is
  620. reduced, maximum speed starts to decrease,
  621. and the bridging capability is disabled.
  622. .IP \fIn%\ unit2\ unit\ \fBhit\fR 5
  623. Base chance of a single attack by the type \fIunit\fP
  624. hitting the defender \fIunit2\fP, assuming the resources are available.
  625. If chance to hit is \fB0\fP, attacker cannot attack or defend itself.
  626. .IP \fIn%\ terrain\ unit\ \fBdefense\fR 5
  627. Set the decreased chance of hitting if the defending type
  628. \fIunit\fP is in that terrain type.
  629. Percentage is subtracted from base chance.
  630. .IP \fIn%\ \fBneutrality\fR 5
  631. Set the change in defense for neutral units.
  632. This is subtracted from chances to hit and capture, but the \fIn%\fP
  633. can be negative, which would make it harder to hit/capture.
  634. .IP \fIn\ unit2\ unit\ \fBdamage\fR 5
  635. Number of hit points that the defender \fIunit2\fP loses when hit by
  636. its attacker \fIunit\fP.
  637. .IP \fIn\ \fBnuke-hit\fR 5
  638. Minimum damage for a hit to qualify as a nuclear blast and be displayed
  639. appropriately.  Default value is \fB50\fP.
  640. .IP \fIbool\ unit\ \fBself-destruct\fR 5
  641. Declare that unit self-destructs when it attacks.  This eliminates some
  642. weird messages and hit chances.
  643. .IP \fIbool\ \fBcounterattack\fR 5
  644. When true, combat is two-way; the initiator of an attack is also hit by
  645. a counterattack.  Otherwise, the defender must wait to get its revenge.
  646. Defaults to \fBtrue\fP.
  647. .IP \fIbool\ \fBcapturemoves\fR 5
  648. When true, a captured unit can immediately be moved.  If false, then a
  649. captured unit can not be moved until the next turn.  Default is TRUE.
  650. .IP \fIbool\ unit\ \fBcan-counter\fR 5
  651. Like \fBcounterattack\fP, but applies only to particular unit types
  652. being attacked.
  653. Defaults to \fBtrue\fP.
  654. .IP \fIn%\ unit2\ unit\ \fBcapture\fR 5
  655. Set the base chance of the type \fIunit\fP capturing the defender
  656. type \fIunit2\fP.  This is conditional
  657. on both attacker and defender surviving initial hits, and is modified
  658. by morale and quality of both sides.
  659. .IP \fIbool\ unit2\ unit\ \fBbridge\fR 5
  660. True if the unit type \fIunit\fP can capture another unit
  661. \fIunit2\fP, even across impassable terrain.
  662. .IP \fIn%\ unit\ \fBchanges-side\fR 5
  663. Set chance that the given unit will change sides if captured.
  664. This is appropriate for units that are primarily hardware or
  665. otherwise indifferent to their fate.  Units that are captured and
  666. do not change sides become prisoners (prisoners are not implemented yet).
  667. .IP \fIn\ unit2\ unit\ \fBguard\fR 5
  668. Set the number of unit hit points required to garrison or guard a captured
  669. type \fIunit2\fP, whether or not the captured unit has changed sides
  670. (at present, it always does).
  671. The hit point loss is permanent.
  672. .IP \fIn%\ unit\ \fBretreat\fR 5
  673. Set the base chance that a unit will retreat rather than be hit.
  674. This choice depends on ability to move into an adjacent hex and on
  675. morale, quality, and fatigue.
  676. .IP \fIn\ resource\ unit\ \fBhits-with\fR 5
  677. Set the amounts of each resource used as ammo by the unit.
  678. .IP \fIn\ resource\ unit\ \fBhit-by\fR 5
  679. Set the amounts of each resource necessary to score a hit on the unit.
  680. This is correlated with the previous parameter to decide if right sort
  681. of ammo is available for an attack.
  682. .IP \fIn\ unit2\ unit\ \fBprotect\fR 5
  683. Set the level of protection that \fIunit\fP offers to \fIunit2\fP.
  684. Transports protect their occupants by only letting a percentage of
  685. hits get through.  Occupants protect their transports by reducing the
  686. chance of a hit and increasing chance of a counterattack.
  687. (The default of \fB0\fP implies terrible carnage if a full transport is hit.)
  688. .IP \fIn\ unit\ \fBcombat-time\fR 5
  689. Set the extra number of moves used by an attack.
  690. .IP \fIstring\ unit\ \fBdestroy-message\fR 5
  691. Set what to say when a unit is killed in combat,
  692. as an active verb for what the destroying unit has done to its victim.
  693. Defaults to \fB"destroys"\fP.
  694. .LP
  695. General characteristics are not really classifiable anywhere else.
  696. .IP \fIn\ unit\ \fBterritory\fR 5
  697. Set the territorial value of a unit.  Primarily used by machine players
  698. and win/lose conditions.
  699. .IP \fIn\ unit\ \fBmax-quality\fR 5
  700. Set the maximum quality achievable by a unit.
  701. .IP \fIn%\ unit\ \fBveteran\fR 5
  702. Set the effect of one point of quality on hit and capture chances.
  703. .IP \fIn\ unit\ \fBmax-morale\fR 5
  704. Set the maximum morale to which a unit can rise.
  705. .IP \fIn%\ unit\ \fBcontrol\fR 5
  706. Set the chance of a unit obeying its orders.  Defaults to \fB100\fP.
  707. When the unit does not obey orders, it makes a decision using the machine
  708. players' algorithm.
  709. .IP \fIbool\ unit\ \fBcan-disband\fR 5
  710. Set whether a 'D' disband command can be used to get rid of a unit.
  711. It should not be possible to disband a city, for instance, to eliminate
  712. it as a strategic target.  Note that the default of \fB0\fP effectively
  713. disables the disbanding command entirely.
  714. .IP \fIn%\ \fBefficiency\fR 5
  715. Units disbanded in a transport can have the resources used to build them
  716. reclaimed - this parameter sets the percentage that is actually obtained.
  717. .IP \fIbool\ unit\ \fBneutral\fR 5
  718. Set to \fBtrue\fP if unit can exist as a neutral.
  719. If \fBfalse\fP, then anything that
  720. would cause the unit to become neutral (revolt, surrender of owner)
  721. has the effect of removing it instead.  Defaults to \fBfalse\fP.
  722. .LP
  723. Miscellaneous words.
  724. .IP \fIn\ \fBhostility\fR 5
  725. Set the level of hostility exhibited by a population toward a unit
  726. from some other side. [not implemented yet]
  727. .IP \fBbegin{notes}\fR 5
  728. Declare the beginning of the designer's notes.  This word kicks in a
  729. special reader that absorbs all lines until it sees the line
  730. "\fBend{notes}\fP".  The intervening lines are saved as period notes and
  731. listed out in \fB"parms.xconq"\fP.
  732. The notes should rationalize the design and discuss features
  733. of special interest to the player.
  734. .IP \fBend\fR 5
  735. Marks the end of the period description.
  736. .LP
  737. Nearly all the elementary programming errors are checked, such as stack
  738. over/underflow, and
  739. as many of the period parameters as possible will be checked, although
  740. there is plenty of room for subtle loopholes.  You should think carefully
  741. about the consequences of each parameter, being particularly sensitive to
  742. degenerate winning strategies.  Most common are units that are too powerful,
  743. or that are built so quickly that they overwhelm any opposition.  The
  744. players should always be a little "hungry"; not able to get quite as much
  745. of units or resources as they would really like.
  746. .LP
  747. Although there are many interesting possibilities inherent in this
  748. period description language, you should avoid making the period too
  749. complex to be humanly playable.  The compiled form of the period description
  750. can involve over 16,000 individually settable numbers, each with an expected
  751. range of perhaps 100 distinct values.  It is clearly possible to spend many
  752. years exploring a single set of these numbers.  For more playable and
  753. enjoyable games, either pick a single aspect to treat in detail, or else
  754. do all aspects in a simplified way.  Aspects could include exploration,
  755. logistics, naval operations, "shoot-em-up", renditions of familiar board
  756. games or even some team sports (rugby for instance).  Another thing to
  757. keep in mind is that the introduction of a new type may have far-reaching
  758. consequences - a new unit type will need its interactions with \fIall\fP
  759. other unit types defined.  One approach is to introduce a new type as a
  760. slight modification of an existing type, then to share most of the
  761. definitions.
  762. .LP
  763. Something else to keep in mind is that the period parameters have been
  764. chosen for their ability to combine in interesting ways, rather than for
  765. obvious usefulness.  For example, past startup, the production rate for
  766. units is constant and unending.  But suppose you want to put a limit on
  767. the numbers of that type of unit?  One way is to define a resource that
  768. is essential for construction of that type, let the builder have an initial
  769. supply, but provide no way to get more of that resource.  When it runs out,
  770. no more units!  Another trick is to motivate an activity by making it a
  771. prerequisite to the basic builtin goal of defeating the other player.
  772. The age of discovery worked this way.  The kings of that time weren't
  773. interested in new lands per se;  they wanted exploitable possessions that
  774. could be used to get gold to buy armies big enough to defeat their neighbors.
  775. The period language could describe this situation almost exactly, by making
  776. gold a resource obtainable only by the capture of neutral mines thinly
  777. scattered over the map.  Be inventive!
  778. Studying the predefined periods should reveal a number of tricks.
  779. .LP
  780. Completely new periods usually have a number of bugs.  The tools are
  781. rather limited, but then most of the bugs are fairly obvious.
  782. The \fBprint\fP word is useful for examining the stack, and a number of
  783. errors (such as stack overflow/underflow) have messages.  Finding out
  784. where the problem occurred requires the use of the \fIxconq\fP debugging
  785. flag \fB-D\fP, which has the effect of listing out each period token as
  786. it is read.  This can also be used with the period compiler, which starts
  787. up faster; invoke it as \fB"per2c -D <newperiod.per"\fP.  The most serious
  788. problems with periods are play balance issues.  Some can be found out by
  789. watching a machine player, since its decisions are based on perceived values
  790. of the units.  The most subtle bugs can only be uncovered by extensive play
  791. interspersed with judicious alteration of parameters.  I find it useful to
  792. play for a while, then go over all the period parameters, thus avoiding
  793. tweaking one parameter only to find that it results in another being
  794. inconsistent.  Parameters interact in many ways - you should keep this in
  795. mind when experimenting.
  796.