codersnotes

On Building Living Worlds September 14th, 2014

I always found it fascinating how humans seem to have this in-built desire to create new worlds.

For the past 4 years, Miguel Cepero has been running his Procedural World blog, chronicling his exploration of world-building. From a simple voxel landscape, through to L-system grammars for making voxel buildings, it's certainly an impressive effort, and worth going back over his post history to see it evolve.

No Man's Sky, scheduled for 2015

The upcoming game No Man's Sky has been lauded recently for it's use of procedurally-generated content. It certainly has some damn fine visuals. In this video they talk about how the game uses random seeds to build each planet, and how they use a set of algorithms to place content in the world.

Lords Of Midnight on the ZX Spectrum, 1984

This isn't by itself a new technique by any stretch. The ZX Spectrum classic Lords Of Midnight, (recently remade for iOS and Android with an amazing amount of respect and devotion to the original), is one of the earlier examples of using random numbers and simple algorithms to create a world bigger than the computer could otherwise store.

Mike Singleton crammed an entire world, with enemies, forests, mountains, towers, and more, into only 41KB. For reference, NOTEPAD.EXE is 189KB.

What sets Lords Of Midnight apart from countless other games of the time is it's complex mythology. To the player, this isn't just some randomly generated maze or fractal heightfield. The world is inhabited by characters, allies, foes. The back story dictates how these relationships came about, sets the reason for the quest, and lays out which of the multiple paths you'll take to complete the game.

It's not just enough to create a landscape. You need something to go in it too. You need a story. Lords Of Midnight, like many others, drew heavily on the works of Tolkien for it's inspiration.

Many game creators think that a procedural world means generating a random landscape, then sticking random things on it at random. But a world is more than just a collection of things.

You'll often see fantasy authors get that wrong. Did you ever read a book where they'll create some character called perhaps "Rag'na K'ptolth", with apostrophes flung at random throughout like some kind of Photoshop Apostrophe Lens Flare?

Or perhaps you played a game where they created "Tolkeinesque" names by automatically throwing random letter-pairs together? This is the complete opposite to how Tolkien crafted his world. There was nothing random about a single word or language he created.

Tolkien was foremost a professor of languages, and only secondarily an author. Nothing he invented was random. He considered languages inseparable from the mythology associated with them.

He wrote many letters over the years explaining to people parts of his world, and how he went about building it. In his 1955 letter to the Houghton Mifflin Co. (his publishers), he writes:

J. R. R. Tolkien, 1955 (emphasis mine)

All the names in the book, and the languages, are of course constructed, and not at random...

... what is I think a primary 'fact' about my work, that it is all of a piece, and fundamentally linguistic in inspiration. The authorities of the university might well consider it an aberration of an elderly professor of philology to write and publish fairy stories and romances, and call it a 'hobby', pardonable because it has been (surprisingly to me as much as to anyone) successful. But it is not a 'hobby', in the sense of something quite different from one's work, taken up as a relief-outlet.

The invention of languages is the foundation. The 'stories' were made rather to provide a world for the languages than the reverse. To me a name comes first and the story follows. I should have preferred to write in 'Elvish'. But, of course, such a work as The Lord of the Rings has been edited and only as much 'language' has been left in as I thought would be stomached by readers. (I now find that many would have liked more.) But there is a great deal of linguistic matter (other than actually 'elvish' names and words) included or mythologically expressed in the book. It is to me, anyway, largely an essay in 'linguistic aesthetic', as I sometimes say to people who ask me 'what is it all about?'

The way a language evolves over hundreds of years depends on what other cultures you have contact with. Nothing is named in isolation. For example, the town of York in England underwent several changes of name during it's lifetime:

Tolkien made over 20 different languages during his lifetime, each based on specific races and geographical areas. He created his world specifically to allow somewhere for his languages to evolve in.

One of the few games that seems to use this kind of history-driven approaches to world-building is Dwarf Fortress.

Hundreds of years of history being played out.

Dwarf Fortress starts by doing the usual things. A fractal landscape is used as a base. They then add a temperature map, rainfall projection, drainage, vegetation. Erosion is applied and then the world is populated with animals and people.

But what's somewhat unique is that the game then goes on to simulate an entire cultural history of the world. There's an absolutely fascinating write-up of it at polygon.com, but basically it simulates the creation of towns, conflicts with neighbors, the rise and fall of civilizations, every week, for 250 years. All before you even think about starting to play the game.

polygon.com

For instance, when you travel to certain cities in the game and speak to a merchant they might tell you that their leather caps are made in an elvish city half a world away. And it will be true. They really were made there, during world creation, and traveled to this market for you to buy before you even started playing.

It seems to me like many of the more successful attempts at world-building follow this basic theme: Invent the culture and situation first, and then discover what kind of world would be born out of that.

I don't know of any other procedural games that use the same kind of internal depth to world-building. Let us know of any you come across!

Written by Richard Mitton,

software engineer and travelling wizard.

Follow me on twitter: http://twitter.com/grumpygiant