Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 29, 2018, 09:43   #1
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,663
wobbly is on a distinguished road
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?
wobbly is offline   Reply With Quote
Old June 29, 2018, 11:50   #2
Huqhox
Apprentice
 
Huqhox's Avatar
 
Join Date: Apr 2016
Age: 48
Posts: 85
Huqhox is on a distinguished road
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"
Huqhox is offline   Reply With Quote
Old June 30, 2018, 01:12   #3
luneya
Adept
 
Join Date: Aug 2015
Posts: 234
luneya is on a distinguished road
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.
luneya is offline   Reply With Quote
Old June 30, 2018, 01:44   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,189
Donated: $60
Nick is on a distinguished road
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.
Nick is offline   Reply With Quote
Old July 7, 2018, 18:56   #5
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,663
wobbly is on a distinguished road
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.
wobbly is offline   Reply With Quote
Old July 7, 2018, 19:15   #6
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,989
Donated: $40
Pete Mack is on a distinguished road
I looked it up.
http://www.phial.com/angband/mods-28X.html
Code:
^;
is the inscription for 'do not attack' as of V2.8
Pete Mack is offline   Reply With Quote
Old July 8, 2018, 05:09   #7
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,646
Ingwe Ingweron is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
I looked it up.
http://www.phial.com/angband/mods-28X.html
Code:
^;
is the inscription for 'do not attack' as of V2.8
Just tried it.... Not quite. ^; inscription prevents walking, which I suppose works for the unintended digger situation, but little else. It won't work for the unintended ESP swap weapon or the pure pacifist.
__________________
“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
Ingwe Ingweron is offline   Reply With Quote
Old July 10, 2018, 02:05   #8
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,663
wobbly is on a distinguished road
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?
wobbly is offline   Reply With Quote
Old July 13, 2018, 18:06   #9
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,663
wobbly is on a distinguished road
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;
to
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;
it shouldn't generate a full size level for the 1st 17 dungeon levels?
wobbly is offline   Reply With Quote
Old July 13, 2018, 19:38   #10
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by wobbly View Post
it shouldn't generate a full size level for the 1st 17 dungeon levels?
Well it can still generate 99% size (95 - 5 + 9). And even 70% is not all that different from full sized level... There is also classic_gen(), where similar calculations don't seem to do much (just something about num_rooms). Maybe try a lot more aggressive scaling? For stairs, see calls to alloc_stairs(), you can use "i" to determine the desired number of stairs, e.g.
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 */;
A cleaner solution would be to introduce new profiles for small and medium levels. How's your C already? Generating dungeons is a good excercise, IMO
t4nk is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 04:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.