Wednesday, February 1, 2012

Episode 21: Procedural Generation

Welcome to episode 21 of Roguelike Radio. This week we discuss procedural generation and how it applies to roguelikes. Talking this episode are Darren Grey and Andrew Doull.

The mp3 of the podcast can be downloaded here, played in the embedded player below, or you can follow us on iTunes.

Discussion covered this week includes:
- Death of the Level Designer
- The advantages of a room and corridor design
- Sunk cost investment in procedural spaces
- Whether tidying up is good game play
- Procedural puzzles and quests
- Can dynamic systems and AI make a game procedural?
- Architecture vs. content

If this interests you further, you should take a look at the PCG wiki, which has links to all things procedural.

Join us next week for a look at Infra Arcana, a horror-themed roguelike.


  1. I must apologise for my poor audio quality throughout the episode. I didn't realise when recording that I had such a bad connection.

    Also, one thing Andrew mentioned to me after the conversation that we forgot to bring up was the problem with randomised content turning rude (curse words, phallic imagery, etc) - one of the many reasons why professional games companies will rarely yield to true PGC.

  2. Great episode. I really enjoy the change of pace from episode to episode. I'd like to encourage you guys to continue including these different episode styles (interviews, one-to-one discussions, round-tables).

    I'd like to point out one thing I think you guys missed. You briefly touched upon the idea of procedural monster generation and it was mentioned that TOME4 does this in a small way with some of the bosses. Otherwise, you couldn't seem to find any other examples and concluded that "the player needs to know what's coming" or something to that effect.

    The thing you might have missed is the effect of monster item use. An orc who found a potion of invisibility is very different from the average orc. The infamous gnome with a wand of death is vastly more dangerous from the average gnome. This one, simply ability (item use) dramatically alters the player's expectations and contributes greatly to the "surprise effect" that roguelikes are so famous for.

    As for the architecture of Dungeon Crawl: Stone Soup, I'd recommend giving the game a second look. I don't know when you guys last played it, but lately I've been really enjoying the surprising variations I've found in the dungeon. The differences in the dungeon branches is also quite refreshing. It really feels a lot more dynamic than the typical rooms-and-corridors I'd gotten used to from NetHack.

  3. PCG is definitely the way to go when it comes to roguelikes, and I think this is mainly because of the one-life "permadeath" that also coexists with the genre. If you look at a good chunk of old action or adventure games (for example, almost anything AVGN plays), one of the most frustrating parts is that you get no saves or continues and yet the content remains exactly the same each time. You end up having to play the same levels and deal with the same enemies in the same positions, and this kind of repetition is unexcusable. Randomized content (through PCG) avoids this almost entirely by providing a very different game each time: it's no longer a grind to get back to where you were but, rather, a completely different experience.

    I'd really love to see PCG used in a more global environment as well, such that decisions you make as you play have both positive and negative effects on the game as a whole. In part these are explained in your examples, like killing a certain race often makes them far more hostile to you, or integrated into quests (not managing to stop the war machine's construction means you have to instead prevent it from destroying the town, etc).

    However, I see this going even further: the ability of the player to survive and progress in the game affects how the rest of the game treats the player. To put it simply, the game uses a "fame" or "popularity" mechanic that is dependent on how good the player is at playing the game. Ultimately this makes the game incredibly replayable if handled correctly, because the game literally accounts for you being a newbie or a veteran. Prototyping this would probably be along the lines of quest completion affecting what other quests are possible, but I can see it branching out into a full-fledged case of enemies accounting for your inventory and stats "as you were last seen", various NPCs responding to your accomplishments, and villains spawning out of nowhere just to kill you personally.

    To be more concrete, let's say you're a beginner just barely dealing with quests and the random surprise encounter. No one really takes notice of you, and the game is essentially "unaffected" by your presence other than the quest-givers and the occasional enemy type you happen to be killing more often. If, on the other hand, you absolutely breeze through everything (because you abused game mechanics or knew how to get good gear or anything like that) then suddenly you have messengers from royalty approaching you, and assassins attacking when you least expect it, and wanted posters strewn across dungeons with your picture on them. It probably fits best in the ADOM or DF style (big world to explore) but you could probably work it into any game that is sufficiently long enough.

  4. Procedural generation stops a game from being a sort of pattern memory exercise. But if you extend it to item and monster creation you run the risk of obliterating the development of player skill.

    Doing better in Brogue, for example, is about knowing the items and enemies and figuring out strategies to defeat (or flee from) enemies. I think this is the major way in which one becomes better at Roguelikes.

    If you eliminate the ability to learn the behaviors of items and monsters then how will a player get better from game to game? Will they just be getting better at quickly figuring out the patterns and behaviors of monsters and items? I dunno...

    Also random monsters/items weaken the theme of a game. Archetypes tend to lend familiarity. Players like this.

    All that said I'd love to play a game with random monsters with random names which I get to defeat with random items. It'd be one mysterious freakin' experience. Maybe a Cthulu themed game would work here. Horrors from another dimension with random unrecognizable names like Dirzlock that fires fire balls from his elbows.

    Could be neat.

  5. Procedurally generating enemy types could ALMOST work if you treated it as a kind of spin-off to the standard item identification minigame. You start with a large number of base descriptions for monsters ('rotund horror') and at the start of the game assign each with random stats, abilities, and appropriate depth. At first PC is given no information, but whenever the player observes eg. the monster's movement speed or use of special ability then it gets instantly recorded in that monster's (l)ook description. At any time the player could give a custom name to the enemy or else let the game auto-inscribe it with the most important observed abilities ('rotund horror {*STR*, slow, SUMMON}'). You'd need to balance the abilities such that the player wouldn't get insta-killed out of ignorance, but the system could certainly add some atmosphere to settings where the PC isn't supposed to recognise any of the nasties in the mysterious dungeons depths.

    Generally it's for the best that the player be able to instantly understand the scenario you place the character in, though. The reason that it's fair game to let enemies use items - even when it drastically changes their difficulty or how you deal with them - is that the player can very quickly recognise both the gnome and the wand then react accordingly. (In Nethack's case the instant player death is just very bad item design.) You can even get away with modifying the enemies themselves if the changes follow a pattern and are clearly visible - 'skeletal foo' and 'zombie foo' are common enough, and IIRC ToME2 had 'foo shaman' and some others too.

    I find the standard rectangle-room-and-corridor levels very dull, actually. Lining up beam attacks is easy, luring and meleeing enemies from safety becomes almost trivial, and possibly worse, the generation is very predictable. Cavernous levels have fewer chokepoints to rely on (and often it's still possible for smart AIs to quickly sneak around you), there's pillars and odd formations to fight around or duck behind, and you don't know how any given 'room' is going to end the moment you step into it. Even better is a level generator which can merge both or more styles into something unique and varied every time.

    DCSS's main dungeon is good at this when it's not just lazily throwing you into a stock open-cross-surrounded-by-nasty-terrain or uninspired empty-except-with-dotted-square-blocks level. POWDER, of all roguelikes, might have my favourite level generator - it's simple and fits four-directional movement, but uses most of its space and has plenty of intersecting passages. Plus it keeps swapping to (set) new styles as you go deeper, keeping the levels fresh while giving a good sense of progress!

  6. I should also say that this episode had much, much more discussion than the above that I found interesting, but you covered it very well for just two people talking. This was easily a favourite! :)

  7. Andrew and I were a little worried that with just two of us the episode would be a failure, but I think it turned out surprisingly well. I guess it helps that we're both very passionate about the subject...

    Well done on getting through so many episode so quickly, OneMoreNameless. What are you going do with all your time now you've caught up with all the episodes? ;)

  8. I think procedural generation has been a failure in roguelikes, roguelikes are an adventure, which suggests exploration. Procedural generation suggests exploration. Roguelikes have mostly not only been boring from the point of view of exploration, but often highly unrecommended. Out of all the awesome cool natural wonders in the world, nothing even close has come out of roguelikes for the most part. instead, it is stuff that even if it looks natural occuring, it still looks mostly like 90 other things you see. And this isn't a small demand, minecraft is 95% boring repetition, yet people still go on exploration adventures to find cool naturally occuring landmarks in a game that isn't built for adventures of this sort. And while procedural content should be smashing user generated content in this regard, user generated content is still often more effective because users can creatre something interesting, where as interesting things are far from the norm in roguelikes.

  9. I think strategy games are also a place to look for procedurally developed worlds.
    Places i think it has done well are: Small scale strategy game maps (age of empires for example): these maps meet the need to have exploration be a part of the game, often constrained artificially to make it playable for both sides 95% of the time. The maps feel realistic, the generation is highly customizable for variety, and fits a need not really relevant to most games, though i could see adventure games taking some notes from it (creating a nation so that you will have to explore for towns dungeons et cetera with constraints to make sure there are some nearby but still require exploration that will skirt the edges of the zones of higher degrees of randomness).

    A place where it hasn't work so well: World map procedural generation: Civilisation maps still look like random landmasses that have no logic to them. continents are often not seperated enough. World map size is known, as well as proportion of land, thus there isn't the interesting idea of "no one has discovered anything in this large span of empty area, maybe i should see what is there", because you can get a pretty good idea if there is or not just by knowing how the map is built. although doing better might be bad gameplay wise, i'm suprised no one has attempted to create a realistic world generation, especially since we know in general how ours was created already and why climates are what they are so that we could do this with entirely new landmasses.

  10. I think an interesting question is "when is too much," as like a lot of pepole describe roguelikes as 'it is an entirely different game each time' in general it isn't. there is much more the same each time we go through than different, which is also important to learning the game over time. However i think we havn't gone far enough, as if you come up with a system where we have to figure out the rules to how it was created each time we play, we can have a huge impact towards making the game more accessable to newcomers (by relaxing the difficulty) while retaining or even increasing the difficulty to vets (as there is less they can rely on as being constant). It would also fix something that roguelikes are missing right now in that learning the random element to a game currently only helps you to survive that short term area, but if you change it so there is more that has to be learned about each game in particular each reload, suddenly you have a long term element that you have to figure out each time rather than just a short term element, which would fundimentally change the way we play (and make it so a clever newcomer could potentially be better than a 13 year old that looked everything up and played 500 times). If this is confusing, one non ambitious example is not always have the effects of what shows up in potions or what potions do be the same. Perhaps one game they are all positive pernament effects, suddenly not quaffing them all is an absurd idea, teh next game they could be like they are now in most games as short term effects that are potentially helpful or harmful, another game there could jsut be no potions, but suddenly any water that got spawned on the map heals you.

  11. This comment has been removed by the author.

    1. You mentioned the seminal space trading game, Elite (Acornsoft 1984) as an example of replacing of more traditional quests with an economic simulation; a more recent and more 'roguelikelike' example is Ascii Sector.

    2. and yet elite was entirely procedurally generated.

  12. This was really interesting, and hit on a bunch of points I've been feeling for a while, myself.

    Specifically, I'm really interested in the interplay between premade content and pure randomness. I think that without some element of pregeneration it's really hard to improve the basic gameplay (you guys sort of touched on this in the one area of the games that do tend to almost always be made up of pre-built game elements--monsters), but the points raised that such areas end up really repetitive and un-explorational are really important, too. How do you feel about multiple levels of prefabbery mixed with a lot of internal variation and all interacting with each other?

    To give a more specific example, the game I'm working on now uses geomorphs as the basic building block of its layout. I've managed to avoid the worst of repetition by making the geomorphs fairly internally complex--each iteration of them might or might not include any given room, and the rooms warp randomly in size and shape. They're also disconnected (though correlated) from the way the room is populated, which is disconnected (though correlated) from monsters and treasure.

    Do you think that prefabbed content is just never going to be complex and varied enough to overload the mind's ability for pattern recognition the way you talked about in the start of the podcast, or is there hope? Honestly, this is one of the big fears I'm facing right now, but initial attempts have looked fairly good, so I'm hopeful. It's hard to tell how it'll really feel until it's a few dozen playthroughs of the completed game, though.

  13. Humans are very good at pattern recognition, so I think if you have the same geomorph/room shapes and designs through various games then the geometry will become recognised. A few ways to combat this:
    - Many many many room types to choose from (though you need a lot to overcome memory and pattern recognition)
    - A good variety between pre-fabs, so they don't all feel samey
    - Some extra randomness in the wall/floor placement in individual examples
    - Make some types more common than others, so you're still finding rare new things after thousands of games. If a specific unusual set-up (like a huge open space) occurs only once in a thousand games it becomes far more interesting than when encountered once in ten games.
    - Don't be afraid to make odd looking set-ups that go beyond traditional room/corridor design