Live data from Hacker News

Rooms and Mazes: A Procedural Dungeon Generator

journal.stuffwithstuff.com

31–40 of 51 posts

Re: Rooms and Mazes: A Procedural Dungeon Generator

#31
post #15

A long time ago i also wrote a maze generator. It's helpfull to understand the algebra of (fully accessible) mazes: 1. Every wall may intersect with some other wall at most once. (this includes the outer wall) With the above rule in mind, you can create mazes with any type of random proccess (without the need for backtracking or bookkeeping). You don't have to check wether places are still accessible -- they just alw…

I can't quite figure out how to carry out your instructions.

Re: Rooms and Mazes: A Procedural Dungeon Generator

#32
post #25

Earlier quoted context omitted.

As another resource, here's a draft chapter on dungeon generation, from a textbook on procedural content generation in games: http://pcgbook.com/wp-content/uploads/chapter03.pdf (Draft in part because some of the figures still need work. I'm a coauthor of the book, but not of this particular chapter.)

Can I take a moment to be critical here? I hate sounding negative, but I'll try to be constructive. I was really excited when I first stumbled onto this book. As you can imagine, it's perfectly in line with my interests. But, when I tried to read it, the prose just killed me. I think there's good ideas in there, but I can't bear to wade through the heavy-handed academic style get there. I understand writing for a cer…

I just read Steven Pinker's "The Sense of Style" and found it to be an excellent resource on this topic.

http://www.amazon.com/The-Sense-Style-Thinking-Person%C2%92s...

Re: Rooms and Mazes: A Procedural Dungeon Generator

#33

Labyrinth generator in a single line of code: http://www.slate.com/articles/technology/books/2012/11/compu...

The second example on http://en.wikipedia.org/wiki/Obfuscation_%28software%29 is a 7 line maze that generates arbitrary length mazes. Its construction is described at http://tromp.github.io/maze.html

Re: Rooms and Mazes: A Procedural Dungeon Generator

#34
post #25

Earlier quoted context omitted.

As another resource, here's a draft chapter on dungeon generation, from a textbook on procedural content generation in games: http://pcgbook.com/wp-content/uploads/chapter03.pdf (Draft in part because some of the figures still need work. I'm a coauthor of the book, but not of this particular chapter.)

Can I take a moment to be critical here? I hate sounding negative, but I'll try to be constructive. I was really excited when I first stumbled onto this book. As you can imagine, it's perfectly in line with my interests. But, when I tried to read it, the prose just killed me. I think there's good ideas in there, but I can't bear to wade through the heavy-handed academic style get there. I understand writing for a cer…

This is not "academic writing", it is writing trying to sound academic. At my University you would get higher regard for your version and consequently better marks.

If it is a subject you are interested in, then George Orwell's essay on writing style [1] is worth a read.

[1] https://www.mtholyoke.edu/acad/intrel/orwell46.htm

Re: Rooms and Mazes: A Procedural Dungeon Generator

#35

Earlier quoted context omitted.

Can I take a moment to be critical here? I hate sounding negative, but I'll try to be constructive. I was really excited when I first stumbled onto this book. As you can imagine, it's perfectly in line with my interests. But, when I tried to read it, the prose just killed me. I think there's good ideas in there, but I can't bear to wade through the heavy-handed academic style get there. I understand writing for a cer…

I just read Steven Pinker's "The Sense of Style" and found it to be an excellent resource on this topic. http://www.amazon.com/The-Sense-Style-Thinking-Person%C2%92s...

From that text

“A coherent text is one in which the reader always knows which coherence relation holds between one sentence and the next.”

Sage advice indeed.

http://www.telegraph.co.uk/culture/books/bookreviews/1108972...

Re: Rooms and Mazes: A Procedural Dungeon Generator

#36

Earlier quoted context omitted.

Can I take a moment to be critical here? I hate sounding negative, but I'll try to be constructive. I was really excited when I first stumbled onto this book. As you can imagine, it's perfectly in line with my interests. But, when I tried to read it, the prose just killed me. I think there's good ideas in there, but I can't bear to wade through the heavy-handed academic style get there. I understand writing for a cer…

This is not "academic writing", it is writing trying to sound academic. At my University you would get higher regard for your version and consequently better marks. If it is a subject you are interested in, then George Orwell's essay on writing style [1] is worth a read. [1] https://www.mtholyoke.edu/acad/intrel/orwell46.htm

Indeed it is!

I also highly recommend William Zinsser's On Writing Well. It's a perfect gem of a book and improved my writing more than anything else ever has.

Re: Rooms and Mazes: A Procedural Dungeon Generator

#37
post #15

A long time ago i also wrote a maze generator. It's helpfull to understand the algebra of (fully accessible) mazes: 1. Every wall may intersect with some other wall at most once. (this includes the outer wall) With the above rule in mind, you can create mazes with any type of random proccess (without the need for backtracking or bookkeeping). You don't have to check wether places are still accessible -- they just alw…

I can't quite figure out how to carry out your instructions.

Two walls interact in only 3 ways - first, they don't touch. you get hallways: ||, second one intersects ends at the other like a T (which is a kind of degenerate version of 3). Third, they cross over, like a +. if you don't let walls touch multiple times, say like a D you'll never have a closed off space like the center of that D.

Re: Rooms and Mazes: A Procedural Dungeon Generator

#39
post #37

Earlier quoted context omitted.

I can't quite figure out how to carry out your instructions.

Two walls interact in only 3 ways - first, they don't touch. you get hallways: ||, second one intersects ends at the other like a T (which is a kind of degenerate version of 3). Third, they cross over, like a +. if you don't let walls touch multiple times, say like a D you'll never have a closed off space like the center of that D.

Start drawing random lines.

I got this on my first try:

  +------------------+--+---+
  |                   - |   |
  |                    -|   |
  |                     +   |
  |                     |- -|
  |                     | + |
  |                     |- -|
  |                     +   +
  |                    -|   |
  |                   - |   |
  |                  -  |   |
  |                 -   |   
  +----------------+----+---+
I got that by drawing an exterior square with a single entrance in the bottom right hand corner. I then drew a line from the top wall to the bottom wall parallel to the left and right walls. I then drew a diagonal line from about a quarter of the way down the right wall left and downwards towards the bottom wall. I then drew a diagonal line from about three quarters of the way down the right wall, up and to left towards the top wall. This blocks off most of the maze. So I'm not sure the algorithm works as has been described.

Re: Rooms and Mazes: A Procedural Dungeon Generator

#40
post #39
post #37

Earlier quoted context omitted.

Two walls interact in only 3 ways - first, they don't touch. you get hallways: ||, second one intersects ends at the other like a T (which is a kind of degenerate version of 3). Third, they cross over, like a +. if you don't let walls touch multiple times, say like a D you'll never have a closed off space like the center of that D.

Start drawing random lines. I got this on my first try: +------------------+--+---+ | - | | | -| | | + | | |- -| | | + | | |- -| | + + | -| | | - | | | - | | | - | +----------------+----+---+ I got that by drawing an exterior square with a single entrance in the bottom right hand corner. I then drew a line from the top wall to the bottom wall parallel to the left and right walls. I then drew a diagonal line from abou…

Ah! Each wall is one continuous line, regardless of twists and turns. Connecting the top to the bottom is what got you stuck.

Edit

I guess each wall can only be anchored at one end. Trying to think about how to restate it in a clear way.

Post reply on HN