Should sometimes-secret rooms be teleportable?
Closed this issue · 9 comments
My test for bug #244 recently turned up something curious: Rooms like the Mausoleum and the Arcane Vault can sometimes be secret, and sometimes not. One particular random seed (1473880137) caused the Arcane Vault to be placed secretly, and then the Mausoleum to be connected to it. This caused the Mausoleum to be marked not secret.
Now, not much is done with this information other than to prevent non-secret rooms from being connected to secret rooms. But marking a room secret forces it to be non-teleportable. My question is, should marking a room as not secret cause it to become teleportable?
Additionally, should we prevent sometimes-secret rooms from being connected to secret rooms?
I don't know what the current rules for teleportation are, but I think it would make sense for it to be limited to somewhere connected to the source room. Without that kind of restriction when either you or Malygris teleport it could make the game unfinishable if you don't have means of digging.
I believe that is currently true unless you have used the Rod of the Master Builder to completely separate two areas of the main dungeon.
The question relates to secret rooms that have already been discovered - if you dig to a secret room, that room becomes connected to the dungeon, but you will still never teleport there. Even if a sometimes-secret room starts out connected (and not secret), you can still never teleport there.
I asked the second question because I was confused about how this bug cropped up in the first place. Unfortunately, I didn't save the transcript from the original bug and I'm confused about how it was possible. I may have to revert to an earlier commit just to recreate the transcript.
Ok, going back to that old version, I see that the Mausoleum and the Arcane Vault are both secretly placeable but also connectable. That means the Arcane Vault can be secretly placed, and then the Mausoleum can be connected to it while both remain secret. Edit: There was a flaw in the definition of "normally placed" that caused the Arcane Vault to be both normally and secretly placed.
Part of the reason this happens is because placing the Mausoleum happens very late in dungeon generation, after secret rooms are already placed. Tunnels and non-secret rooms are never placed after secret rooms - only "sometimes secret" rooms are, so this is the only time when it's possible.
So the question is: do we desire this outcome?
If we don't, here are some possible solutions:
don't make sometimes-secret rooms connectable. They will still be connected by their own special rules, but they'll never be connected to each other.Edit: placed rooms must be connectable in order to allow digging- Create a sometimes-secret property separate from "secretly placeable" and handle it with its own rule.
- Give sometimes-secret rooms a rule that sometimes wipes out the "secretly placeable" property before any rooms are placed - instead of the current rule that places them normally after secret rooms are placed. This would change where they are placed - currently they appear around the periphery of the dungeon and are not connected to more than one non-secret room. It might be possible to add a placement possible rule that produces a similar result, provided they were also made not connectable.
A simpler option:
When connecting sometimes-secret rooms, require that the room they're connected to is normally placed.Edit: This was already true, but the definition of "normally placed" led to surprises.
Here's the transcript from the failing test:
fail-244.transcript.txt
I just checked the code and it already says "normally placed" - but I think there's a bug in the definition of normally placed - a room is normally placed even when it is secretly placed!
I also found this:
Definition: a room is teleport-receiving if it is normally placed and it is teleportable and it is not nogo.
Turns out there is only one room that is both "placeable" and "secretly placeable" - the Arcane Vault. I think what I will do is remove the placeable property when a room is marked as secretly placed.
So the question now is: why is the Arcane Vault placeable but not the Mausoleum? Do we want to make extra sure that the Mausoleum never has more than one connection? Is that not true of the Arcane Vault? I'm curious.
I think the actual bugs here are resolved. The remaining question revolves around the definition of "teleport-receiving," which is the adjective that should always be used when choosing a teleport destination. I have updated the code to enforce this, but have not changed the definition.
I'm sorry I really don't know the dungeon generation code enough to say anything sensible. But if you're happy then I'm happy.
I guess I'm happy... if you can't teleport to a tunnel then maybe it doesn't make sense to teleport to a sometimes-secret room. Reaping has no such constraints, however.
I think I'm done with this for now. I may make a new refactoring ticket for Kerkerkruip 11.