Friday, 30 November 2012

Digger

There was an idea at the Temple which I had to try. The dungeon or in this case more like maze is created using robot diggers that move in some direction and check if it can continue. It also creates clones along the way which move in different direction and create branching corridors.


These two examples were created with the same routine. Now it's obvious that in some conditions the level can be quite small and not usable as a labyrinth. However there are three things which affect the generation process:

1. Number of diggers at the start (this is using one, starting from the center of level)
2. Turning speed (how many steps a digger continues in one direction)
3. Clone rate (here it's after 10-20 steps)

However adding more diggers when starting means that the generation paths are separate, since diggers wont touch any of corridors. Joining areas can be tricky, but it's doable.

Nice thing about this type of generation is that you can use it in a level that already has other features, like rooms and regular corridors.

3 comments:

Darren Grey said...

An easy trick is to check the level after generation to see if it comes close to all 4 walls. If it doesn't then toss it away and make a new one.

Unknown said...

I've tinkered with this sort of thing before, but my best maps always came from a grid based density check.

Joseph said...

What about roomies?! :-)