Welcome, Guest. Please login or register.
April 19, 2024, 08:18:00 pm

ballp.it is the community forum for The F Plus.

You're only seeing part of the forum conversation. To see more, register for an account. This will give you read-only access to nearly all the forums.

Topic: Boots messes around with procedurally generated stuff and shares his results  (Read 13552 times)

Boots Raingear

  • BBQ Man-Pop
  • Administrator
  • CEO of Victor's basement
  • 1,109
  • 190
Makin' Names

Winter is approaching and, like every year about this time, I am feeling more inspired than usual to extend my (fairly limited) programming skills and do something kinda silly. Yesterday I was thinking about names. How hard can it be to write a program that takes in a list of regular names from a predominantly English-speaking region and use that to make new names that follow those popular patterns?

Since this is the internet, I'm about the 7000th person to ask that question, which has been answered many times, but that's not really an issue. It's just as fun to do something that has already been done and see how your results compare to other people. Turns out it's rather easy.

I can go into details about how it works if anybody wants, but for now I'll just skip to the end. I made a dumb thing that generates fake (well... occasionally real, but usually fake) names based on a database of baby names from Ontario, Canada ranging from 1917 to 2010. You can filter by sex or year range and get distinctly different names based on popular baby names from different times.

Here's the first 10 results from some different generation criteria (excluding real names):

1917 - 1937 female names
Velva
Linez
Rette
Eila
Arthur
Aliselly
Oelah
Phemilia
Osaline

1990 - 2010 female names
Rigitt
Ranjelissa
Eaghann
Arolina
Elaide
Hafsa
Rowynn
Haniela

1960 mixed gender names
Airen
Semargrei
Ectori
Nitalid
Olynnetta
Minial
Hylisa
Osalian
Elenny
Jamelodiego

2010 Male Names
Rrencer
Muaz
Bastanton
Asen
Aydin
Rmaile
Oukas
Organg
Erese
Jaxel
Minikit

So there's some problems with the beginnings of names. It likes to stick two consonants together. I know how I can fix that, which I guess I can do in the future if I find actual use for this. Bumpgrrl suggested that I can market this as a mobile app for people who have difficulty naming their D&D characters.

If you want to try it, here it is. Only works in Windows and requires .Net 4.0 framework on account of the SQLite library that I used. There's a variable there called "chain length". If you set that to 2 you'll get weirder names. If you set it to 5 or higher you'll get a lot of real names. 3 seems to be the magic number. Also it gets messed up around accented letters and hyphens. C# source is in there too.

Note: Yes, I know I am WAY overdue for improving the bulb stuff on the forums. I just really hate PHP and it's a bitch to test.
Emperor Jack Chick chai tea latte advancedclass cube abuser Chaymie

KingKalamari

  • Cephalopod Enthusiast
  • Paid
  • It's Samba time for Tambo & Weep Day for Urine Man
  • 1,157
  • 92
Why do all the early 20th century female names sound vaguely sexual?

Emperor Jack Chick

  • he/him
  • Ridiculist
  • Metal tyrant from hell
  • 3,193
  • 666
This is super cool. Thanks boots!

Alpha Starsquatch

  • bigfoot conservationist
  • Paid
  • back alley veterinarian
    • 521
    • 84
Why do all the early 20th century female names sound vaguely sexual?
KingKreepamari, October 23, 2013, 08:46:31 pm

They look like a porn star's nom de plume; oddly spelled and "exotic" yet still intelligible in English.

Zsa Zsa

  • Paid
    • 227
    • 69
This is really interesting. Ages ago I programmed a planet generator, which would use a string as the key to make planet surfaces for this little spaceship game I was working on. I figured your mixed gender names would fit these planets really well, so it inspired me to get the old code working on my laptop, and I made a few planets from the 1960s names you provided (and a Zsa Zsa at the top).

Good stuff. I might try and make the planet generating code independent of the game and incorporate the name generator into it later so you can all have a go.

Boots Raingear

  • BBQ Man-Pop
  • Administrator
  • CEO of Victor's basement
  • 1,109
  • 190
Good stuff. I might try and make the planet generating code independent of the game and incorporate the name generator into it later so you can all have a go.
Zsa Zsa, October 24, 2013, 07:12:49 am
Were you making Star Control?

chai tea latte

  • TheftBot is, simply put, a fully sentient robot for stealing automatic teller machines
  • Paid
  • (ATMs) from nearby convenience stores.
  • 5,783
  • -420
Man, this is super cool.


Zsa Zsa

  • Paid
    • 227
    • 69
Were you making Star Control?
Boots Raingear, October 24, 2013, 09:19:57 am

I was making quite a simple game, you could even play it on a scrabble board using different letters to represent different types of spaceship. But I taught myself programming and the cruddy code I wrote was quite hard to come back to after a long break. So I spent a lot of spare time playing around with it but never finished it. Oh well!

fluffy

  • Paid
  • free hugs
  • 1,255
  • 68
What algorithm did you use for the name generation? Markov chains should do a pretty good job of avoiding weird consonant pairings, especially if you bias the weights based on the position in the word, or look at a chain length of more than just the previous letter although that tends to also overfit the data.

Boots Raingear

  • BBQ Man-Pop
  • Administrator
  • CEO of Victor's basement
  • 1,109
  • 190
What algorithm did you use for the name generation? Markov chains should do a pretty good job of avoiding weird consonant pairings, especially if you bias the weights based on the position in the word, or look at a chain length of more than just the previous letter although that tends to also overfit the data.
fluffy, November 03, 2013, 08:18:27 pm
It's a rather basic Markov chain implementation. It looks at the previous 3 letters if possible but does not consider whether it is at the beginning of the word or not, which is where the double consonants at the beginning come from. If I wanted to make something a bit more consistent, I would probably try to decipher this code and rewrite it into something that is remotely human readable: http://roguebasin.roguelikedevelopment.org/index.php?title=Names_from_a_high_order_Markov_Process_and_a_simplified_Katz_back-off_scheme

edit: actually the order of the markov chain is an adjustable variable. I just usually run it at 3 to get something that looks interesting.

fluffy

  • Paid
  • free hugs
  • 1,255
  • 68
What I find helps is to treat word beginning and ending as a token, which enforces credible beginnings and endings. Or failing that, treat capitals and lowercase letters separately, since that also does a good job of forcing the first letter to be treated differently.

Boots Raingear

  • BBQ Man-Pop
  • Administrator
  • CEO of Victor's basement
  • 1,109
  • 190
I wasn't asking for help.
Lemon One Of The Crappy Pokemon That Nobody Likes