Skip to main content
gamedev.net
🔒 Locked

Random dungeon generation

Started by Leo28C Jun 24, 2007 at 3:42 PM 4 replies 1.7k views
Original Post
Leo28C
Leo28C
That's the phrase I used on Google. It gave me a lot of good results. I like this one: http://www.aarg.net/~minam/dungeon_design.html However I don't understand it. This:
Quote:
Generate a room such that Wmin <= Rw <= Wmax and Hmin <= Rh <= Hmax.
is the first thing I don't get. What's Wmin? Help? Thanks in advance!
Omega147
Omega147
I'm assuming the author at that site means for Wmin to imply a minimum width, set by you as a constant value somewhere for determining the minimum room size, meaning that no room's width will be less than Wmin. Wmax would be the max width, a maximum which no room in the dungeon can be greater than. Same with Hmin and Hmax, except applying to height instead. Rw would then be a random width between the values Wmin and Wmax, Rh a value between Hmin and Hmax.

That make sense?
Leo28C
Leo28C
Thanks for quick reply!

OK, the next thing I don't understand is this:

Quote:
Put the upper-left corner of the room at C. Set the "current" score to 0.


What does it mean by putting it at C? What's C mean?

Thanks!
evillive2
evillive2
He uses C as the current cell (wherever that may be).

The theory and practice of this works well as you can see by the demos he has. Basically he makes a maze and then creates rooms in the maze so as not to block off the routes in the maze. I recommend looking through the core code he releases at the bottom of the article in the dungeon directory specifically the jbdungeon and jbmaze files.

It is a little cryptic but if you play around with it you should be able to come up with something useful.

I would also look into the text based rogue and rogue-like games. They all have randomly generated mazes that could come in handy and they aren't as complicated.
Evillive2
Leo28C
Leo28C
I am using a roguelike, that's why my code has to be different. His is more for straight-line mazes, and if I use his method I'll end up with a screen filled by #'s or *'s...

Do you know any roguelike I can look at the source of? Thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.