Python Forum
Fantasy Name Generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fantasy Name Generator
#1
This is a fantasy name generator I wrote as part of a fantasy combat game I'm writing for t_games. Well, okay, it's two lists. But making the two lists was a bit of effort and I thought others might want to make use of them. It's mostly European mythology or fantasy fiction, although I threw in some others if they fit the two syllable format. It's biased heavily toward men, but I did manage to include a few women (Eowyn, Isis, She-ra, ...). The sources are Wikipedia's Fictional Swordsmen category and the old AD&D Deities & Demigods book (and a few from memory).

import random

FIRST = ['A', 'Ag', 'Ar', 'Ara', 'Anu', 'Bal', 'Bil', 'Boro', 'Bern', 'Bra', 'Cas', 'Cere', 'Co', 'Con',
    'Cor', 'Dag', 'Doo', 'Elen', 'El', 'En', 'Eo', 'Faf', 'Fan', 'Fara', 'Fre', 'Fro', 'Ga', 'Gala', 'Has', 
    'He', 'Heim', 'Ho', 'Isil', 'In', 'Ini', 'Is', 'Ka', 'Kuo', 'Lance', 'Lo', 'Ma', 'Mag', 'Mi', 'Mo', 
    'Moon', 'Mor', 'Mora', 'Nin', 'O', 'Obi', 'Og', 'Pelli', 'Por', 'Ran', 'Rud', 'Sam',  'She', 'Sheel', 
    'Shin', 'Shog', 'Son', 'Sur', 'Theo', 'Tho', 'Tris', 'U', 'Uh', 'Ul', 'Vap', 'Vish', 'Ya', 'Yo', 'Yyr']

SECOND = ['ba', 'bis', 'bo', 'bus', 'da', 'dal', 'dagz', 'den', 'di', 'dil', 'din', 'do', 'dor', 'dra', 
    'dur', 'gi', 'gauble', 'gen', 'glum', 'go', 'gorn', 'goth', 'had', 'hard', 'is', 'ki', 'koon', 'ku', 
    'lad', 'ler', 'li', 'lot', 'ma', 'man', 'mir', 'mus', 'nan', 'ni', 'nor', 'nu', 'pian', 'ra', 'rak', 
    'ric', 'rin', 'rum', 'rus', 'rut', 'sek', 'sha', 'thos', 'thur', 'toa', 'tu', 'tur', 'tred', 'varl',
    'wain', 'wan', 'win', 'wise', 'ya']

def fantasy_name():
    return random.choice(FIRST) + random.choice(SECOND)
Output:
Uhgo Hasda Sonsek Elthur Bilba Elgen Galad Hegoth Magtred Shinwan
likes this post
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#2
Seventh Sanctum has a lot of great generators: https://www.seventhsanctum.com/generate....dwarfnamer

It looks like he's rewritten most (all?) of it to be server-side generated, but years ago, several (all?) of them were javascript based, and could be looked at to see how he does generations. And it's very interesting. Instead of combining various parts, he has rule engines that determine letter combinations (how often vowels can appear, what can be near a vowel, etc), along with rules governing how those various combinations can be combined to create full names.
Reply
#3
(May-31-2019, 06:58 PM)nilamo Wrote: Instead of combining various parts, he has rule engines that determine letter combinations (how often vowels can appear, what can be near a vowel, etc), along with rules governing how those various combinations can be combined to create full names.

I've done stuff like that. I was working on designing my own language for a while, and wrote code that would take letter frequencies and rules on letter combinations. Then it would create the frequencies for all possible three letter combinations with frequencies, including start and end of a word as characters. Then it would generate words by randomly picking three characters with the start of word character, weighted by the frequency table. Then it would get the next character with a weighted random choice based on the last two characters of the word. Repeat until end of word. I've previously written code that can take a corpus of words and generate those three letter frequencies, so you can make words that sound German, or Japanese, or whatever.

But this was just something silly for a game. Anyway, the sources I was using weren't big enough or consistent enough to get good letter frequencies.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020