Procedural level architecture

One of the driving aesthetics of LIBRARY is to create structures that are surprising and replayable. Inspired by roguelike games and their non-digital precedents (such as card-based Solitaire), we want a game that produces emergent, unexpected challenges and experiences.

We are embedding this idea on several levels of the game, including the level architecture. Kristopher has a background in coding procedural cities and terrain, and he has been working with our resident architect Nathalie to create the algorithms that result in procedural spaces for our game levels. I wanted to write a post about the amazing work they are doing together (along with input from the rest of us).

Each level begins as a series of circles. We can set the number, size, randomness, etc of the circles that we want. The software creates a pattern that looks like this (it’s a screenshot from the level creation tool). The circles are actually half-sphere “bubbles” but we’re looking at them from a top-down view here.

The next step is to connect the initial circles with smaller circles – to form “doorways” between the main circular spaces.

Pretty, ain’t it?

These intersecting spheres are then translated into stacks of “books.” These piles of rectangular shapes are the essential building blocks of our game spaces. After the program has filled in contours and spaces with books, it looks like this.

The fact that we have such modular elements for building our spaces means that we can create very strange and unusual shapes. Compare the meandering and organic walls above with the usual boxes and lines of a dungeon crawl (screenshot from Nethack below).

Because of the many tweakable variables that Kristopher has exposed in the generation process and the modular nature of our book stacks, we have a tremendous amount of flexibility in creating different kinds of spaces. We have made tight labyrinths of tiny circular rooms, patterns of large swooping walls with occasional spaces to squeeze through, and graveyard-like grids of book stacks in vast open chambers. These are spaces that could only be created through this kind of algorithmic process, and it’s exciting to think about a final game in which we’ll be able to include all of these variations.

What do these spaces look like in play? Here are a couple of screenshots of a level in the current working prototype. We’re looking down with a 3/4 view on the central character. Please excuse the generic character model and the placeholder versions of the interface and other game elements.

The space above the character is a dead end – but there are passageways downward to the left and the right. In essence, we have room-like spaces, but ones that curve and flow more organically than the average videogame (or real-world) architecture. The negative spaces of the circular walls around a given “room” become the defining shapes of the corridors outside.

Here’s another section of the same level.

This space looks like it was formed at the intersection of a few of the circular bubbles, creating the curving wall on the left that fades into a couple of detached book stacks, and the squeeze spaces on the right that lead to a larger, more open chamber. The result feels like a space full of nooks and crannies that you want to explore.

Now about that black cloud hovering right behind the character… we’ll save that for another post.


Leave a Reply

Your email address will not be published. Required fields are marked *