How to make a random dungeon?

In this post Phi Dinh explains how one can procedurally create interesting looking dungeons, ie. random sized, unevenly distributed rooms, that have main hubs, interesting to explore, are connected, reachable etc. Here it is simulated in an animgif:

His prototype (requires Flash) that generates a new dungeon every time it runs is also interesting to observe. What is the next step after you have a nicely playable dungeon? You make a game out of it, of course! Here is the end result, TinyKeep, a Diablo-style hack-and-slash game:

Back to the dungeon generation: how does it work? It generates a bunch of rectangles at random places at random sizes (which, in itself isn’t even that easy than it sounds), then comes the physics engine: “simply add solid physics bodies to match each room’s position and then just run the simulation until all bodies go back to sleep”. And so forth, this was just the warm up. 🙂

TinyKeep started as a Kickstarter project. It’s worth reading through the project page, there is an AI tryout section for the game. Even if you’re not a game developer, it’s still fascinating stuff!

You can buy the game on Steam for €9,99 and runs on Macs as well.