Tales of the Rampant Coyote

Adventures in Indie Gaming!

A Bag of Blocks – Tips for Generating Quality Procedural Content

Posted by Rampant Coyote on August 9, 2016

AppendixAStartAreasI guess my very first experience with “procedural content” – at least the one that stuck in my memory – was Appendix C of the 1st edition Advanced Dungeons & Dragons Dungeon Master’s Guide. Starting with an entrance template, you randomly rolled up to see what lay beyond every open section of the dungeon, and drew the results on graph paper, until you ran out of space on the paper. You’d modify it as you’d see fit, but it gave you an interesting map to work with.

All these charts did (combined with random monster & treasure generation) was build a map. There was no strategy or rhyme or reason… that was up to the human game master to give it some sanity, or a plot, or whatever else.

I was so intrigued by this that I actually created a BASIC program at one point to randomly generate a dungeon using this algorithm. It was all text-based instructions, complete with encounters and treasure, with something of a Choose-Your-Own-Adventure style decision point for moving from room to room. I consumed reams of tractor-fed printer paper and lots of ink for my dot-matrix printer creating these dungeons that were kinda-sorta suitable for solo play. It didn’t prevent rooms from crossing over each other and violating the laws of three-dimensional space, but unless I was mapping it to the graph paper, I didn’t notice.

telengard_dragonMy first experience with “procedural content” in an actual computer game was the game Telengard. Written by Daniel Lawrence and published by Avalon Hill, it featured a truly ginormous dungeon with two million rooms equally divided between fifty levels. Two million! This was on computers that maybe had only 32,768 bytes of memory (which still had to do such things as store and run the program itself, hold the operating system in memory, etc.). There was no way you could store about 62 rooms per byte even if you had all 32k to work with, so the dungeon was produced procedurally.

Nifty enough, the source code was in BASIC, which meant young learning programmers like me could break into the game and find out how it was doing what it was doing. This was something of a revelation for me.  The rooms were not randomly generated at all (it would still have to store all that data if they were) — there was an algorithm that defined each room based on its grid-based X,Y,Z coordinate. Now, what would happen when you were in the room or interacted with the permanent, algorithmically-generated features of the room (jewel-encrusted thrones, misty cubes, etc.) might be random, but the placement of exits and features were permanent.

Still, the high level of randomness in the game (as with its mainframe-based predecessors) meant that it was primarily an exercise in risk management. A good player would have a tiny subset of the map memorized to get to the levels they wanted to go, knew to avoid doing anything with potentially disastrous results. But beyond that, it was still pretty dang random. It grew old quickly.

Another influential “procedurally generated” game was my very first session of the Warhammer 40,000 wargame. With miniatures.  Our host pulled out a 6×6 foot plywood board where wooden blocks were glued down to form something of a city.  Then he took another bag of wooden blocks, and tipped it upside down over the board. Blocks fell out in a jumble all over the game space, and he said, “This is a ruined city, and your battlefield.” He assigned my brother and I to opposite ends of the board and had us fight. I guess with repeated fights on the same board, that dumped bag of blocks helped randomize the battlefield each time and keep things interesting. I thought it was very clever. The systems and the gameplay were already complete… the changes to the battlefield just added some variation.

Frontier_elite2_screenshotAfter that came some roguelikes, with serious improvements over my early Telengard experience, demanding greater skill and experience of the player to navigate randomly generated dungeons. And then there was Frontier, aka Elite 2. Like Telengard, Frontier had a fixed, unchanging galaxy, mixed with random events. It ran on much more powerful computers, a decade later than Telengard‘s platforms, but it was still so tiny the entire game fit on a single 1.44 megabyte floppy diskette.  My neighbor in the apartment below us was also hooked on the game at the same time, and we’d swap trade route information and stuff between us. For something like three months solid I played the crap out of that game. But eventually, I’d tried out all the ships I was interested in, tried different game styles, experimented with all kinds of different ways of making money, earned an Elite rating (best way: Buy the biggest starship and outfit it with really powerful shields, and let the bad guys crash into you.  Yeah, the combat and AI weren’t the best). I’d “played through” a failed hyperjump, which landed me far out into a totally unpopulated part of the galaxy, and I tried my best to make my way back to civilization, scooping fuel from gas giants and watching my ship gradually fall apart from lack of maintenance.

But eventually, it, too, got old. There was a certain point where I’d explored all of the game system and the procedurally-generated variations that were worth exploring, and I was done. That happens with every game with procedurally-generated content. It happens with games with custom, hand-generated content too, though.

daggerdungeonDaggerfall was a biggie for me. I don’t know how much time I spent on that one, but it was another game with fixed, procedurally-generated content mixed with randomized quests and enemies, plus some hand-made content. As impressive as Skyrim is (and it really is pretty dang impressive), there’s something to be said for a game of such epic scope built on procedural generation. The game covered something like 89,000 square miles, with around 15,000 unique locations (cities, villages, dungeons, etc.). I put as many hours into this one as I did its sequels (and then some), and even completed the main quest line. But again, I eventually came up against the limits of the procedural generation, encountered most of the quest variants, and got bored.

FTL-AE_iPad_SS1Since then… wow. From Dwarf Fortress to FTL to Din’s Curse to Grand Theft Auto to Elite Dangerous, procedural content has definitely grown and grown more interesting. But, as always, there are limitations. I’m comfortable with those limitations.

The important thing is that it’s not a panacea for content. Miles upon miles of endless hallways does not make a fun game. If anything, it makes the opposite. From my perspective, there are several things that need to be done to make procedural content interesting:

#1 – It needs to interact with interesting, deep systems. Like my Warhammer 40k experience, just navigating a ruined city with a random scattering of blocks would have been uninteresting. But in a battle with cover, lines of sight, indirect fire, range and movement limitations, and all that fun stuff against a determined opposing force, it became fascinating.

#2 – It needs to provide meaningful novelty. Once the player gets to the point where she thinks she’s seen all or most of all there is to see, the party is essentially over. The procedural content needs to keep providing interesting new concepts which are more than just cosmetic. There are several ways of doing this, from just having giant procedural generation systems, to progressively unlocking new sections of the content tree, to doling out hand-created content that couldn’t be created with the procedural tables.

#3 – Add continuous goals and progression. This may just be part of the systems (#1), but it deserves being called out. For goal-directed players out there, having a nice, continuous stream of missions or quests that seem to be taking them forward in the game rather than just being endless make-work will really give the procedural content an extra layer of context.

#4 – Mix with Story.  Whether the story is procedurally generated (rare) or hand-built, as the story context changes, so does the related content.  You may battle the same ninja, but in one case he might be your mentor who has cared for you since you were a child, in the next it’s a random super-thug, and in the third it may be the evil boss who slew your mentor. Basically the same fight, same content, but with wildly different feels.

#5 – Make it highly interactive. Good procedural content needs to be more than just a better sword or a different twist to a hall. It needs to potentially make a difference (again, meaningful). Minecraft will perhaps forever be the textbook example for this, where every block of a gigantic world may be useful in some way or another. A potentially even more interesting twist is where these might not only be interesting and useful to the player, but recognized and used by the AI as well.

Filed Under: Design - Comments: Read the First Comment

  • Cuthalion said,

    These are interesting tips. I was just thinking yesterday about how procedural generation can get boring.