Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old November 27, 2017, 20:26   #61
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,702
Donated: $60
Nick is on a distinguished road
I see what's causing that crash, will be easy to fix.

Quote:
Originally Posted by PowerWyrm View Post
In fact, I don't like the new stair placement at all:
- too many levels have all stairs in the same small area
- too many stairs placed inside GVs in nasty places or outside vaults in unreachable enclosed areas
- many classic rooms that usually had stairs (and only stairs) are now completely empty
- stairs placed in the same room templates over and over

Also why not only doing stair placement for up staircases?
Yes, fair enough, I'll have another go.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old November 28, 2017, 02:13   #62
luneya
Adept
 
Join Date: Aug 2015
Posts: 158
luneya is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
In fact, I don't like the new stair placement at all:
- too many levels have all stairs in the same small area
- too many stairs placed inside GVs in nasty places or outside vaults in unreachable enclosed areas
- many classic rooms that usually had stairs (and only stairs) are now completely empty
- stairs placed in the same room templates over and over

Also why not only doing stair placement for up staircases?
Actually, if the idea is to not have the player start a level in a death trap, we don't really want to be modifying stair placement at all. A better solution would be to base things on the code that decides where to place @ when entering by recall/deep descent/tele level. Make that algorithm place @ in a safe location, and then spawn an appropriate stair under @ in the special case where the level was entered by stairs and the connected stairs option is turned on.
luneya is offline   Reply With Quote
Old November 28, 2017, 09:42   #63
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
Quote:
Originally Posted by luneya View Post
Actually, if the idea is to not have the player start a level in a death trap, we don't really want to be modifying stair placement at all. A better solution would be to base things on the code that decides where to place @ when entering by recall/deep descent/tele level. Make that algorithm place @ in a safe location, and then spawn an appropriate stair under @ in the special case where the level was entered by stairs and the connected stairs option is turned on.
That's actually a good idea... I'll steal that for PWMAngband, where the positions for people going up/down/randomly are stored into the cave->join structure, and so will be trivial to implement.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 12:28   #64
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,702
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by luneya View Post
Actually, if the idea is to not have the player start a level in a death trap, we don't really want to be modifying stair placement at all. A better solution would be to base things on the code that decides where to place @ when entering by recall/deep descent/tele level. Make that algorithm place @ in a safe location, and then spawn an appropriate stair under @ in the special case where the level was entered by stairs and the connected stairs option is turned on.
Yes you are, indeed, entirely correct. I'm going to back out the entire stair change and redo based on danger.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old November 28, 2017, 13:37   #65
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Nick View Post
Yes you are, indeed, entirely correct. I'm going to back out the entire stair change and redo based on danger.
I tried to do some changes in PWMAngband while keeping the old system. Basically, I've kept the idea of using three walls in the cardinal directions to decide to place stairs or not, but with the following changes:

- replacing square_is_wall() by feat_is_wall() in square_num_walls_adjacent() to consider only "real" walls and not other features like doors
- coding square_suits_stairs() using the same code as _find_in_range(), which is more efficient than just a for (i=1 to 1000) loop (this loop was in fact the reason while some stairs were placed in the middle of rooms, since it didn't consider enough possible locations before lowering the number of walls)
- using square_suits_stairs() in alloc_stairs() with walls = 3, then decreasing the value if no suitable location is found (which I think should never happen)

Looking at the result, this works fine except for a few cases where stairs can be placed in dangerous locations:
- vaults
- starburst rooms
- huge rooms

Stairs should probably be placed in vaults only if the vault was designed to have stairs (aka in the vault.txt file). In this case, it's easy to fix this by not allowing SQUARE_VAULT squares to be chosen. For other rooms, it would be easy to add a similar flag (SQUARE_NO_STAIRS?) and do the same.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 13:50   #66
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
While stairscumming to test my changes about stair placement, I experienced a strange crash during dungeon generation. Looking at what happened, it seems that the player was placed out of bounds when generating a labyrinth level. Since the previous level was persistent, I checked the code to see if such case could happen, and indeed there's a bug that occurs in this particular case.

With persistent levels, the size of the previous level is kept and passed to the dungeon generation routine:

Code:
struct chunk *labyrinth_gen(struct player *p, int min_height, int min_width)
In this case, the previous level was a normal level, so min_height/min_width are equal to regular dungeon height/width. The code then creates a small labyrinth:

Code:
int h = 15 + randint0(p->depth / 10) * 2;
int w = 51 + randint0(p->depth / 10) * 2;
With persistent levels, height and width are maxed:

Code:
/* Enforce minimum dimensions */
h = MAX(h, min_height);
w = MAX(w, min_width);
Now the code actually generates the level in labyrinth_chunk(), but considers that the outer walls don't belong to the labyrinth:

Code:
struct chunk *c = cave_new(h + 2, w + 2);
which for persistent levels is actually bigger than the size of the dungeon.

A simple fix would probably be:

Code:
/* Enforce minimum dimensions */
h = MAX(h, min_height - 2);
w = MAX(w, min_width - 2);
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 14:01   #67
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
Stairs should probably be placed in vaults only if the vault was designed to have stairs (aka in the vault.txt file). In this case, it's easy to fix this by not allowing SQUARE_VAULT squares to be chosen. For other rooms, it would be easy to add a similar flag (SQUARE_NO_STAIRS?) and do the same.
You clearly don't want stairs in vaults such as "High Temple of the Underworld"...
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 14:18   #68
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
A simple fix would probably be:

Code:
/* Enforce minimum dimensions */
h = MAX(h, min_height - 2);
w = MAX(w, min_width - 2);
In fact there is more: to generate a proper labyrinth, height and width have to be odd numbers, which is not the case with persistent levels, since classic dungeon size is 66x198. So the previous formula has to be adapted so that h & w are always odd numbers. For example:

Code:
    /* Enforce minimum dimensions */
    h = MAX(h, min_height);
    w = MAX(w, min_width);

    /* Enforce maximum dimensions */
    h = MIN(h, z_info->dungeon_hgt - 3);
    w = MIN(w, z_info->dungeon_wid - 3);
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!

Last edited by PowerWyrm; November 28, 2017 at 15:29.
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 15:27   #69
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
The "Mirrored script "B"s" vault is not centered, probably not intended.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 28, 2017, 17:38   #70
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,143
PowerWyrm is on a distinguished road
Oops! In commit b56eea2, the weapon slot is not restored if num == max_num.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm 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
Bugs and issues in 4.1.0 Nomad Vanilla 497 November 16, 2017 09:36
Some Sil issues fph Sil 12 January 4, 2013 01:41
A couple of 3.4 issues bron Vanilla 10 October 3, 2012 15:43
Gear Issues Monkay AAR 1 February 25, 2012 18:32
Compilation issues. Tiburon Silverflame Development 8 March 1, 2010 21:34


All times are GMT +1. The time now is 03:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.