Posts Tagged ‘Roguelike’

Random Level Generator

January 28, 2008

I felt it was time to at least set up a testbed for working on some random level generators. As I was looking around, I realized that emulating the look of a Roguelike would be a quick and dirty way to show off a dungeon map. I got right into it and built a WinForms app and gave it the first two test buttons you will see below:

Level Generator - Random Rectangles

I started taking a look at some Roguelike map-related information at roguebasin, that Viridian was kind enough to pass along to me. There wasn’t a whole lot I could really sink my teeth into, but an article originally written by Mike Anderson really caught my attention. I googled and found a page where he provided an example where he was stepping through and showing the algorithm at work. Once I saw that, I was hooked. I wrote up a rooms-only version and wound up with maps that looked like this:

Level Generator - Rooms-Only Anderson Algo 

As you can see, I’ve got something to work with now. Even if it doesn’t make perfect Diablo 1 maps, who cares! I just want some rooms to move around in for now. And this shows that I can have exactly that without a whole lot of trouble.

Make no mistake, I’m not done with this by a long shot. I’m looking at the walls of interconnected rooms and considering rolling for different types of openings: standard wall-door, completely open, pillars, portcullis-walls with door, and so on. I think that will make it look much more Diablo-esque. On top of that, if you consider that there are required rooms for certain floors (the Butcher’s room, for example), I may have nailed their creation method. Only time and effort can tell for sure!