![]() |
#1 |
Prophet
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,596
![]() |
How does level gen work?
Are there paramaters to adjust the size? Or the number of rooms? Is there an easy way to say, make the 1st ten levels small levels?
|
![]() |
![]() |
![]() |
#2 |
Adept
Join Date: Apr 2016
Age: 53
Posts: 144
![]() |
That's not a bad idea. Make the first 10 (or whatever) levels around half the size. You'd still have the gradual introduction for new players but without them getting bored exploring the whole of a full size level (which they will because that is how other games work)
__________________
"This has not been a recording" |
![]() |
![]() |
![]() |
#3 |
Swordsman
Join Date: Aug 2015
Posts: 279
![]() |
Plus, even for those of us who plan to dive rather than exploring (strictly speaking, it doesn't matter which you do on the early levels, which are low risk-low reward propositions; I usually wait just long enough for the level feeling to tell me if an artifact or extreme ood treasure was generated, because hanging around isn't risky), big levels impede diving because you often have to explore the whole thing just to find the damn downstair.
|
![]() |
![]() |
![]() |
#4 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,431
Donated: $60
![]() ![]() |
lib/gamedata/dungeon_profile.txt has the names of all the possible level types - currently levels are roughly half classic, half modified, with the occasional cavern or labyrinth. Then src/gen-cave.c has generation functions for each of these, named classic_gen(), modified_gen(), etc.
Level sizes are set at the start of the generation functions.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#5 |
Prophet
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,596
![]() |
Thanks Nick! Much appreciated, I'm sure I'll end up asking a lot of these annoying question about where things are (though I've worked out that most of them say what they contain when I open them).
Anyway I tried comparing Os code here & woah a lot's changed.... but not? At least it seems to do the same thing organized much differently? So if I find the right no.s for O & find where they go in V it should generate an O-level? Anyway I've downloaded Sils code & while I suspect it'll have some hackery to generate forges I might be able to pinch the numbers from there & see if it'll generate a Sil sized level. Last edited by wobbly; July 7, 2018 at 19:13. |
![]() |
![]() |
![]() |
#6 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,706
Donated: $40
![]() |
I looked it up.
http://www.phial.com/angband/mods-28X.html Code:
^; |
![]() |
![]() |
![]() |
#7 | |
Veteran
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 2,123
![]() |
Quote:
__________________
“We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.” ― Tom Stoppard, Rosencrantz and Guildenstern are Dead |
|
![]() |
![]() |
![]() |
#8 |
Prophet
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,596
![]() |
Ok, turns out half of this is simple? There's already a scaling factor based on depth in there. Of course it ends up generating too many stairs & you get all of the dogs on top of you at once, but hey fun right? Not sure whether it's easier spliting the smaller levels off into there own category or trying to get the scaling factor to scale terrain & monster placement as well.
Edit: Maybe I can scale it by using the scaling % as a % chance of rejecting a placement, that may not be too hard? |
![]() |
![]() |
![]() |
#9 |
Prophet
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,596
![]() |
so if I change:
Code:
/* Scale the level */ i = randint1(10) + p->depth / 24; if (is_quest(p->depth)) size_percent = 100; else if (i < 2) size_percent = 75; else if (i < 3) size_percent = 80; else if (i < 4) size_percent = 85; else if (i < 5) size_percent = 90; else if (i < 6) size_percent = 95; else size_percent = 100; y_size = z_info->dungeon_hgt * (size_percent - 5 + randint0(10)) / 100; x_size = z_info->dungeon_wid * (size_percent - 5 + randint0(10)) / 100; Code:
/* Scale the level */ i = randint1(10) + p->depth / 9; if (is_quest(p->depth)) size_percent = 100; else if (i < 8) size_percent = 75; else if (i < 9) size_percent = 80; else if (i < 10) size_percent = 85; else if (i < 11) size_percent = 90; else if (i < 12) size_percent = 95; else size_percent = 100; y_size = z_info->dungeon_hgt * (size_percent - 5 + randint0(10)) / 100; x_size = z_info->dungeon_wid * (size_percent - 5 + randint0(10)) / 100; |
![]() |
![]() |
![]() |
#10 | |
Swordsman
Join Date: May 2016
Posts: 330
![]() |
Quote:
Code:
if (i < 2) alloc_stairs(c, FEAT_MORE, 1); else if (i < 5) alloc_stairs(c, FEAT_MORE, 2); else if (i < 12) /* and so on */; ![]() |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how do bows work?? | Sky | Vanilla | 5 | May 15, 2018 12:51 |
How do Quivers work | Freddo | Vanilla | 1 | March 13, 2015 15:32 |
how does squelch work? | Tibarius | Vanilla | 6 | January 10, 2015 19:35 |
[3.30] good work | Tibarius | Vanilla | 14 | August 5, 2011 16:20 |
Level completion (for level clearers) | fizzix | Vanilla | 19 | July 19, 2011 22:44 |