Announcement

Collapse
No announcement yet.

Blueprint name generator using Markov chains

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Blueprint name generator using Markov chains

    I've been toying around with random name generators for a while, and recently I read about Markov chains.

    Markov chains is a way to take a list of names/words or anything really, find their patterns and create random elements based on these patterns. For names you would look at all names in a list and create a probability list based on how often a certain letter follows another letter/pair/triples of letters. You then pick a random letter pair and select the next letter based on the probability of this letter appearing after this pair in your list. Then you look at what are now the last two letters and repeat the process.

    That's a pretty simplified explanation, but markov chains are actually pretty simple. A benefit of using Markov chains for name generators is that you will generally generate names that sound similar to the lists they are based on. You can thus easily create custom name generators for French names, dwarven names, names of diseases etc.

    A drawback to the method is that you need fairly large lists of names for it to work properly. I've got a list of 100 names, and that's barely enough for it to work, and that's when I look at two letters at a time. It's recommended to use three letters at a time when generating probability lists and that would require even larger name lists. Blueprints are probably not the best fit for these sorts of things, as list generation is pretty slow even with just 100 names, but that being said I've thrown this together very quickly, so there's much room for improvement. Also, the slow part of the method is generating the lists, and they only need to be set up once, after which names can be generated quickly from the lists.

    Anyway, sometimes it works pretty well:
    Click image for larger version

Name:	ATK0qVu.jpg
Views:	1
Size:	12.3 KB
ID:	1155591

    Other times less so:
    Click image for larger version

Name:	6Fx1pVz.jpg
Views:	1
Size:	13.0 KB
ID:	1155590

    So like I said, much room for improvement (setting it up to import external name lists for one), but it's a fun little example of how to do simple random generation with blueprints. I might do something similar using C++ in the future. But for now, enjoy!

    LINK TO FILES (The relevant bluepring graph is in the level blueprint. Left click to generate new names)
    Last edited by Monokkel; 07-14-2015, 05:20 PM.
    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

    #2
    Hey, this is so awesome! You have no idea how much this has helped me ^_^ I put in about 200 Japanese male names and it worked absolutely beautifully. This really does allow for a huge amount of randomly generated names! Incredible, keep up the great work and thank you so much!

    Comment


      #3
      Really cool thing, thanks for sharing
      PS. vivivivivia is a beautiful name, what's wrong with it? ;D

      Comment


        #4
        For the vivivivivivia type cases, you could step through the generated string 2 chars at a time and search for the same substring elsewhere in the name and then regenerate it if you find too many duplicates. Of course a larger dataset would probably be enough. This site is an amazing resource for that: http://www.fakenamegenerator.com/order.php (you can download name sets in bulk for free)

        Really cool demo, thanks for sharing.
        Last edited by Hyperloop; 08-28-2015, 04:32 PM.
        Trevor Lee

        Comment


          #5
          Strange. Even though I'm subscribed to this thread I never got any notifications of comments. I thought it had simply garnered no interest, but I’m happy to see it was of use to people after all

          Originally posted by Vaultdweller47 View Post
          Hey, this is so awesome! You have no idea how much this has helped me ^_^ I put in about 200 Japanese male names and it worked absolutely beautifully. This really does allow for a huge amount of randomly generated names! Incredible, keep up the great work and thank you so much!
          Thanks! You can actually use markov chains for many things besides generating random names. If you use words instead of letters and sentences instead of words you can generate random poems, articles and many other things. A couple of fun examples are Garkov, which generates random Garfield comics based on multiple original comics and Jesus Markoving Christ, which generates random Jesus quotes

          Originally posted by Slavq View Post
          Really cool thing, thanks for sharing
          PS. vivivivivia is a beautiful name, what's wrong with it? ;D
          I’m considering it as a name for my first daughter, but I’m afraid people would assume she has a stutter.

          Originally posted by Hyperloop View Post
          For the vivivivivivia type cases, you could step through the generated string 2 chars at a time and search for the same substring elsewhere in the name and then regenerate it if you find too many duplicates. Of course a larger dataset would probably be enough. This site is an amazing resource for that: http://www.fakenamegenerator.com/order.php (you can download name sets in bulk for free)

          Really cool demo, thanks for sharing.
          Yeah, that's absolutely one way to prevent it. And that’s an extremely useful site. Thanks!
          Last edited by Monokkel; 08-30-2015, 05:09 AM. Reason: Added liks
          The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

          Comment

          Working...
          X