![]() |
#1 |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,023
![]() |
Pyrel dungeon generation
I've been thinking a lot on how to best write the dungeon generation for pyrel. In keeping with the spirit, the goal would be to improve on how the generation algorithm handles certain things so that the client (i.e. programmer) has more flexibility in determining the dungeon style.
My basic ideas is that each dungeon feature should have an associated power rating and an associated rarity (or strangeness) rating. A greater vault would have both a high power and rarity rating, while a bizarre empty room might have a large rarity rating but a low power. Conversely, a OoD monster or a unique could have a high power but a low rarity. Bog-standard features like normal rooms, corridors and doors have 0 for both. At the beginning of each level, the RNG rolls for both rarity and power and those rolls determine the features. This gives the client the capability of tweaking the dungeon in fundamental ways with very simple changes. I envision the power rating to be very highly tied to dungeon levels and the rarity rating to have a much weaker dependence. I could also envision the capability of gradually reducing the power of a level each time it's visited to encourage deeper exploration, but that's an entirely different conversation. The point is that the capability would be there. The basic algorithm goes like this.
For 1. currently the dungeon templates are town, normal, cavern and labyrinth. I plan to subsume caverns and labyrinths as large scale sub-features of a level as opposed to their own type. However, this step is useful for differentiating the town from the dungeon in V and for differentiating different types of dungeon maps (overland, mountain, different dungeons) in variants. Since the rarity rolls could conceivably depend on dungeon templates, I move the rolls to the second step. 2 has been explained already. One of the current drawbacks of dungeon generation is that features are often limited by whether or not they fit. In step 3 we place the largest features as the first features in the dungeon. This way we can ensure that you get a GV if one is called for. The main advantage is not to make GVs more common, but to give the client the capability of setting their frequency in a very transparent manner. I'm envisioning High rarity, low power levels to get a cavern. High rarity, medium power levels to get a labyrinth and High rarity, high power levels to get a GV. For 4, I lumped a lot of thing together but you can imagine further stratification. You can first check for MVs, then LVs, then pits and nests if you want. I'm not sure this stratification is necessary right now, but it would be useful if you have some features that are much larger than others. 5 is how you get somewhat interesting dungeons with low power levels. This way the first 10 levels can still have interesting features instead of the current boring situation. These would be the rooms in room_template.txt as well as the moated rooms, the cross rooms, the circle rooms, the double rooms, the pillared rooms and all the other non-standard rooms. 6 is how you satisfy a high power low rarity dungeon. Basically this looks like a normal dungeon except it's chock full of dangerous monsters and awesome loot. 7,8,9 finish out dungeon generation similar to what's done in V. I was going to go into more details about how to pick features based on the rolls, but my lunch break is over. Maybe later tonight. |
![]() |
![]() |
![]() |
#2 |
Knight
Join Date: Jan 2008
Posts: 526
![]() |
If you want a case study, Dungeon Crawl: Stone Soup has a LUA interface and plugins for (most? all?) of its dungeon building styles, and it has its own file format for 'vaults', special rooms that have their own defined layout (which can have elements of randomness, subvaults, randomized subvaults, arbitrary embedded LUA, etc)
|
![]() |
![]() |
![]() |
#3 |
Knight
|
Heh, Crawl actually has Lua? I must have missed that - wasn't Lua actually removed from Angband around 3.1.0 or so?
![]()
__________________
You read the scroll labeled NOBIMUS UPSCOTI... You are surrounded by a stasis field! The tengu tries to teleport, but fails! |
![]() |
![]() |
![]() |
#4 |
Knight
Join Date: Jan 2008
Posts: 526
![]() |
Crawl has LUA for a lot of things - you can put LUA in your configuration file to define macros, scripts and so on. There is at least one bot written entirely in client-side LUA.
|
![]() |
![]() |
![]() |
#5 |
Ironband/Quickband Maintainer
Join Date: Nov 2007
Posts: 1,009
![]() |
I must be confused - I thought pyrel was intended to be a port of Angband - do I have that wrong??? (Could I be thinking of pyAngband?)
A.
__________________
Ironband - http://angband.oook.cz/ironband/ |
![]() |
![]() |
![]() |
#6 |
Prophet
Join Date: Dec 2009
Posts: 9,024
![]() |
Pyrel is a port of Angband (or will be when it's done!). I believe Patashu was simply suggesting that we check out Crawl for inspiration as to implementation mechanisms, if not content.
(Of course, how much Pyrel will resemble Angband when it actually starts being playable is an open question. Devs like to meddle.) |
![]() |
![]() |
![]() |
#7 |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,023
![]() |
Here are what I envision to be the changes to the "final product" of dungeon generation.
1) Labyrinths and Caverns will become features on a level instead of their own level. This was actually a design goal for a while, so it's well in the intended spirit. 2) Angband splits up the dungeon into smaller sub-blocks and then creates rooms contained entirely in those blocks. Vaults can span multiple blocks. I think the original idea was to prevent rooms from spanning across a window boundary (this is prior to window resizing and center on player). I'm not sure there's another good reason to split the dungeon this way anymore, so I have a feeling rooms will be placed more or less randomly in the pyrel generation script. 3) Frequencies of various features may change. This is probably for the better, since the current allotment is far from ideal (every level in the 90s is almost guaranteed a demon, ainu, undead or if you're lucky dragon pit). I have lots of other ideas for improvement including making pits variably sized, making sections immune to item/feature detection and mapping, and creating sections where certain monster types are prevalent. But I'm not even sure I'll be able to get generation working given the poor state of my python abilities. So these extra things may not happen. |
![]() |
![]() |
![]() |
#8 | |
Ironband/Quickband Maintainer
Join Date: Nov 2007
Posts: 1,009
![]() |
Quote:
A.
__________________
Ironband - http://angband.oook.cz/ironband/ |
|
![]() |
![]() |
![]() |
#9 | |
Angband Devteam member
|
Quote:
And if you don't, you'll stop bitching about the difference between a faithful port and a variant rewrite, won't you?
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila |
|
![]() |
![]() |
![]() |
#10 | |
Ironband/Quickband Maintainer
Join Date: Nov 2007
Posts: 1,009
![]() |
Quote:
let me be the first to welcome this fine new variant! a.
__________________
Ironband - http://angband.oook.cz/ironband/ |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Over-engineering dungeon generation | RogerN | Variants | 41 | April 8, 2019 07:20 |
Making dungeon generation more interesting | Nomad | v4 | 5 | November 10, 2011 17:48 |
Disconnected dungeon generation | Derakon | Vanilla | 41 | January 6, 2011 00:25 |
The Angband dungeon generation discussion thread | andrewdoull | Development | 58 | December 30, 2009 23:48 |
Edit File For Dungeon Generation? | Zero | Vanilla | 3 | January 9, 2008 19:17 |