how does dungeon generation work?


Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

User avatar

Lair Larrikin

Posts: 23

Joined: Thursday, 23rd June 2011, 15:14

Post Thursday, 25th August 2011, 11:58

how does dungeon generation work?

how does dungeon generation work? Does it make sure that there are a certain amount and type of monsters and items on each floor? Or are all enemy and item amounts etc. all random?

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Thursday, 25th August 2011, 12:02

Re: how does dungeon generation work?

Everything is random, but monsters have a natural depth. That is taken into account during monster generation, although there can be spikes (OOD monsters).
User avatar

Lair Larrikin

Posts: 23

Joined: Thursday, 23rd June 2011, 15:14

Post Thursday, 25th August 2011, 12:11

Re: how does dungeon generation work?

Thanks! So that means its possible to have a floor of just items? Or just boss types?

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Thursday, 25th August 2011, 12:16

Re: how does dungeon generation work?

No, some monsters are always placed. I am not the best person to answer, though. Someone else will take over! :)
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 25th August 2011, 12:27

Re: how does dungeon generation work?

All levels will always have some items and some monsters (except in some branches). Uniques are handled separately from monsters.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Lair Larrikin

Posts: 23

Joined: Thursday, 23rd June 2011, 15:14

Post Thursday, 25th August 2011, 13:00

Re: how does dungeon generation work?

I haven't really read code like that before but I think understood how it works. Thanks!
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 25th August 2011, 13:29

Re: how does dungeon generation work?

Well, this code is easy enough to read and well commented. Some explanations:
roll_dice(x, y) means roll x dices with y sides each, add the results.
random2(x) returns a random number between 0 and x -1.
random2avg(x, y) does random2(x) y times and averages the results. This is similar to rolling several dices (middle values are more likely).
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Vaults Vanquisher

Posts: 461

Joined: Monday, 13th June 2011, 00:21

Post Thursday, 25th August 2011, 18:13

Re: how does dungeon generation work?

While we're on the subject, I've read that once you've "cleared" a level, monster generation slows down dramatically. (In accordance with the game's anti-grinding philosophy and whatnot.)

How does the game decide when you've cleared a level? When you've uncovered the whole map for it? When you've killed X percent of the monsters present? Or what?
User avatar

Dungeon Master

Posts: 182

Joined: Saturday, 18th December 2010, 10:26

Location: Germany

Post Thursday, 25th August 2011, 21:08

Re: how does dungeon generation work?

Happy Corner wrote:While we're on the subject, I've read that once you've "cleared" a level, monster generation slows down dramatically. (In accordance with the game's anti-grinding philosophy and whatnot.)

How does the game decide when you've cleared a level? When you've uncovered the whole map for it? When you've killed X percent of the monsters present? Or what?


Actually, it's not about "clearing" a level but about time spent there (including over several visits). I don't know the numbers, but once you spent a certain number of turns on a level (whether fighting, exploring, resting or grinding spells doesn't matter) monster generation gets more likely to create seriously out of depth monsters to force the player to continue downwards. Some time later, monster generation on that level will come to a halt altogether.
Please report bugs to Crawl's bug tracker, and leave feedback on the development wiki. Thank you!

Shoals Surfer

Posts: 312

Joined: Thursday, 9th June 2011, 19:12

Post Friday, 26th August 2011, 14:20

Re: how does dungeon generation work?

In a pointlessly scummy way, does this mean that you could go 10-15 levels shallower and hang out to get proper depth mobs to nom on?

Abyss Ambulator

Posts: 1196

Joined: Friday, 17th December 2010, 13:59

Location: Maryland, USA

Post Friday, 26th August 2011, 14:56

Re: how does dungeon generation work?

In theory, yes, but only for a while. There's a second timer after the OOD timer that completely halts monster generation to prevent that sort of thing.
You fall off the wall. You have a feeling of ineptitude.

Return to Dungeon Crawling Advice

Who is online

Users browsing this forum: No registered users and 23 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.