3

Similar question found here

I am working on a roguelike game written in Haskell. I've decided to represent the world as a 2D grid using Data.Array.Repa, now I wish to dynamically generate random dungeons which can contain corridors that are either straight or turn 90-degrees, and rooms which can be of (almost) any size and shape.

I'm having trouble figuring out a strategy to generate these dungeons. A drunkard's walk might work, but it seems like it might be too erratic and wouldn't produce many rooms. What is a better approach to generating the dungeons?

Also, is Data.Array.Repa a good choice of data structure to use here?

Community
  • 1
  • 1
cdk
  • 6,698
  • 24
  • 51
  • There are plenty of ways to make a random map. You should be more specific about what you want. Do you prefer dead ends or cycles? Should the walls be straight (building) or random (cave)? Do you want many branches? Very random and very regular maps are easy to make. I assume you are aiming for the middle though. – Karolis Juodelė Nov 20 '12 at 17:47

1 Answers1

3

A quick google found some great resources. First, a thesis on this topic!

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.119.1445

Second, a series of blogposts: http://dirkkok.wordpress.com/dungeon-generation-article-series/

Finally, a description of the original rogue algorithm: http://kuoi.com/~kamikaze/GameDesign/art07_rogue_dungeon.php

For haskell specific resources, you may want to look at LambdaHack: https://github.com/kosmikus/LambdaHack

sclv
  • 38,665
  • 7
  • 99
  • 204