Hi, I'm Henry. In 2012 I quit my job as a programmer at BioWare to spend a year making my own indie games. This blog is about what happened next...

Like Spaceteam? Want to support my work?
Join the Spaceteam Admiral's Club!

Bad Generation

Blabyrinth

The game is getting more stable and I'm steadily improving the generator. My day-to-day work often consists of: generating a random level, exploring for a few minutes and inevitably finding something broken, and then stepping through the construction algorithm one piece at a time to see what caused the problem.

I made a visualizer so I can see what it's doing at each step, here it is in action:

Generation Timelapse Visualization

The rooms coloured green in each step are the candidates being considered for placement of the scenery/item/whatever. The choices become more limited as rooms fill up or sections get blocked off due to a dependency (eg. can't put a key inside the section it unlocks). Sometimes there's only a single choice because a puzzle requires everything to be in one specific room.

Lately the most glaring issue is scenery groups and set pieces colliding with each other. Here's an extreme example:

Major Scenery Collision

There is some "scenery group layout" code that tries to place the scenery in sensible ways, but sometimes if there isn't enough space it just gives up. I actually don't know what happened here, it's never supposed to get this bad... :)

It seems like the obvious solution would just be to place some of the scenery in a different room, but occasionally there's a situation where something more complicated is required. For example, maybe the room has two secret passages, both of which require scenery-based "rituals" to unlock, and the neighbouring rooms are already full of other stuff. In this case I need to solve the collision at an earlier stage in the generation, before the 'scenery placement' step happens, with some kind of rule like "if there are two hidden doors in a single room, restrict the type of rituals that can happen there..."

Anyway, I'm gradually refining the process and before long these collisions should be rare (or at least handled gracefully) and I'll have a new set of problems to deal with :)

Another common problem is clues being unintelligible because they are cutoff/overlapping/badly-formatted/too-small/etc. Clues can contain all sorts of arbitrary text and symbols, and show up on oddly-shaped scenery, so I knew this would be a problem.

A Bad Clue

The solution here is usually (as with scenery placement) adding more restrictions about which clues can go where, rather than getting creative with text layout and trying to squeeze everything in where it doesn't fit.

But enough problems. Here's an example of a simple puzzle that works.

A Simple Puzzle

If you can't see the image, it shows a room with a numeric keypad and four statues with letters engraved on them. The statue engravings read "ENTY", "FIVE", "TWEL", and "VETW". It should be pretty easy to discover the secret code!

Music

One thing I'm not having a problem with is music. Phil has started sketching out the music tracks for the game and I'm really happy with how it's going. Here's a teaser of the main theme:

Space Out and Happy Holidays!

~ Henry