Naming Names

Another interesting problem that arose during the development of Guns & Butter was the problem of creating names for the various provinces. Most game designers have approached this problem by compiling long lists of names for use in the game; I wanted something better. I found it in some algorithms developed as part of research in computer science. The easiest way to understand these algorithms is to recall the old Edgar Allen Poe story about breaking a code using frequency analysis. The code breaker knew that e is the most frequently used letter in the English language, followed by t, then s, and so forth down to x, the least frequently used letter. By comparing these known letter frequencies with the letter frequencies in his coded document, he was able to break the code.

Now take this process a step further. What if we could compile a table of frequencies of all letter pairs? How often does the letter pair aa occur in English? How about ab, ac, ad, and so forth? There are 676 such letter pairs; it would be a simple matter for a computer to scan a large English document and produce such a frequency table.

Now take it several steps further. Build frequency tables of letter triplets; there are 17,576 such triplets. We can even build a frequency table for letter quadruplets; there are only about half a million of those, no big deal for a computer to build.

The value of all this frequency-table building lies in turning the tables around and manufacturing words from them. For each letter of the English language, we have a frequency value that we can express as a number between 0.00 and 1.00. The sum of all the individual frequency values will be exactly 1.00. Now we pick a random number between 0.00 and 1.00. We start at the first letter in the frequency table, a, and compare its frequency value with our random number; if it is greater than the random number, we then use the letter a as the first letter in our new word. If the frequency value of a is less than the random number, then we move to letter b and add its frequency value to the frequency value of a, comparing the sum with the random number. Again, if the sum is greater than the random number, then we select b as our letter, but if it is less, then we move on to c, adding its frequency value to the sum, and so on until we have selected the first letter in our artificial name. Now we pick another random number and use it to select a letter pair (using the already-chosen letter as the first letter of the letter pair) from the letter-pair frequency table. Now we repeat the process with the third letter. After that, we use the letter-quadruples frequency table to select letters to complete a sliding quadruplet of letters.

The algorithm actually used was a bit more complex than this because it had to take into account some special considerations for the beginnings of words, and it had to terminate words neatly, not just cut them off. But these additional complexities are tedious and do not add to the instructional value of this tale.

LESSON 67

This algorithm can be used to generate any kind of sequence: musical notes, sequences of aerial maneuvers, moves in a game, etc.

I used one other trick to make the scheme work: I did not use English place-names as my source document for building my frequency tables. Instead, I used Mongol-Turkish place names. These are sufficiently unfamiliar to most Americans that I could get away with the occasional badly formed word. Here's a sample of the output of my name generator:

Murcherv, Baika, Koka, Baqabaidzh, Ildak, Alik, Orgingu, Kunkononog, Laqchokor, Adiqaibud, Mongandoda, Oghardaqta, Taisak, Kanbor

Interestingly enough, when I used place names from England, the results weren't so convincing people are too familiar with English place names to accept concoctions like "Grodgich."



Chris Crawford on Game Design
Chris Crawford on Game Design
ISBN: 0131460994
EAN: 2147483647
Year: 2006
Pages: 248

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net