rockym93 dot net

archive · tags · feed

Name of Thrones

13 April 201205:50PMthings

I've consumed all my Song of Ice and Fire in massive doses. I tend to plough through the books in one massive go, and then there was that one time we spent a whole day watching the entire HBO series in one screening. And while this approach does cause you to miss minor plot points, it's extremely conducive to noticing patterns.

Like, for example, how George R.R. Martin likes to name things. Like how all his character names are slight variations on regular names. Or how all his titles (Ser, Maeg) are all misspelled. Or how his castles all have compound words in them. This isn't a criticism. Names are important, and having consistent names is what creates a sense of cohesiveness in his world. And it just turns out that choosing a pattern and sticking to it is an efficient way of doing that.

That last one, it turns out, is pretty easy to codify. Which means... it's USELESS PYTHON TIME.

The core of the castle name is something like 'slightly abstract noun' + 'concrete placename noun'. Like Winterfell, or Highgarden. This gives a pretty uniform set of names.

s = s + random.choice(NAME1) + random.choice(NAME2)

But not all of Martin's names conform to this - Casterly Rock and King's landing come to mind. This variety is actually very easy to introduce. We can just put some entries in the NAME2 list which have spaces at the start, followed by a capital.

Why not write another rule to do this? It's easier, basically. But on the other hand, I've offloaded that complexity into the word lists, which now have their own rules. This came up in linguistics last year - when you're writing phrase structure rules, you have to decide whether you want broad rules and a detailed lexicon, or narrow rules and a simple lexicon. Only it's a bit more complicated than that. Probably best not to get into it.

So that gives us the central sort of name. What about the fluff surrounding it? "The ancient tower of Harrenhal", and such? Clearly we add another word list, and some glue to stick these to the name.

s = "The "
   if random.randint(0,1):
       s = s + random.choice(ADJECTIVE) + " "
   if random.randint(0,1):
       s = s + random.choice(NOUN) + " of "
   s = s + random.choice(NAME1) + random.choice(NAME2)

I added some extra random functions, because not all fortresses should be "The X Y of Z". That just looks formulaic. And actually, it's still too formulaic. Winterfell is always just Winterfell. So we need to make the whole construction randomly added.

front = random.randint(0,1)
   if front:
       s = "The "
       if random.randint(0,1):
           s = s + random.choice(ADJECTIVE) + " "
       if random.randint(0,1):
           s = s + random.choice(NOUN) + " of "
   s = s + random.choice(NAME1) + random.choice(NAME2)

That's pretty good. I still want more possibilities though, so I think I'll add one last option - to postfix a noun, instead of prefixing it, to give constructions like "Riverrun Keep". And I'll wrap it in a function, just to be neat.

def assemble():
       s = str()
       front = random.randint(0,1)
       if front:
           s = "The "
           if random.randint(0,1):
               s = s + random.choice(ADJECTIVE) + " "
           if random.randint(0,1):
               s = s + random.choice(NOUN) + " of "
       s = s + random.choice(NAME1) + random.choice(NAME2)
       if not front:
           if random.randint(0,1):
               s = s + " " + random.choice(NOUN)
       return s

(An interesting aside, at this point - I was just trial-and-erroring where I put my spaces, but then I realised that If I consistently put them at the end of segments in the front-y section, and at the start of segments in the end-y section, they'd work fine. Basically, the spaces go on the end closest to the core name. Again, could write a function just to do that, but it's easier just to remember where to hard-wire the spaces in.)

So this function can return, given a hypothetical fire-sigiled house:

It'd be perfectly possible to make that more complex. There's some interesting potential for stacking compound words, or recycling the word lists for one part as another (NOUN and NAME2 could be mixed fairly easily). But the more complex you mix your rules, the more likely you are to get dumb names like Flameflame Rockfortcastle the Ancient Flameflameflamefort of Flameflame Rock House.

Actually, that sounds pretty awesome.

I suspect their sigil would be this. But like, on a shield or something.

If you want to play with the magical nameword generate-o-tron, you can download it here. As always, you'll need Python. Enjoy.

read the comments

< Frequently Asked Questions Bored. >