iDevGames Forums

Full Version: Dungeon Generation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to generate a dungeon like Nethack does. Any suggestions?

I might just look at the Nethack code, but I'd like to come here first.
maybe you can find something useful there:


...just stumbled across a bunch of source code titled "random maze generator":
hope it helps D.
OK, so those links helped me a bit, but I ended up doing something completely different. I'm going to have a number of "layouts" (right now i've only got one) that divide the map into areas. Each area will have a randomly sized room in it and the rooms will be connected randomly with hallways. Right now I'm trying to get hallways to work because my pathfinder isn't working right (I'm using it to generate the hallways). Or rather, the pathfinder is fine, but something is ignoring the walls...never mind.
Everything is now working perfectly. Diplomtennis, I thank you forever for that link. Even though it didn't help me with this it gave me some excellent AI ideas.

*Points to Rogue thread in WiP*

If you want the source, email me.
Best make sure it doesn't make rooms with no hallways...unless you are using teleporters.
*points to Rogue thread in WiP again*


glad I could help you. I did some metal basic pathfinding some time ago. its not excactly A*, but it did work ok for me. If you want it is still online and you can download it at:
Yeah, I've seen it. Except the source was largely in German so I couldn't comprehend it.


Shock doh. you´re right - I haven´t noticed. sorry.
Its written to behave like one of those toys that bump into a wall and then turning into a new direction:

get target direction;
while (field blocked) {
turn left or right
check field

by checking the field i made the unit remember its path. This makes the unit to also get out of U-shaped obstacles, because it is not turning around and moving the same path again and again.
Reference URL's