Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 74fbd0eb33bb08f719b79951bc4e329e > files > 80

xconq-7.5.0-1.20050612.5mdv2009.1.i586.rpm

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.39
     from ./xcdesign.texi on 12 June 2005 -->

<TITLE>Designing Games with Xconq - World and Area Forms</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_32.html">previous</A>, <A HREF="xcdesign_34.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
<HR>


<H2><A NAME="SEC144" HREF="xcdesign_toc.html#SEC144">World and Area Forms</A></H2>

<P>
The world consists of one <STRONG>area</STRONG>, which is regular in shape and
consists of a number of <STRONG>cells</STRONG>.  Each cell has a type of terrain
and a number of optional data values.  Each kind of per-cell data will
be called a <STRONG>layer</STRONG> of the area.

</P>
<P>
<U>Form:</U> <B><CODE>world</CODE></B> <I>[ circumference ] properties...</I><P>
<A NAME="IDX52"></A>
This form defines the properties of the world as a whole.

</P>
<P>
<U>Form:</U> <B><CODE>area</CODE></B> <I>[ width [ height ] ] [ restriction ] properties...</I><P>
<A NAME="IDX53"></A>
This form defines the playing area of the world.  The <VAR>restriction</VAR>
identifies how to get data for this area from subsequent forms that are
based on larger areas.

</P>

<UL>
<LI><A HREF="xcdesign_33.html#SEC145">World Properties</A>
<LI><A HREF="xcdesign_33.html#SEC146">Area Properties</A>
<LI><A HREF="xcdesign_33.html#SEC147">Layers</A>
<LI><A HREF="xcdesign_33.html#SEC148">Distances and Elevations</A>
<LI><A HREF="xcdesign_33.html#SEC149">Temperatures</A>
<LI><A HREF="xcdesign_33.html#SEC150">Winds</A>
<LI><A HREF="xcdesign_33.html#SEC151">Clouds</A>
<LI><A HREF="xcdesign_33.html#SEC152">User</A>
</UL>



<H3><A NAME="SEC145" HREF="xcdesign_toc.html#SEC145">World Properties</A></H3>

<P>
<U>WorldProperty:</U> <B><CODE>circumference</CODE></B> <I>dist</I><P>
<A NAME="IDX54"></A>
This property is the distance in cells around the entire world (as a
sphere).  Default is <CODE>360</CODE>.

</P>
<P>
<U>WorldProperty:</U> <B><CODE>axial-tilt</CODE></B> <I>n</I><P>
<A NAME="IDX55"></A>
This property defines the extremes of seasonal changes.
If this is positive and the sunlit region is dynamically changing throughout 
the year, then the sun starts at the vernal equinox.  If this is negative and 
the sunlit region is dynamically changing throughout the year, then the sun 
starts at the autumnal equinox.

</P>



<H3><A NAME="SEC146" HREF="xcdesign_toc.html#SEC146">Area Properties</A></H3>

<P>
<U>AreaProperty:</U> <B><CODE>width</CODE></B> <I>n</I><P>
<A NAME="IDX56"></A>
<U>AreaProperty:</U> <B><CODE>height</CODE></B> <I>n</I><P>
<A NAME="IDX57"></A>
These properties are the width and height of the world, as measured in
cells.  Allowable values range from 3x3 up to 32767x32767, which is one
billion cells!  If only one of these is given, then the other defaults
to the same value.  If neither has been given, then they default to
<CODE>60</CODE> and <CODE>30</CODE>, respectively.

</P>
<P>
In the case of a cylinder, the world wraps around in the x direction,
and the width is the diameter of the cylinder, while the height is just
the height in the usual sense.  A hexagon world is flat on the top and
bottom; its width is measured across the middle height, which is the
largest span, and height is the same as for cylinders.  Here are some
crude pictures, first of an 8x6 cylinder:

<PRE>
# # # # # # # #
 : : + + : : : :
: : : + ^ : : :
 : : : : : : : :
: : : : ^ : : :
 # # # # # # # #
</PRE>

<P>
This world is an 8x7 hexagon:

<PRE>
   # # # # #
  # : + + : #
 # : : + ^ : #
# : : + ^ : : #
 # : : : : : #
  # : : ^ : #
   # # # # #
</PRE>

<P>
There are two kinds of properties that an area may have: scalar values
such as latitude, and layer values such as terrain and elevation.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>latitude</CODE></B> <I>n</I><P>
<A NAME="IDX58"></A>
This property is the offset, in cells, from the equator of the middle of
the area (height / 2).

</P>
<P>
<U>AreaProperty:</U> <B><CODE>longitude</CODE></B> <I>n</I><P>
<A NAME="IDX59"></A>
This property is the offset, in cells, from the "Greenwich Meridian"
of the world.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>projection</CODE></B> <I>n</I><P>
<A NAME="IDX60"></A>
This property defines the mapping from the world to the area.  The
default value of <CODE>0</CODE> maps lat,long positions to x,y coordinates
directly (with the effect of stretching high latitude terrain
horizontally).  A value of <CODE>1</CODE> bends x coordinates in towards the
middle of the area, proportionally to the latitude (meridians will be
curved in a familiar fashion).

</P>
<P>
<U>AreaRestriction:</U> <B><CODE>restrict</CODE></B> <I>w h x y | <CODE>reset</CODE></I><P>
<A NAME="IDX61"></A>
This is a special subform that specifies that subsequent layers in an
area of size <VAR>w</VAR> x <VAR>h</VAR> will be offset by <VAR>x</VAR>,<VAR>y</VAR> and then read
into the actual area.  (This is useful for setting up a scenario that
needs only a subset of a full map.)

</P>
<P>
If the restriction specifies <CODE>reset</CODE> rather than four numbers,
it means to cancel the restriction and return to normal area layer
processing.

</P>
<P>
Note that an area restriction is not a property, and must always appear
before any properties in an area form.

</P>



<H3><A NAME="SEC147" HREF="xcdesign_toc.html#SEC147">Layers</A></H3>

<P>
<STRONG>Layers</STRONG> constitute the bulk of data about an area of the world.
Each layer assigns a value to each cell in the area; examples include
cell terrain, temperatures, elevations, and so forth.  Since there may
be many cells in a layer with the same values, each layer uses a common
run-length encoding scheme.  In this scheme, each horizontal band of
cells is a separate text string, and the contents of the string encode
individual numeric values, one for each cell.  The encoding uses the
characters <CODE>a..~</CODE> and <CODE>:..[</CODE> for 0 through 63, and decimal
digits followed by commas (or the end of the string) for all other
numbers.  An optional <CODE>-</CODE> is allowed, and indicates a negative
value.  Runs of constant value are prefixed with their length, in
decimal.  The character <CODE>*</CODE> separates run lengths from values
expressed as digits.  Thus, the string

<PRE>
"40adaa100,2*-99"
</PRE>

<P>
represents 46 values in all: 40 zeroes, a three, 2 more zeros, a 100,
and two -99s.  Although this format is quite unreadable, it has the
advantages of compactness and portability; the expectation is that most
layer editing will be done on-line.  Note that the run encoding is
entirely optional.

</P>
<P>
The following subforms at the beginning of layer data have special
effects.

</P>
<P>
<U>LayerSubform:</U> <B><CODE>constant</CODE></B> <I>n</I><P>
<A NAME="IDX62"></A>
This subform causes every value in the layer to be set to <VAR>n</VAR>.

</P>
<P>
<U>LayerSubform:</U> <B><CODE>subarea</CODE></B> <I>x y w h</I><P>
<A NAME="IDX63"></A>
This subform indicates that the layer data should be positioned at the
given rectangle in the layer.

</P>
<P>
<U>LayerSubform:</U> <B><CODE>xform</CODE></B> <I>mul add</I><P>
<A NAME="IDX64"></A>
This subform has the effect of first multiplying the raw value by
<VAR>mul</VAR>, then adding <VAR>add</VAR> and storing the result into the layer.

</P>
<P>
<U>LayerSubform:</U> <B><CODE>by-bits</CODE></B><P>
<A NAME="IDX65"></A>

</P>
<P>
<U>LayerSubform:</U> <B><CODE>by-char</CODE></B> <I>str</I><P>
<A NAME="IDX66"></A>
This subform specifies that the characters in <VAR>str</VAR> give the
encodings of values in the layer.  The first character in <VAR>str</VAR>
encodes 0, the second encodes 1, and so forth.

</P>
<P>
<U>LayerSubform:</U> <B><CODE>by-name</CODE></B> <I>name-list</I><P>
<A NAME="IDX67"></A>
[what is the syntax of name-list exactly?]
This subform is for generic worlds that are useful across multiple game
designs.  It has the syntax <CODE>((sym1 n1) (sym2 n2) ...)</CODE>, where
<VAR>symi</VAR> is either a symbol or number that is the real value in the
layer, and <VAR>ni</VAR> is the value used in the layer's encoding.  For
example, in the terrain layer, this allows for the matching of terrain
types by name, so that if, say, the "sea" terrain type was type #0 in
one game and type #4 in another, the world would have sea in all the
same places after it was read in.  In practice, only a few worlds are
this general.  If a value appears in the layer's data that is not
listed, that value will simply go into the layer verbatim.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>terrain</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX68"></A>
This property is the actual layer of terrain types for cells.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>aux-terrain</CODE></B> <I>terrain-type layer-data...</I><P>
<A NAME="IDX69"></A>
This property fills in values for borders, connections, and coatings.
For border and connection terrain, the value is a six-bit number
(0..63), with a bit turned on in each direction that there is a border
or connection.  For coating types, the value is the depth of the
coating.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>features</CODE></B> <I>feature-list layer-data...</I><P>
<A NAME="IDX70"></A>
This property specifies the nature and location of all geographical
features.  The <VAR>feature-list</VAR> is a list of lists, where each sublist
has the form <CODE>([<VAR>id</VAR>] <VAR>typename</VAR> <VAR>name</VAR>)</CODE> where
<VAR>id</VAR> is the numerical id referenced in the layer data (defaults to
feature's position in the <VAR>feature-list</VAR>), <VAR>typename</VAR> is a
symbol or string giving the general type of feature (such as
<CODE>continent</CODE>), and <VAR>name</VAR> is the name of the feature (such as
<CODE>"Asia"</CODE>).  If the name includes the string <CODE>"%T"</CODE>, then the
feature's type will be substituted at that position; so for instance the
name <CODE>"%T of Mexico"</CODE> with a type <CODE>gulf</CODE> results in a
displayed name <CODE>"Gulf of Mexico"</CODE>.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>material</CODE></B> <I>material-type layer-data...</I><P>
<A NAME="IDX71"></A>
This property declares the quantity of the given <VAR>material-type</VAR> in
each cell of the area.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>people-sides</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX72"></A>
This property says which side the people of each cell are on.  A
<VAR>side-encoding</VAR> of <CODE>exact</CODE> assigns 0 to independence (no side),
1 to the first side, and so forth; otherwise, the encoding is a list of
side names/ids and numbers.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>control-sides</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX73"></A>
This property says which side controls each cell.  The encoding is the
same as for <CODE>people-sides</CODE>.

</P>



<H3><A NAME="SEC148" HREF="xcdesign_toc.html#SEC148">Distances and Elevations</A></H3>

<P>
The unit of elevation is arbitrary, with its relation to cells defined by the
area's cell width.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>elevations</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX74"></A>
This property is the world elevation data itself.  If any elevation
falls outside the min/max elevation range for the terrain type of the
cell, then it will be truncated appropriately.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>cell-width</CODE></B> <I>elev</I><P>
<A NAME="IDX75"></A>
This property is the distance across a single cell, expressed as units
of elevation.  Defaults to <CODE>1</CODE>.

</P>



<H3><A NAME="SEC149" HREF="xcdesign_toc.html#SEC149">Temperatures</A></H3>

<P>
Each type of terrain has a temperature range in which it may be found.
Any calculation that would fall outside this range will be clipped.

</P>
<P>
The temperature can be set to have a given value at a given elevation.
All air temperatures will be interpolated appropriately.

</P>
<P>
<U>GlobalVariable:</U> <B><CODE>temperature-floor</CODE></B> <I>n</I><P>
<A NAME="IDX76"></A>
This variable is the lowest possible temperature.

</P>
<P>
<U>GlobalVariable:</U> <B><CODE>temperature-floor-elevation</CODE></B> <I>n</I><P>
<A NAME="IDX77"></A>
This variable is the value of elevation at which the temperature is
always at <CODE>temperature-floor</CODE>.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>temperatures</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX78"></A>
This property contains the temperature data itself.  If any temperature
falls outside the min/max temperature range, then it will be truncated
appropriately.

</P>



<H3><A NAME="SEC150" HREF="xcdesign_toc.html#SEC150">Winds</A></H3>

<P>
Winds are defined as having a nonnegative force and a direction.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>winds</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX79"></A>
This property contains the force and direction of the prevailing winds
in each cell.

</P>



<H3><A NAME="SEC151" HREF="xcdesign_toc.html#SEC151">Clouds</A></H3>

<P>
Cloud cover is defined as a layer over the terrain, with a bottom and
top and density for each cell.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>clouds</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX80"></A>
This property is the degree of cloud cover over each cell.  A value of
<CODE>0</CODE> corresponds to clear skies.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>cloud-bottoms</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX81"></A>
This property is the altitude above the ground of the bottoms of the
clouds.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>cloud-heights</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX82"></A>
This property is the vertical thickness of the cloud cover in each cell.

</P>



<H3><A NAME="SEC152" HREF="xcdesign_toc.html#SEC152">User</A></H3>

<P>
Advanced units' use of the surrounding area is recorded in the user
layer.

</P>
<P>
<U>AreaProperty:</U> <B><CODE>user</CODE></B> <I>layer-data...</I><P>
<A NAME="IDX83"></A>
This property indicates which unit is using which cells for production.

</P>

<HR>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_32.html">previous</A>, <A HREF="xcdesign_34.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
</BODY>
</HTML>