Skip to content
21 June 32012 / Robin Wellner

A random alphabet

After reading Mechanic #152 – Pictograph Language on Three Hundred Mechanics, I had an idea. I’m assuming you’ve read the post by the time you’re reading these words. If not, this post might not make much sense to you.

I liked the idea, but while reading it, I had a different vision. The words “procedural generation” popped up.

Sean Howard’s idea was cool, but lacked replayability. Once you’ve deciphered the alien language, that’s it. Next time, playing the game provides no challenge.

But what if the language and alphabet would be completely new and fresh, every time you start a new game?

How would that work? How would you let a computer design an alphabet from scratch?

Here’s what I did:

They are sixteen points to form the scaffolding for thousands and thousands of possible alphabets.

It would work this way: between those points can be lines. On a sheet of paper, I drew the points and lines between them: eight straight lines and four circles. I simplified it to the following:

When generating a certain letter/character/radical of an alphabet, the algorithm basically goes by each of those lines and tosses a coin. Heads, the line is part of the character, tails, it’s not.

Below you can see an example of such a character. Of course, in the actual characters, you don’t see the points, only the lines.

After that, the brand new character is checked after several constraint rules, which can be swapped in and out easily:

  • Each character needs to have more than 2 but less than 10 lines. This makes sure the character has at least some body and is not a tangled mess of lines either. The chance of as few as two lines is actually incredibly small, especially with some of the other constraints, but I felt I needed to include the check anyway.
  • There are five sets of lines that cross each other. Make sure that for each pair no more than one is included in the character.
  • All lines must be connected to each other (or: the graph must have exactly one component (I’ve actually written an implementation for both formulations of this constraint)). This is a debatable one, and rules out characters that look like “i”, but I decided that this constraint improved how the generated characters looked.
  • Each character must be unique in the alphabet. I’ve never seen this constraint violated, because the number of possible characters is pretty large: without constraints, there are 238 = 274 877 906 944 possible characters. What the exact number is with these constraints, I don’t know, but it’s probably in the millions still. So as long as the number of characters in the alphabet doesn’t run into the thousands, it probably won’t be a problem — and it was never my intention to make alphabets so large.

So you might have noticed that none of the examples of characters above actually fit all constraints in their current state, so I’ve got a few ones which do:


If you have LÖVE (or SELÖVE, if you’re less trusting), you can download the generator and play with it. Press escape to exit, space for a new alphabet, and the arrow keys do things as well.

So now that I can generate a random alphabet, what’s next?

Well, we’ve got an alphabet, but not a language yet. So next would be assigning (arrays of) characters to semantic concepts.

I imagine some concepts would always be elementary and have a single character to represent them. Other characters are randomly chosen to have either one or more characters. I imagine some complex concepts would be composed of characters by semantically related concepts (for example, “forest” might be “tree” followed by “butt-load”).

Grammar production rules could be simple enough not to be a problem.

Since it’s supposed to be a dead alien language, the computer only needs to produce the language, never to consume it, which matters greatly.

Then I need to build a game around it.

Imagine waking in a strange world — a dead world. You don’t recognise the language the sentient inhabitants had used, but (as per the original) the dead aliens had the decency to label everything. That means you can find out the meaning of things. You get a sort of sketchbook to scribble guesses or discoveries in, to aid in your learning of the language.

That’s all I got so far. You might have noticed I did away with some parts of the Mechanic, in particular the speech part, because I think those are more appropriate for games featuring non-procedural content.


One Comment

Leave a Comment
  1. Mr. Noßody / Jan 18 2014 15:56

    Hi Robin!
    It’s me, Doctory, from the LÖVE forums!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: