10
\$\begingroup\$

I'm making a game (or planning to, at least) and to do that, I need a way to automatically generate names for the NPC "bosses" (long explanation and irrelevant here). Something like this is a good example of what I mean.

I have an idea that I can just build a database of names by nationality, maybe first/last pairs, and assign them randomly, with an ignored names list so I don't get something like Homer Simpson and get sued or something.

The problem with that is that I'd need to build up a massive database of names for that to work. It would either take forever or cost money, unless someone has a list of names available for free already.

I have another idea where I make random pairs of vowels and consonants, flip a few, and add them together, but a quick program that does that generated names like these:

  • Seermeecpa
  • Cime
  • Ofmiahwumafi
  • Gozidi
  • Effawided

(For anyone interested in the code, you can see it here)

These are... kind of a mouthful. Well, except "Gozidi" -- that one could work. Still, the success rate is clearly not very good.

Is there anything I could do to make the names sound nicer (see below), or should I start making that list? Can I somehow mimic the way humans decide if a name is decent or not, with at least some accuracy? I'd much prefer something like this to a lookup in a big list.

What I mean by "nicer" is that, instead of random combinations of characters (which it is, to be fair), things that sound like actual names. They can be from any culture (or sound like they are), real or imaginary, anything at all, so long as your stereotypical dumb, monolingual American like me can say 'em without too much trouble.

If you need extra clarification, go ahead and ask. I'm not really sure what to put here.

Addendum: So far as I can tell, there really aren't tags that fit this question all that well. If anyone who's been here longer can recommend some, that'd be awesome.

\$\endgroup\$
  • \$\begingroup\$ Unfortunately your question seems too broad right now. Different methods of name generation will suit different kinds of names - realistic (also, which culture?), fantasy, sci-fi, aliases etc. Each method has their own strengths and weaknesses - are you asking for a comparison, and on what criterion? How do you personally judge whether a name sounds "nice"? You can improve your question by narrowing it down along these lines. \$\endgroup\$ – congusbongus Jan 8 '15 at 2:30
  • \$\begingroup\$ Thanks! I'll edit it to make it clearer. What I meant, though, was just any name, and pronounceable to the average, monolingual American. Give me a moment and I'll toss that in. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 2:31
  • \$\begingroup\$ @congusbongus I think I fixed it. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 2:40
  • \$\begingroup\$ you could try and compose names using various prefixes and postfixes, e.g. the 'ith' from Smith could make names like qith, hith, kith which all sound somewhat reasonable and pronouncable, you could also get a list of names and chop them in half, then replace with the other half of another name. For example Matt would be Ma, and Josh would make Mash \$\endgroup\$ – Matthew Pigram Jan 8 '15 at 2:45
  • \$\begingroup\$ @MatthewPigram That still requires compiling a list of names, which is something I want to avoid. Still, it's a good idea, the pre/postfixes bit. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 2:54
14
\$\begingroup\$

Most name generators work via some variation of Markov Chain, which are fairly remarkable (remarkovle?) constructs that have many uses in games, as well as other domains.

The basic approach does invoke a list of some kind. These do not need to be fairly huge. The purpose of this list is merely to inform the algorithm what syllables are likely to be paired together for a given category of name.

This allows you to put together different lists for e.g. male names, female names, family names, or names for different cultures/regions/species.

The time you'll spend tweaking an algorithm that randomly assembles made-up syllables into a pleasing fashion is likely going to be more than you'd spend just generating a list of names that you think sound good and fit a common theme.

There are many lists of names available. Download the latest US census database for modern day names easily separated by age, gender, and ethnicity, or grab lists of old Norse names or the like. These are all quite easy to find via Google; that last link was literally my first hit for "list of norse names."

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ This and again this. Markov chains rule for names, as they can be trained with examples (feed it a database of names you want to sound similar to) and are even flexible in how closely they match the example names (2-letter chains? 3-letter chains? 4?). \$\endgroup\$ – Babis Jan 8 '15 at 13:17
  • 1
    \$\begingroup\$ +1 for the stupid pun. Also the great answer, but mostly for the pun. I'll be looking at the Census and seeing if I can't make a list of syllables to use. I'm probably going to end up accepting this, just because it mentions the terminology, as opposed to just describing it. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 13:20
3
\$\begingroup\$

Most names in languages follow a series of patterns. For example Russian or Greek names may have five or ten different prefixes, thus if you find a name ending with -ov you may suspect its Russian because it kinda fits the pattern.

If you want real names (or real like) I think you should start building your list (which shouldn't be so long) because analyzing real names of some languages, finding their pattern, and creating an algorithm to produce such names is not worth the effort in my opinion.

If you want random names that could be a name in some language, you could build a small list of rules to follow (like a subset of the above). Already, what you are doing is that: you made a rule about vowels and consonants. You could add a few more like surnames should end in these 10 syllables or some consonants can be followed only by vowels like 'q' followed only by 'u' and some others can be followed by other consonants like 's' followed by 't' or 'k'. Again, this is more to create some words that can be actually pronounced and feel a bit real than creating actual names.

Something that may be relevant is the way "Papers, Please" generates names. http://papersplease.wikia.com/wiki/List_of_names

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ I feel like this is the best I'm going to get, just from the sheer complexity of the problem. Thanks for the help, even if it's not what I was going for. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 2:54
  • \$\begingroup\$ In the Papers, Please example, it is noteworthy how the latest changelog entry is not about generating names, but about how to exclude some of the generated names, because they resemble names of real people (possibly not that important; while it may seem slightly confusing to users, there are just too many somewhat known real people to exclude all of their names), because the names resemble undesirable words (might also happen when just combining real first and last names), or because the names are copyright (possibly very relevant, depending on the legislation). \$\endgroup\$ – O. R. Mapper Jan 8 '15 at 8:19
  • \$\begingroup\$ I've changed which answer I accepted because Sean provided a link to a more detailed description, rather than an overview without it, and a link to a list of names I could look at. Thanks for the help, anyway. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 13:27
0
\$\begingroup\$

I think the easiest way to do this is to use an existing random name generator or an existing list of random names that meet your requirements. Then store it somewhere as a list. When you need a random name, just pick from the existing list at random.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ That's what I'm trying to avoid. I want to have a system that can make them on the fly, rather than having to have a list to pick from. Also, I looked for a preexisting list. The reason I said I'd have to make one is that I couldn't find one for free. \$\endgroup\$ – Fund Monica's Lawsuit Jan 8 '15 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.