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: Erik Sigra <freeciv@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Compound City Names
From: Stan Shebs <shebs@xxxxxxxxxxxxxxxxx>
Date: Mon, 25 Sep 2000 08:28:50 -0700
Reply-to: shebs@xxxxxxxxxxxxxxxxx

Erik Sigra wrote:
> 
> Hi,
> This has been discussed before but I think it is interesting enough to
> be discussed again. Hopefully more elaborate this time.
> 
> The thing is, I want COMPOUND CITY NAMES in Freeciv. Anyone who has
> played Transport Tycoon knows what it is and probably likes the
> concept.

At the risk of being repetitive :-), Xconq has a generalized algorithm
that you might want to consider.  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.

Stan
shebs@xxxxxxxxxxxxxxxxx



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