This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Improved feature namimg


I have checked in several improvements to the feature naming code.

First, you can now specify feature-namers for contiguous regions of a
certain terrain type, e.g. mountain ranges or deserts. It works like this:

(set feature-types '((mountains) (desert)))

(set feature-namers
  '((mountains mountain-names) (desert desert-names)))

(namer mountain-names (random "Alpes" "Andes" ... ))

It's important to use the real name that is shown on the screen
(ttype->name) if it differs from the symbolic name used by GDL (in most
cases they are the same). Thus, if you have specified a real name for your
terrain type:

(terrain-type semi-desert (name "semi desert"))

you write:

(set feature-types '(|semi desert|)

with no dash. The |whatever| is read as as "whatever" by GDL. It works
sometimes when quotation marks fail to work.

The old feature naming code for lakes and islands that considered only if a
terrain type was liquid or not still works (though all feature names of
this type have been renamed to plural, e.g. "lakes" instead of "lake").
Thus you can specify:

(include "ng-features")

(add sea liquid true)

(set feature-types '((lakes) (islands)))

(set feature-namers
  '((lakes default-lake-names) (islands default-island-names)))

If you are using these feature namers you have to define what terrain
type(s) are considered as "liquid" (default: none). All "liquid" terrain
types are counted as lakes and all non-liquid as islands.

The code uses a default cutoff (maxsize) of 30 cells for what is considered
lakes or islands. I have added two new feature types and namers: seas and
continents. Thus, you can also specify:

(set feature-types '((seas) (continents)))

(set feature-namers
  '((seas default-sea-names) (continents default-continent-names)))

A default minimal size of 31 cells is used in this case.

I addition, you can now specify your own min and max sizes for all named
features (previously, only max sizes were supported). It works by adding
one or two numbers (first minsize then maxsize) for each feature type:

(set feature-types '((seas 21) (lakes 1 20) (mountains 3))

If only one number is provided, it is interpreted as the desired minsize.
If no numbers are provided,the defaults are used. They are:

lakes and islands: minsize 1 maxsize 30
seas and continents: minsize 31 maxsize worldsize
terrain features: minsize 1 maxsize worldsize

Finally, if you specify a maxsize of 1 for terrain features, the code will
name every single cell of that feature. For example:

(set feature-types '((planets 1 1)))

will give unique names to each planet even if they are in adjacent cells.

To see how all this works, check out the standard game. I have added names
for seas, continents and the three terrain types forest, desert and
mountains. Forests and deserts must be at least 10 cells to be named, while
mountains have minsize 5 cells.

Hans





Hans Ronne

hronne@pp.sbbs.se



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]