Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: Compound City Names
Home

[Freeciv-Dev] Re: Compound City Names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Compound City Names
From: Erik Sigra <freeciv@xxxxxxx>
Date: Mon, 25 Sep 2000 18:46:48 +0200

Stan Shebs wrote:
> At the risk of being repetitive :-), Xconq has a generalized algorithm
> that you might want to consider.

No risk, I haven't heard this before. (Xconq seems to be the answer to
all my problems :-)

> The input is a grammar where the rules are optionally weighted to favor more
> common constructs.  The algorithm just randomly walks down the grammar,
> pretty simple.  Here's an example, from lib/ng-german.g:
> 
> (namer german-place-names (grammar root 100
>   (root (or 95 (name)
>              5 ("Bad " name)
>              ))
>   (name (or 40 (prefix suffix)
>             20 (both suffix)
>             20 (prefix both)
>              5 (prefix both suffix)
>             10 (syll suffix)
>             10 (prefix syll suffix)
>         ))
>   (prefix (or
>         schwarz blau grun gelb rot roth braun weiss
>         wolf
>         neu alt alten
>         salz
>         hoch uber nieder gross klein
>         west ost nord sud
>         ;; from real names
>         frank dussel chem stras mut
>         ))
>   (suffix (or
>         dorf torf heim holz hof burg stedt haus hausen
>         bruck brueck bach tal thal furt
>         ;; these aren't so great
>         ach ingen nitz
>         ))
>   (both (or
>         feld stadt stein see schwein schloss wasser eisen berg
>         ))
>   (syll (or 40 (startsyll vowel endsyll) 5 (vowel endsyll)))
>   (startsyll (or 30 startcons 10 startdiph))
>   (startcons (or b k d f g l m n r 5 s 3 t))
>   (startdiph (or bl kl fl gl 5 sl 3 sch 2 schl
>                  br dr kr fr gr 2 schr 3 tr 2 th 2 thr))
>   (vowel (or 6 a ae 2 au 5 e 2 ei 2 ie 6 i 3 o oe 2 u ue))
>   (endsyll (or 4 b 5 l 3 n 4 r 4 t
>                bs ls ns rs ts
>                3 ch 3 ck
>                lb lck lch lk lz ln lt lth ltz
>                rb rck rch rn rt rth rtz
>                ss sz
>                2 th tz
>   ))
> ))
> 
> The theory is that composite names are the most common, but as
> in real life, there are also some unexpected oddball syllables
> mixed in.  But the most important aspect is that you can adjust
> for real-life likelihoods, as well as constrain generation to
> follow any important syntactic rules for a language.
> 
> The code for this is in kernel/mknames.c, function gen_name
> 
> and gen_from_rule, about 2 pages in all.

This is the most elaborate solution I have ever seen. (I am not at all
familiar with the syntax.) It looks very promising.

Is it in a shared library that also Freeciv can use? If not, can it be
but into one? Many games could use such a library, and the developers
would get high quality city name generation without much effort, leaving
more time to work on things specific to their particular games.



[Prev in Thread] Current Thread [Next in Thread]