The International Simutrans Forum

 

Author Topic: City Name Generator  (Read 6108 times)

0 Members and 1 Guest are viewing this topic.

Offline dwpvdk

  • *
  • Posts: 29
    • DWPCo.
  • Languages: EN LA
City Name Generator
« on: February 18, 2014, 11:20:50 PM »
The stop names in Simutrans are hopelessly mediocre. Also, I don't like that you have to put in a certain citylist to have city names. I know this is asking a lot, but could it be possible to have a random name generator for the cities? The stop names could be diversified a bit as well (they seem to follow a very rigid pattern).

dwpvdk's city name generator idea:

1. It won't be just be a string of random characters. It is very simple to write a program to make words following the syllable pattern of English (so that the words sound English).

2. That syllable pattern is:

(s) + (C) + (r, l, w, y) + (V) + V + (C) + (C) + (C)

Where C is for Consonant, V is for vowel, and parentheses mean that the contents is not required.

3. Perhaps there could be a way to have a custom syllable pattern (I'm sure the Simutrans'ers from non English-speaking countries would not want English sounding names).

(C(y))V(V)(n)       for Japanese
(C)V(C)               for Quechua

4. The custom syllable pattern could be configured in a text file like so:

Code: [Select]
1                                                          //least number of syllables allowed
4                                                          //maximum number of syllables allowed
4                                                          //number categories of phonemes
C=bcdfghjklmnpqrstvxz                                      //possible consonants
V=aeiouy                                                   //possible vowels
A=rlwy
S=s
(S)(C)(A)(V)V(C)(C)(C)                                     //pattern

5. The resulting words could even be run through a sequence that attached a localizer suffix to the name.

ex. Yarks            (V)=y,V=a,(C)=k,(C)=s;
--> Yarksville, Yarksdale, etc.

ex. Dramel         (C)=d,(A)=r,V=a;(C)=m,V=e,(C)=l;
--> Dramelon, Dramelford, etc.

---------------------------------------------------------------------------------------------------------------------------------------------------

I know this is asking a lot from y'all, but I think it could be a fun project to mess around with. Your feedback, please!

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: City Name Generator
« Reply #1 on: February 19, 2014, 01:06:12 AM »
How would you stop it generating gibberish? Qwypazmr would be a valid name with this generator for example.

Offline dwpvdk

  • *
  • Posts: 29
    • DWPCo.
  • Languages: EN LA
Re: City Name Generator
« Reply #2 on: February 19, 2014, 01:39:34 AM »
kierongreen,

But would it occur that often. Such a name requires all the "possible" slots to be filled. Assuming that each possible slot had a probability of appearing of 1/2, it would be a chance of 1/128 for that dense syllable. Much more likely something that sounds decent will be emitted.

Even so, you can group the consonants into categories on place of vocalization (labial, labiodental, dental, alveolar, etc.) and provide all the rules in languages that prevent consonant clusters like "mt" that aren't allowed in English. We can generalize that rule to "no consecutive nasals /m/ and alveolars /t/". Such rules are widely available and easy to program.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5558
  • Languages: EN, NO
Re: City Name Generator
« Reply #3 on: February 19, 2014, 06:18:20 AM »
I prefer names that actually have meanings. In my opinion, Simutrans only needs more name parts to chose from. It also seems biased towards some names for some reason.

Ideally, the names should also fit the geography, but that is asking for a lot.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: City Name Generator
« Reply #4 on: February 19, 2014, 08:32:03 AM »
I'm not a linguist, but I'm sure you can program rules - the question is how complex would those be to generate large numbers of names which can be pronounced. The relatively simple examples you gave above are not sufficient. As to the odds - at the moment with the rules you gave above I'd say gibberish had a high probability of being generated - yes I chose a particularly awful sounding bunch of letters but there are many similar ones. My opinion is that with relatively simple rules that only create valid sounding words you are as well off just using lists as at present. Note that at present you do have the opinion of using a straightforward list, or one which combines different parts to create a larger number of names.

I'd support names being based on geography too - valleys, ridges, shoreside, lakeside, riverside and forests are all features that could potentially be identified.

Offline Simon Small

  • *
  • Posts: 10
  • Languages: en
Re: City Name Generator
« Reply #5 on: February 19, 2014, 01:05:19 PM »
The existing city name generator can create names like you suggest by joining together a first-part and second-part. These parts are held in texts &[0-9,A-Z]_CITY_SYLL, and %[0-9,A-Z]_CITY_SYLL, i.e. 36 different parts for each. Only 15 are populated at the moment, so the names can be made 'less mediocre' by adding more.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: City Name Generator
« Reply #6 on: February 23, 2014, 11:47:13 AM »
This is a common and solved problem. Look up Markov chains. I strongly recommend looking at how Battle for Wesnoth generates unit names.

Less short explanations:
1) Take a corpus of human-generated, viable names,
2) use it to build a probability table which maps prefix of N letters to probability of following letter,
3) use RNG to pick the letters according to said table.
(Side note - if you are familiar with grammars, you will immediately see that using a "string start" and "string end" symbols will help make the table simpler.)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5558
  • Languages: EN, NO
Re: City Name Generator
« Reply #7 on: February 23, 2014, 12:03:55 PM »
1) Take a corpus of human-generated, viable names,
2) use it to build a probability table which maps prefix of N letters to probability of following letter,
3) use RNG to pick the letters according to said table.

I'd modify 2 and 3 into:
2) use RNG to pick one of the names

Repeat step two until all cities are named. I assume here that there are more names in 1 than cities in a Simutrans map. Generating statistics needs more than a handful names, so I think that is a safe assumption for now.

Offline zook2

  • *
  • Posts: 321
Re: City Name Generator
« Reply #8 on: February 23, 2014, 07:05:05 PM »
How would you stop it generating gibberish? Qwypazmr would be a valid name with this generator for example.

That's actually a town in Wales.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: City Name Generator
« Reply #9 on: February 23, 2014, 08:08:34 PM »
That's actually a town in Wales.
The fact that googling Qwypazmr only returns this page as a result suggests otherwise :p But yes, I can see how the liberal use on consonants reminds you of Welsh ;)