Skip to content

More level generation bug fixes - #394

Closed
copperwater wants to merge 4 commits into
NetHack:NetHack-3.7from
copperwater:more-level-fixes
Closed

copperwater wants to merge 4 commits into
NetHack:NetHack-3.7from
copperwater:more-level-fixes

Conversation

@copperwater

Copy link
Copy Markdown
Contributor

This contains a couple more fixes for bugs discovered later in xNetHack after the Lua changes in #347 were merged into it, plus a couple fixes for latent level generation bugs.

This is a simple && vs || bug. The clear intention of the code is that
stairs aren't supposed to generate in themed rooms unless there is no
other choice.

Fixes NetHack#348
This was leading to problems with special themed rooms which were
irregular. Walls of ordinary rooms count as part of the room, and
irregular rooms should be no different.

This also makes doors on the room edge be considered as part of the
room, which affected special room entry messages and filling.

All irregular rooms' walls getting marked as SHARED instead of their own
room is probably a latent bug in upstream NetHack, but will prevent
future issues for when/if themed rooms that involve special
rooms/subrooms get added.
This also caused the unexpected "You hear someone searching" message on
a level with an unlooted vault.
Consider the following scenario: There's a level where there's a zone of
des.replace_terrain() between the stairs and some other objective, and
the terrain is something non-walkable like trees. There's a chance that
the path is entirely blocked off by random replace_terrain, so you
make the level set terrain to '.' along a randline (or normal line, or
whatever) between the randomly placed stairs and the other side of the
replace_terrain zone. The problem: this overwrote the stairs with a '.'
as well.

This can be worked around in the lua file by first picking the desired
location of the stairs, then setting the terrain that overlaps with the
stairs, then doing des.stair() after that, but this is awkward and hard
to read.

So this makes it impossible for anything calling SET_TYPLIT (only called
in sp_lev.c) to overwrite stairs. I can't really think of a situation
where a level designer would want to define stairs, then maybe overwrite
them.
@paxed paxed closed this Sep 28, 2020
@copperwater
copperwater deleted the more-level-fixes branch May 22, 2021 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants