2009-09-11 Elite Names

I’m thinking of a system name generator for my upcoming Traveller UWP generator.

I was trying to write code in Perl, based on code in Python [1], based on code in C [2], reverse engineered from assembly code written for the BBC – the Elite random name generator. The fool that I was – I didn’t realize that just a a few posts later [3] somebody had done just that.

Then I started wondering: How the hell did this work? How much of the magic was just a pseudo random number generator? Clearly the algorithm was picking pairs of characters from the digraph string. There was an element controlling the length of the name, and that’s it? I tried it, but the names were less than stellar. Then I realized that the digraph string probably listed pairs that went together well. I should not be picking starting characters at random, I should be picking pairs at random. The result is this:

my $digraphs = "..lexegezacebisousesarmaindire.aeratenberalavetiedorquanteisrion";
my $max = length($digraphs);

sub name {
  my $length = 5 + rand(5); # 4-8
  my $name = '';
  while (length($name) < $length) {
    $name .= substr($digraphs, 2*int(rand($max/2)), 2);
  $name =~ s/\.//g;
  return $name;

for my $n (0..100) {
  printf "%3d. %s\n", $n, name();

Random names:

1. ertexebeis 2. cetiisar 3. marain 4. atsocezaat 5. biraza 6. tezaordi 7. beenes 8. orxeesle 9. quxeisis 10. errabiat 11. riquatis 12. inisered 13. diraanated 14. orquisbiqu 15. arvevein 16. lebereza 17. gemazaisen 18. inzadius 19. isbixebiti 20. vemama

Sounds good to me! ✌

And by changing the digraph, you can get different sounds, too.

my $digraphs = "fafemalunabararerixevivoine.n.q.pazizozutatetitotu..";

Results in this list:

1. zuravo 2. zobarati 3. zireqti 4. efare 5. votuqbain 6. vomafezo 7. fantaetu 8. xeinra 9. ferati 10. ribabata

I like it! 👌

More variation in name length?

  my $length = 4 + rand(7); # 4-8




Back when I was trying out StackOverflow (I later learned to dislike it), I tackled a similar problem about phonetic passwords. My solution would concatentate words from the dictionary. The more elegant answer that was accepted suggested a well known method using digraphs (maybe even trigraphs).

The digraph is a much better solution, and I think using a string as the data structure as you have done is not only sharp, but its also makes it easier to understand how it works.

AaronHawley 2009-09-16 22:21 UTC

The thing I really liked about the solution was how it uses the dot to produce shorter than expected words (if you use «..») and how you can generate three-letter syllables (if you use «.»). I thought of Japanese were you have combinations of the consonants k, s, t, n, h, m, b, s, z followed by a, e, i, o, u, ya, yu, yo (but no ye and yi), the vocals themselves, and the letter n by itself. You can represent that using the following:

my $digraphs = "kakekikokusasesisosutatetitotunaneninonuhahehihohu"
  . "mamemimomubabebibobusasesisosuzazezizozuyayuyoa.e.i.o.u.n.";

The only obvious problem is the placement of the single n at the beginning of a word, and the distribution of the syllables used. Not too shabby:

0. misakumeho 1. zukunahimi 2. misekusohi 3. hosato 4. nahokesu 5. titizobuha 6. keeyosuo 7. kimotizi 8. ihosikahi 9. misouisu

Ovious «n» endings, for example:

10. setanheo 34. bayonunyu 42. nhezase 57. hihezenin

AlexSchroeder 2009-09-16 23:03 UTC

All this reminds me of the Dada Engine.


Which famously functions for the Postmodernism Generator


AaronHawley 2009-09-17 01:30 UTC

Cool. That would be the way for a most awesome name generator. :)

AlexSchroeder 2009-09-17 07:35 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.