When a player creates a new hero in Warman and doesn't type a name, the game generates one. The generated name needs to sound like it could be a real name, not a random string of characters, and not "Player_38271". It also needs to work across all supported languages, producing names that sound natural to speakers of each language.

Language Profiles

Each supported language has a LanguageProfile that defines the phoneme rules for that language. A profile specifies: minimum and maximum syllable count, and three PhonemeSet objects: one for starting syllables, one for inner syllables, and one for ending syllables.

Each PhonemeSet has three character pools: first (consonants that can start a syllable), middle (vowels that form the syllable core), and last (consonants that can end a syllable). Not every syllable position uses all three pools. A syllable might be just a vowel, or a consonant-vowel pair, depending on what characters are in each pool.

The Algorithm

The trick is in the phoneme pools. English starting syllables might allow "th", "br", "st" as first consonants and "a", "e", "i", "o" as vowels. Japanese syllables follow a strict consonant-vowel pattern with a limited consonant set. Korean profiles use the Korean phonetic structure. German allows heavier consonant clusters. Each profile is hand-tuned to produce names that feel native to the language.

START first K middle o last r from consonant/vowel pools + END first a middle t last h different pools per position = Korath EN DE ES JA KO PT RU ZH Profiles:
Name generation: phoneme pools per syllable position, one profile per language

Why Per-Position Sets Matter

The three-position split (start, inner, end) prevents names from starting or ending awkwardly. English names can start with "Kr" but shouldn't start with "ng". They can end with "th" but shouldn't end with "bv". By having separate phoneme pools for each syllable position, the generator naturally avoids combinations that sound wrong without needing any negative rules.

Inner syllables are the most permissive. They sit in the middle of the name where almost any valid syllable sounds fine. Start and end syllables are more constrained because they're what the ear notices first and last.

Keeping It Simple

The entire system is about 80 lines of code plus the language profile data. It doesn't try to be a linguistics engine. It doesn't parse grammar rules or model phonotactics formally. It just picks random characters from curated pools in the right order, and the curation does the heavy lifting. The result is names like "Korath", "Lissara", "Brivenox," names that sound like they belong in a fantasy game without being copies of existing names.